dx build --wasm-split gives different split modules (and hashed names) for identical input
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, wasm
- Domain
- build-system
Research direction
Start by tracing the dx build --platform web --release --wasm-split path and find where split wasm modules and the JavaScript entry are emitted; the issue does not name files or tests. Check whether map iteration order affects emitted output, then run identical builds twice and compare the split module and entry bytes. Done when identical inputs produce identical bytes and hashed asset names.
Written by the indexing model from the issue text.
Description
Two dx build --platform web --release --wasm-split runs (dx 0.7.10) on the same code, with the same toolchain and settings, give a byte-identical main module, but the split module and the JS entry come out with different bytes and therefore different hashed names (module_0_<name>-dxh….wasm, <app>-dxh….js). With a larger split module, about 37,000 bytes differed between runs.
It looks like wasm-split iterates HashMaps, whose order is random per run.
Effect: every deploy gives every split file a new name, so every client re-downloads every split file even when nothing changed. That defeats long-lived caching of the hashed assets.
Using an ordered map (BTreeMap/IndexMap) or sorting before emitting would make it deterministic. For now we work around it by keeping builds keyed by a hash of their inputs and reusing an unchanged one.
Possibly related: #4439 (HashMap iteration order in asset handling).
- Dominant language
- Rust
- Stars
- 39.8k
- Forks
- 2k
- Avg merge
- 14h 29m
- Merged PRs (30d)
- 20
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DioxusLabs/dioxus
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
DioxusLabs/dioxus#6095 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DioxusLabs/dioxus#6089 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
DioxusLabs/dioxus#6063 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DioxusLabs/dioxus#6058 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DioxusLabs/dioxus#6008 ·
Maintainers usually reply within 1 day
All issues in DioxusLabs/dioxus
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mongodb/kingfisher#588 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
franciscoBSalgueiro/en-croissant#1111 ·
Maintainers usually reply within 2 days
-
[bug] Toolchain versions from `.prototools` are not inherited when moon runs from a subdirectoryOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day