feat: router-based wasm bundle splitting #3683
Draft
+4,269
−264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: