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

Merged
merged 68 commits into from
Feb 14, 2025
Merged

feat: router-based wasm bundle splitting #3683

merged 68 commits into from
Feb 14, 2025

Conversation

jkelleyrtp
Copy link
Member

@jkelleyrtp jkelleyrtp commented Feb 4, 2025

Implements router-based wasm bundle splitting under an experimental flag --experimental-wasm-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)
  • Re-enable chunking
  • Documentation

@jkelleyrtp jkelleyrtp marked this pull request as ready for review February 13, 2025 03:42
@jkelleyrtp jkelleyrtp requested a review from a team as a code owner February 13, 2025 03:42
@jkelleyrtp jkelleyrtp merged commit bdeedc1 into main Feb 14, 2025
17 checks passed
@jkelleyrtp jkelleyrtp deleted the jk/bundle-splitting branch February 14, 2025 02:54
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