{"id":15984642,"url":"https://github.com/aappddeevv/scalajs-dynamic-modules","last_synced_at":"2025-10-12T14:19:44.356Z","repository":{"id":97610014,"uuid":"329970892","full_name":"aappddeevv/scalajs-dynamic-modules","owner":"aappddeevv","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-16T16:40:26.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T20:46:37.283Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aappddeevv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-15T16:53:01.000Z","updated_at":"2021-01-16T16:40:28.000Z","dependencies_parsed_at":"2023-04-20T19:32:04.168Z","dependency_job_id":null,"html_url":"https://github.com/aappddeevv/scalajs-dynamic-modules","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"9a2a37b1f3471a550bccd037ce8dace950ad2454"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aappddeevv/scalajs-dynamic-modules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-dynamic-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-dynamic-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-dynamic-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-dynamic-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aappddeevv","download_url":"https://codeload.github.com/aappddeevv/scalajs-dynamic-modules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-dynamic-modules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011598,"owners_count":26084964,"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-12T02:00:06.719Z","response_time":53,"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":[],"created_at":"2024-10-08T02:09:58.145Z","updated_at":"2025-10-12T14:19:44.324Z","avatar_url":"https://github.com/aappddeevv.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"Very small example of dynamic module loading using scala.js.\n\nThe UI uses react, although that is not critical to show\ndynamic module loading.\n\nThis is a bare bones example.\n\n## Running with Reload\n\nThe follow terminal commands start the scala side and\nthe bundler side in watch mode suitable for development.\nA production build would contain other processing steps\nin both build specifications.\n\nThis build will update the scala module upon sbt\nrebuild but it does not do module-level HMR, which\ncan be done for react, but this example does not show it.\n\nIf you change the code, the entire scala module is reloaded.\n\n```sh\nnpm install\nsbt ~webui/fastLinkJS\n# seperate terminal\nnpm run watch\n```\n\nA bundle size visualizer is included so open 2 pages:\n\n* app: http://localhost:8080\n* bundle visualizer: http://localhost:8888\n\n## Commentary\n\nIf you run `npm run build` you will see in the build folder, a\nseparate module something like `621.Scala.js`. Webpack automatically\nsees the react dynamic module and creates a bundle whose name\nreflects the webpack output bundle name. It transforms the \nscala.js output `HeavyFeature` class into a name resembling\nthe webpack configuration, not the scala.js linker output model.\n\nAll of this worked the first time, so kudos to the scala.js team.\n\n## Production build\n\nTo build the code and run it from the build directory with \na static web server:\n\n```sh\nnpm install\nsbt webui/fullLinkJS\nnpm run start\n```\n\nThen open:\n\n* app: http://localhost:8080\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fscalajs-dynamic-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faappddeevv%2Fscalajs-dynamic-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fscalajs-dynamic-modules/lists"}