Skip to content

Commit e9a34ae

Browse files
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 cap
1 parent 58620dc commit e9a34ae

37 files changed

Lines changed: 871 additions & 611 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": patch
3+
---
4+
5+
Fix analyzable ESM baking around cycles, mixed-served wasm and style url maps.

‎.coderabbit.yaml‎

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,24 @@ reviews:
155155
mode: "warning"
156156
issue_assessment:
157157
mode: "warning"
158-
159-
tools:
160-
eslint:
161-
enabled: true
162-
actionlint:
163-
enabled: true
164-
gitleaks:
165-
enabled: true
166-
shellcheck:
167-
enabled: true
168-
yamllint:
169-
enabled: true
170-
# Prettier + cspell own Markdown/prose style in this repo (yarn fix / yarn lint)
171-
markdownlint:
172-
enabled: false
173-
languagetool:
174-
enabled: false
175-
github-checks:
176-
enabled: true
177-
timeout_ms: 90000
158+
tools:
159+
eslint:
160+
enabled: true
161+
actionlint:
162+
enabled: true
163+
gitleaks:
164+
enabled: true
165+
shellcheck:
166+
enabled: true
167+
yamllint:
168+
enabled: true
169+
# Prettier + cspell own Markdown/prose style in this repo (yarn fix / yarn lint)
170+
markdownlint:
171+
enabled: false
172+
languagetool:
173+
enabled: false
174+
github-checks:
175+
enabled: true
178176

179177
chat:
180178
art: false

0 commit comments

Comments
 (0)