refactor(link_stage): simplify exports-kind filter and clarify safety comments#9205
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 22, 2026
Conversation
✅ Deploy Preview for rolldown-rs canceled.
|
Merging this PR will not alter performance
Comparing Footnotes
|
h-a-n-a
approved these changes
Apr 22, 2026
Member
Author
Merge activity
|
… comments (#9205) Collapse the two-step `filter_map` + `for_each` in `determine_module_exports_kind` so the iterator yields `(rec, &NormalModule)` directly via `Module::as_normal`, removing the inline `let-else` inside the closure. Also rewrites the `SAFETY:` and promotion comments to be clearer about what each branch does and why self-import aliasing is safe. Note: replaces #9178 which was auto-closed as merged after a stack reorder (GitHub detected all its commits were in its former base branch). Same content, now targeting main directly.
e780042 to
e0733e4
Compare
graphite-app Bot
pushed a commit
that referenced
this pull request
Apr 27, 2026
Reverts the iterator restructuring from #9205 in `determine_module_exports_kind`, restoring the original `filter_map(rec.resolved_module)` + inline `let Module::Normal(importee) = ... else { return; }` pattern. The clarified `SAFETY` and promotion comments introduced in that PR are kept intact — only the structural refactor is rolled back. We're rolling back the structural change because it appears to have introduced a regression that we have not yet been able to reduce to a reliable repro. Restoring the prior shape lets us unblock users while we continue investigating the root cause; once we have a minimal reproduction we can revisit the refactor with a regression test in place.
This was referenced Apr 29, 2026
Closed
Merged
shulaoda
added a commit
that referenced
this pull request
Apr 29, 2026
## [1.0.0-rc.18] - 2026-04-29 ### 💥 BREAKING CHANGES - optimization: default unspecified inlineConst.mode to smart (#9248) by @IWANABETHATGUY ### 🐛 Bug Fixes - rolldown_plugin_vite_import_glob: return error instead of panicking when virtual module uses a relative glob (#9241) by @shulaoda - binding: treat empty inlineConst object as omitted (#9247) by @IWANABETHATGUY - rolldown: keep enum declaration for optional-chain access (#9229) by @Dunqing - link_stage: restore inline let-else in exports-kind filter (#9237) by @IWANABETHATGUY - dev/lazy: avoid module reinitialization in lazy compilation patches (#9179) by @h-a-n-a - dev: visit identifier references for runtime rewrites in HMR finalizer (#9191) by @h-a-n-a - chunk-optimizer: pick dominator for runtime placement to avoid cycles (#9164) by @IWANABETHATGUY - make `this.emitFile` chunk path synchronous to avoid deadlock (#9031) by @lazarv - use sentinel id for `browser: false` ignored modules (#9192) by @shulaoda - prevent chunk optimizer from creating import cycles (#9228) by @IWANABETHATGUY ### 🚜 Refactor - replace tokio::sync::Mutex with std::sync::Mutex for non-IO data (#9176) by @shulaoda - rolldown_plugin_vite_import_glob: do not rewrite import path for absolute base (#9195) by @shulaoda - runtime_helper: wrap DependedRuntimeHelperMap in a struct (#9215) by @IWANABETHATGUY - drop redundant clear() in determine_safely_merge_cjs_ns (#9206) by @IWANABETHATGUY - clean up generate_lazy_export (#9208) by @IWANABETHATGUY - bitset: return bool from set_bit to fuse guard-and-set (#9207) by @IWANABETHATGUY - link_stage: simplify exports-kind filter and clarify safety comments (#9205) by @IWANABETHATGUY ### 📚 Documentation - determine_module_exports_kind (#9252) by @IWANABETHATGUY - fix dead link to esbuild ESM/CJS interop tests (#9230) by @Copilot - remove CSS bundling references (#9234) by @shulaoda - correct IncrementalFullBuild row in BundleMode table (#9214) by @IWANABETHATGUY - design: add bundler data lifecycle design doc (#9212) by @hyf0 - remove minifier alpha status notices (#9202) by @sapphi-red ### ⚙️ Miscellaneous Tasks - upgrade oxc to 0.128.0 (#9260) by @shulaoda - deps: bump rolldown-ariadne to 0.6.0 (#9254) by @IWANABETHATGUY - deps: update github actions (#9259) by @renovate[bot] - deps: update github actions (#9258) by @renovate[bot] - remove renovate overrides (#9257) by @Boshen - use ubuntu-latest for security workflow (#9256) by @Boshen - notify Discord around release publish (#9251) by @Boshen - add release environment to npm publish workflow (#9250) by @Boshen - justfile: drop the `--` separator before forwarded args in `vp run` (#9246) by @shulaoda - deps: update test262 submodule for tests (#9243) by @sapphi-red - add more tracing instrumentations (#9220) by @sapphi-red - rolldown_plugin_vite_import_glob: remove outdated sourcemap doc comment (#9213) by @shulaoda - update security workflow (#9201) by @Boshen ### ❤️ New Contributors * @lazarv made their first contribution in [#9031](#9031) Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
Closed
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.
Collapse the two-step
filter_map+for_eachindetermine_module_exports_kindso the iterator yields(rec, &NormalModule)directly viaModule::as_normal, removing the inlinelet-elseinside the closure. Also rewrites theSAFETY:and promotion comments to be clearer about what each branch does and why self-import aliasing is safe.Note: replaces #9178 which was auto-closed as merged after a stack reorder (GitHub detected all its commits were in its former base branch). Same content, now targeting main directly.