Repository navigation
Commit e9a34ae
authored
fix(analyzable): bake urls past cycles, mixed-served wasm and partial style maps (#21851)
* refactor(analyzable): fold the wasm runtime grouping into one pass
The grouping, which groups fetch and whether every entry of a group does
were three memoized methods scanning the chunks twice for the same
predicate. One builder answers all three, so a compilation with wasm
walks its chunks once instead of twice.
A bailout now hands back the answer its caller was going to return, so a
refusal and its reason read as one statement rather than two.
* refactor(analyzable): drop work the specifier builders repeat
A chunk import scanned every module of the target chunk and every source
type of each with no early exit, then discarded the answer whenever the
specifier could not be baked. It is asked after the specifier settles,
and only until one type answers.
An asset url resolved the public path prefix twice on the branch that
takes both, and the whole builder sat one level inside a base check that
reads as an early return. The deferred pass rebuilt its scanning regexp
per module rather than per chunk, and the part kinds spelled out of the
compilation hash were written out at both places that test them.
* refactor(analyzable): one call for the worker url gate and build
Three call sites asked supportsAnalyzable and then reached into the
private chunk specifier builder with the same arguments; the pair is now
getAnalyzableWorkerUrl, so the worker emit, the worklet emit and the
resource hint agree by construction.
The probe call a filename function is asked with was spelled out three
times, and the deferred pass resolved output.publicPath once per
stand-in rather than once per pass.
* feat(analyzable): lift two limitations on baked urls
ESM output writes import.meta whatever environment.module claims — the
public path and the chunk loader already assume the target reads it — so
the url forms no longer bail on that flag: output.module and a native
importFunctionName are the requirements.
A stylesheet url map lost every entry as soon as one chunk could not be
named, which a split runtime chunk hits: the entry chunk hashes after
the runtime chunk naming it. The map now keeps what it could name and
the missing ids fall back to the runtime lookup, whose globals ship only
then. Script hint maps stay complete-or-nothing — a hint is best-effort
and no organic build produces a partial one.
* feat(analyzable): bake naming cycles, both-ways wasm, and gate the vm copy
optimization.realContentHash assigned hashes along a chain and threw on
a circle, so two chunks baking each other's hashed names could never
both bake. Circles are now assigned as one group — each member's
occurrences told apart by a stable marker — so the pair reaches a fixed
point and both directions bake; without the repair the fold still bakes
only the direction that hashes first.
The wasm fetch anchor gate now probes the same builder the generator
runs, so a binary served both through the public path and not — one
chunk the host fetched, one the loader did — bakes a per-asset literal
instead of bailing group-wide.
Build-time execution kept a hole: the wasm loading taps and runtime
modules decided analyzable output without a chunk graph, so a module
executed at build time could receive import.meta its vm wrapper cannot
parse. The taps and runtime modules now pass their graph, and the
loaders take the settled decision instead of re-deriving it.
* chore: nest the coderabbit tools block under reviews
A top-level `tools:` is rejected by schema.v2 (`additionalProperties: false`),
so every review reported "Unrecognized key: tools" and none of the eight tools
it configures was ever applied. Drop `github-checks.timeout_ms` with it: the
schema gives that tool `enabled` alone, so it never took effect either.
* chore: add the changeset for the analyzable fixes
* test: pin the url forms ignoring environment.module
* style: shorten three comments to the two-line cap1 parent 58620dc commit e9a34ae
37 files changed
Lines changed: 871 additions & 611 deletions
File tree
- .changeset
- lib
- css
- dependencies
- esm
- node
- optimize
- prefetch
- wasm-async
- web
- test
- configCases
- analyzable
- circular-chunk-hashes
- split-runtime-css-href
- wasm/analyzable-served-both-ways
- statsCases/analyzable-esm-fallbacks
- __snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
178 | 176 | | |
179 | 177 | | |
180 | 178 | | |
| |||
0 commit comments