test(code-splitting): pin flag-off wrapped-esm init emission#10324
Merged
Conversation
hyfdev
force-pushed
the
codex/strict-entry-transitive-init-gate
branch
from
July 16, 2026 15:14
4306dd7 to
3bbc10b
Compare
hyfdev
force-pushed
the
codex/strict-flag-off-init-pins
branch
from
July 16, 2026 15:14
3e47ed5 to
5d53731
Compare
hyfdev
force-pushed
the
codex/strict-flag-off-init-pins
branch
from
July 21, 2026 08:32
5d53731 to
b2066a6
Compare
hyfdev
changed the base branch from
codex/strict-entry-transitive-init-gate
to
main
July 21, 2026 08:32
hyfdev
force-pushed
the
codex/strict-flag-off-init-pins
branch
from
July 21, 2026 09:22
b2066a6 to
eafc697
Compare
✅ Deploy Preview for rolldown-rs canceled.
|
hyfdev
marked this pull request as ready for review
July 21, 2026 10:00
hyfdev
force-pushed
the
codex/strict-flag-off-init-pins
branch
from
July 21, 2026 13:18
7f1fae6 to
bcce900
Compare
shulaoda
approved these changes
Jul 21, 2026
Member
Author
Merge activity
|
## Summary Adds three executable **flag-off** regression fixtures for wrapped-ESM init emission changes that landed with #10104. None enables `strictExecutionOrder`, and this PR changes no production source. The earlier version of this PR required each barrel directly, which wrapped the immediate importee and bypassed the shared init-target collector it claimed to cover. The two collector fixtures now keep the immediate barrel at `WrapKind::None` in a shared chunk, while later `require()` calls wrap the leaf owners and make their init symbols reachable from the main chunk. ## Coverage ### Importer-local namespace liveness `namespace_liveness_gating` imports the barrel namespace but reads only `ns.a()`. A second entry places the unwrapped barrel in a shared chunk; later requires make both wrapped leaf init symbols reachable. - Current output emits only `init_leaf_a()` at the namespace-import position. `init_leaf_b()` stays at its later explicit require position. - Pre-#10104 output emitted `init_leaf_a(), init_leaf_b()` together at the namespace-import position. - The shared barrel still evaluates both leaves exactly once; runtime order is `A, B, BEFORE_REQUIRE:a, MAIN`. ### Sorted, non-ambiguous star-export routing `ambiguous_star_reexport` has two wrapped leaves that both export `x`. The entry uses a real `export * from` record; a dynamic CommonJS re-export keeps that record included, while the second entry keeps the immediate barrel unwrapped and in another chunk. - Current output excludes ambiguous `x` from the collector's sorted, non-ambiguous export map and emits no owner init before `__reExport(...)`. - Pre-#10104 output selected an ambiguous owner and emitted `init_mod_a()` before `__reExport(...)`. - Runtime confirms `x` is absent and both owners still evaluate exactly once through the shared barrel. ### Excluded re-export to a TLA wrapper `excluded_reexport_tla` uses `codeSplitting: false`, so an inline dynamic import wraps the barrel and its static dependency chain even with strict execution order disabled. With `moduleSideEffects: false`, the carrier's unused re-export is excluded while the same TLA leaf remains live through a separate `used` import. - Current output emits `await init_leaf()` in the carrier's async wrapper before its later statement. - Pre-#10104 output emitted bare `init_leaf()`, producing `CARRIER:undefined` before the leaf's top-level await completed. - Current runtime order is `LEAF:before, LEAF:after, CARRIER:ready, BARREL:used:marker`. ## Behavior / snapshot impact Tests only: two existing fixtures are corrected, one TLA fixture is added, and their generated snapshots are pinned. No existing production code or unrelated snapshot changes. ## Validation - Rebased onto `main` at `cccf1d0d849c71e80c02fe3ff17a97192f3bf258`. - Generated all three fixtures with the macOS native binding from current-main CI [run 29795703407](https://github.com/rolldown/rolldown/actions/runs/29795703407); every `_test.mjs` passed under Node. - Compared each committed snapshot byte-for-byte with those generated assets after applying the integration harness's runtime-module hiding. - Re-ran the same sources with the pre-#10104 binding from CI [run 29559371389](https://github.com/rolldown/rolldown/actions/runs/29559371389): both collector fixtures show the obsolete extra init, and the TLA fixture logs `CARRIER:undefined`. - `vp fmt ... --check`, `typos`, JS syntax checks, JSON parsing, and `git diff --check` pass. The pre-commit `vp check --fix` hook also completed cleanly. - CI [run 29819995357](https://github.com/rolldown/rolldown/actions/runs/29819995357): Repo, Rust, Node, Cargo, WASI, native-build, and Node 20/22/24 test jobs passed. Vite Test Ubuntu and the three Ubuntu Dev Server jobs stopped before tests because the Vite `rolldown-canary` branch no longer rebases cleanly onto `vite/main` (`pnpm-lock.yaml` conflict); this is unrelated Vite checkout noise. ## AI usage disclosure Per the [AI Usage Policy](https://rolldown.rs/contribution-guide/#ai-usage-policy), OpenAI Codex was used to rebase and review the PR, design the corrected regression shapes, and verify generated output. I reviewed the final diff and validation evidence. --- Follow-up to #10104; addresses Major 2b/2c from the review discussion: #10104 (comment)
graphite-app
Bot
force-pushed
the
codex/strict-flag-off-init-pins
branch
from
July 21, 2026 13:36
bcce900 to
42363da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds three executable flag-off regression fixtures for wrapped-ESM init emission changes that landed with #10104. None enables
strictExecutionOrder, and this PR changes no production source.The earlier version of this PR required each barrel directly, which wrapped the immediate importee and bypassed the shared init-target collector it claimed to cover. The two collector fixtures now keep the immediate barrel at
WrapKind::Nonein a shared chunk, while laterrequire()calls wrap the leaf owners and make their init symbols reachable from the main chunk.Coverage
Importer-local namespace liveness
namespace_liveness_gatingimports the barrel namespace but reads onlyns.a(). A second entry places the unwrapped barrel in a shared chunk; later requires make both wrapped leaf init symbols reachable.init_leaf_a()at the namespace-import position.init_leaf_b()stays at its later explicit require position.init_leaf_a(), init_leaf_b()together at the namespace-import position.A, B, BEFORE_REQUIRE:a, MAIN.Sorted, non-ambiguous star-export routing
ambiguous_star_reexporthas two wrapped leaves that both exportx. The entry uses a realexport * fromrecord; a dynamic CommonJS re-export keeps that record included, while the second entry keeps the immediate barrel unwrapped and in another chunk.xfrom the collector's sorted, non-ambiguous export map and emits no owner init before__reExport(...).init_mod_a()before__reExport(...).xis absent and both owners still evaluate exactly once through the shared barrel.Excluded re-export to a TLA wrapper
excluded_reexport_tlausescodeSplitting: false, so an inline dynamic import wraps the barrel and its static dependency chain even with strict execution order disabled. WithmoduleSideEffects: false, the carrier's unused re-export is excluded while the same TLA leaf remains live through a separateusedimport.await init_leaf()in the carrier's async wrapper before its later statement.init_leaf(), producingCARRIER:undefinedbefore the leaf's top-level await completed.LEAF:before, LEAF:after, CARRIER:ready, BARREL:used:marker.Behavior / snapshot impact
Tests only: two existing fixtures are corrected, one TLA fixture is added, and their generated snapshots are pinned. No existing production code or unrelated snapshot changes.
Validation
Rebased onto
mainatcccf1d0d849c71e80c02fe3ff17a97192f3bf258.Generated all three fixtures with the macOS native binding from current-main CI run 29795703407; every
_test.mjspassed under Node.Compared each committed snapshot byte-for-byte with those generated assets after applying the integration harness's runtime-module hiding.
Re-ran the same sources with the pre-feat(code-splitting): wrap strict execution order modules on demand #10104 binding from CI run 29559371389: both collector fixtures show the obsolete extra init, and the TLA fixture logs
CARRIER:undefined.vp fmt ... --check,typos, JS syntax checks, JSON parsing, andgit diff --checkpass. The pre-commitvp check --fixhook also completed cleanly.CI run 29819995357: Repo, Rust, Node, Cargo, WASI, native-build, and Node 20/22/24 test jobs passed. Vite Test Ubuntu and the three Ubuntu Dev Server jobs stopped before tests because the Vite
rolldown-canarybranch no longer rebases cleanly ontovite/main(pnpm-lock.yamlconflict); this is unrelated Vite checkout noise.AI usage disclosure
Per the AI Usage Policy, OpenAI Codex was used to rebase and review the PR, design the corrected regression shapes, and verify generated output. I reviewed the final diff and validation evidence.
Follow-up to #10104; addresses Major 2b/2c from the review discussion: #10104 (comment)