Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: router-based wasm bundle splitting #3683

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Conversation

jkelleyrtp
Copy link
Member

@jkelleyrtp jkelleyrtp commented Feb 4, 2025

Implements router-based wasm bundle splitting under an experimental flag --experimental-bundle-split.

The main implementation fits in a single file, which I think is necessary to keep the code maintainable given its inherent complexity.


Takes a similar approach to https://github.com/jbms/wasm-split-prototype but does not manually encode wasm modules.

The original prototype is (imo) a bit too complex. The approach in this PR simply trims away portions of the modules and then uses the export/import map to connect them together. The only "indirect functions" we create are simply the functions at the #[wasm_split] boundaries.

I've tested everything against the harness, however I'd like to test it against the docsite which requires full dioxus-cli integration.

Everything is implemented (data section splitting, shared chunk extraction, lazy-loading, etc)


Todo:

  • wire up into the CLI
  • wire up into the router (ideally with help from @ealmloff)
  • Documentation
  • Publish/reserve the wasm-split names on crates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant