{"id":15010454,"url":"https://github.com/stevebuik/stu","last_synced_at":"2025-10-08T23:53:03.349Z","repository":{"id":62434741,"uuid":"130627624","full_name":"stevebuik/Stu","owner":"stevebuik","description":"Display Clojurescript builds using D3","archived":false,"fork":false,"pushed_at":"2018-07-12T09:46:44.000Z","size":551,"stargazers_count":45,"open_issues_count":11,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-06T00:23:17.388Z","etag":null,"topics":["ci","clj","cljs-compiler","clojurescript","d3","devcards","reagent-components","shadow-cljs","treemap"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevebuik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-23T02:10:10.000Z","updated_at":"2023-08-20T12:41:25.000Z","dependencies_parsed_at":"2022-11-01T21:15:50.820Z","dependency_job_id":null,"html_url":"https://github.com/stevebuik/Stu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stevebuik/Stu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevebuik%2FStu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevebuik%2FStu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevebuik%2FStu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevebuik%2FStu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevebuik","download_url":"https://codeload.github.com/stevebuik/Stu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevebuik%2FStu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000713,"owners_count":26082862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","clj","cljs-compiler","clojurescript","d3","devcards","reagent-components","shadow-cljs","treemap"],"created_at":"2024-09-24T19:34:22.151Z","updated_at":"2025-10-08T23:53:03.322Z","avatar_url":"https://github.com/stevebuik.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stu\n\nDisplays the output of CLJS compilation in an interactive UI.\nThe artifact produced is static so it can be viewed without a server and even emailed as an attachment.\n\n[Try it out using this sample](http://htmlpreview.github.io/?https://github.com/stevebuik/Stu/blob/master/resources/public/stu-builds.html).\nThis page was generated by Stu against a few iterations of [Stu's viz app](https://github.com/stevebuik/Stu/blob/master/src/cljs/viz/app.cljs).\n\nObservations you can see in the Stu sample:\n\n* cljs.pprint was used in Stu in early versions. After seeing how much code it generated, it was removed from all app code. compare 0.5 and 0.7\n* Stu was code-split, becoming two modules. Code split apps show one treemap for each module. compare 0.8 and 0.9\n* Using a minified version of d3 has no effect on overall artifact size. compare 0.9 and 1.0\n\nStu is invoked using the command line (or the REPL), intended to be run in a CI server.\n\nInitially supports Shadow CLJS but can support any compilation source.\n\n[![Clojars Project](https://img.shields.io/clojars/v/stu.svg)](https://clojars.org/stu)\n\n## Usage\n\n### Prerequisite\n\nStu works by scanning a directory for *bundle-info.edn* files and transforming them.\nThese files are called **snapshots** and can be generated by Shadow CLJS.\n\nStu assumes you have already generated one or more snapshots. These are typically in the .shadow-cljs/release-snapshots/\u0026lt;app name\u0026gt; directory.\nTo generate snapshot(s) using Shadow CLJS you invoke:\n\n`(shadow/release-snapshot :app {:tag \"0.8\"})` with your own tag or...\n\n`(shadow/release-snapshot :app {})` to generate a *latest* snapshot.\n\nIn future this manual step [will be automated](https://github.com/stevebuik/Stu/issues/2) into another CLI by some genius developer whose help will be greatly appreciated.\n\n### Illumination (i.e. static file generation)\n\n**CLI Options**\n\n    -h or --help shows this message\n    -d or --dir \u003cdirectory\u003e is the directory where Shadow snapshots are read from. defaults to .shadow-cljs/release-snapshots/app\n    -f or --file \u003cfile name\u003e is the name of the file to be generated. defaults to target/stu.html\n\n**Leiningen**\n\nAdd the Stu dependency `[stu \"0.1.0\"]` to your `project.clj`.\n\nThen generate the html report, use the *illuminate* CLI.\n\n`lein run -m stu.illuminate` invokes the command line with default args.\n\n**Deps**\n\nInclude a dependency on this project in your `deps.edn`. You will probably wish to put it in a dev alias.\n\n    {:aliases {:dev {:extra-deps {github-stevebuik/Stu {:git/url \"https://github.com/stevebuik/Stu.git\"\n                                                        :sha     \"1a06621813209a17848ed43f9fd28e5471ddf36f\"}}}}}\n\nThen generate the html report, use the *illuminate* CLI.\n\n`clj -Adev -m stu.illuminate` invokes the command line with default args.\n\n**Other**\n\nAny other way of invoking *stu.illuminate/-main* is valid e.g. the Shadow CLJS *clj-run* feature.\n\nThe CLI will print the location of the generated file.\n\n## Questions Stu can answer\n\nStu was built to answer questions about your javascript artifacts. All features exist to answer these questions:\n\n| Question | Feature |\n|----------|---------|\n|How big are my artifacts and how have they grown?| The bar chart |\n|How big are they when gzipped?| The \"Uncompressed\" toggle|\n|What are the largest parts of my javascript artifact? | The treemap|\n|How big are my artifacts when code split?| Multiple treemaps|\n|How much does Google Closure reduce the size of my artifacts| The \"Compiled\" toggle|\n|How much does Google Closure affect npm deps?| The \"Compiled\" toggle|\n|Is using minified npm deps reducing my artifact size?| The treemap|\n|How has my artifact grown over the last 10 weeks?| [TODO The snapshot generator](https://github.com/stevebuik/Stu/issues/2)|\n|How did that code end up in my artifact?| [TODO path data in tooltip](https://github.com/stevebuik/Stu/issues/4)|\n|Is there any code in my artifact that should not be there?| [TODO CLI checks for disallowed code](https://github.com/stevebuik/Stu/issues/12)|\n|Your question here?| TODO |\n\nAll enhancement issues in this project should be written in terms of Question/Answer to ensure valuable features are added.\n\n## Design\n\nStu is a reagent component which is passed [protocol impl](https://github.com/stevebuik/Stu/blob/master/src/cljs/stu/app.cljs#L11) to provide data. That data is [checked using a spec](https://github.com/stevebuik/Stu/blob/master/src/cljc/stu/core.cljc) to ensure it's correct.\n\nThis provides two benefits:\n\n1. The component can be run in devcards using different/simple impls of the protocol to display different behaviours.\n2. The spec allows any other CLJS compiler capable of generating the data to also use Stu. e.g.\n    * cljs.main\n    * cljs-build\n\nStu uses [react faux dom](https://github.com/Olical/react-faux-dom) to simplify the use of D3 interop.\nInstead of worrying about how to handle D3s join mutations vs Reacts dom diff based mutations, this allows the d3 interop code to be copied directly from javascript examples, including mutations.\nThis makes the d3 charts much simpler to write.\n\nUsing Stu on a large app with many snapshots could generate a large dataset.\nThe generated data is appended to the static output file using a JSON map with the treemap data encoded using transit.\nThis allows the GlobalsSource to load only one dataset at a time which mimimises memory consumption.\nThe use of transit reduces the data size due to it's keyword caching.\n\nIn practice, these space savings are small compared to the size of the Stu app javascript but that may improve in future as npm deps can be processed by Google Closure advanced compilation.\n\n## Naval Gazing\n\nSince Stu is a CLJS app, it can be used on itself. This is great because it provides a good example\nbut can also be used to test and develop itself. Examples include:\n\n1. The sample app above\n2. The development app running with recorded data\n3. The (meager) tests can use a \"latest\" snapshot to ensure a valid transformation\n\n## Development\n\n* start a lein REPL and `(start-dev!)`\n* navigate your browser to http://localhost:8280/devcards.html and explore.\n* notice the *Run Viz Application* link which runs the full App in dev mode, with hot code-loading, same as devcards\n\n## Roadmap\n\nAll new features are [logged as issues](https://github.com/stevebuik/Stu/labels/enhancement) and tagged as enhancements.\n\nAny help would be greatly appreciated.\n\n## Who is Stu?\n\nHe was an internet pioneeer who [used technology to bring light](https://www.youtube.com/watch?v=WzuMwNmH9Vo) to the shadows\n\n## License\n\nCopyright © 2018 Steve Buikhuizen\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevebuik%2Fstu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevebuik%2Fstu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevebuik%2Fstu/lists"}