Skip to content

fix(finalizer): skip redundant init call when barrel executes in same chunk#9354

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-05-fix_remove_redundant_wrapp_init
May 18, 2026
Merged

fix(finalizer): skip redundant init call when barrel executes in same chunk#9354
graphite-app[bot] merged 1 commit into
mainfrom
05-05-fix_remove_redundant_wrapp_init

Conversation

@IWANABETHATGUY
Copy link
Copy Markdown
Member

@IWANABETHATGUY IWANABETHATGUY commented May 11, 2026

When lowering an import from a non-wrapped barrel that forwards a binding from a wrapped-ESM module, the finalizer was emitting a fallback init_*() call. If the barrel itself is included and emitted in the current chunk, its own lowered statement already preserves the init call in execution order, making the fallback a duplicate. The finalizer now skips the fallback in that case; two integration snapshots lose their redundant init_lib() / init_lib_impl() lines.

Copy link
Copy Markdown
Member Author

IWANABETHATGUY commented May 11, 2026


How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@IWANABETHATGUY IWANABETHATGUY force-pushed the 05-05-fix_remove_redundant_wrapp_init branch from 0f76fa9 to 78a3983 Compare May 11, 2026 07:59
@IWANABETHATGUY IWANABETHATGUY force-pushed the 05-05-fix_remove_redundant_wrapp_init branch from 052033c to 572fef5 Compare May 18, 2026 04:54
@IWANABETHATGUY IWANABETHATGUY changed the title fix: remove redundant wrapp init fix(finalizer): skip redundant init call when barrel executes in same chunk May 18, 2026
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review May 18, 2026 05:08
@graphite-app graphite-app Bot changed the base branch from 05-04-fix_8950-2 to graphite-base/9354 May 18, 2026 05:09
@graphite-app graphite-app Bot force-pushed the graphite-base/9354 branch from 5ea3de5 to c8743b4 Compare May 18, 2026 05:13
@graphite-app graphite-app Bot force-pushed the 05-05-fix_remove_redundant_wrapp_init branch from 572fef5 to 5a2ccf7 Compare May 18, 2026 05:13
@graphite-app graphite-app Bot changed the base branch from graphite-base/9354 to main May 18, 2026 05:14
@graphite-app graphite-app Bot force-pushed the 05-05-fix_remove_redundant_wrapp_init branch from 5a2ccf7 to f9d9863 Compare May 18, 2026 05:14
@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 776ec77
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a0aa4d6cba86e000869690b

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 18, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing 05-05-fix_remove_redundant_wrapp_init (f9d9863) with main (c8743b4)

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Copy Markdown
Member Author

IWANABETHATGUY commented May 18, 2026

Merge activity

  • May 18, 5:32 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • May 18, 5:33 AM UTC: IWANABETHATGUY added this pull request to the Graphite merge queue.
  • May 18, 5:38 AM UTC: Merged by the Graphite merge queue.

… chunk (#9354)

When lowering an import from a non-wrapped barrel that forwards a binding from a wrapped-ESM module, the finalizer was emitting a fallback `init_*()` call. If the barrel itself is included and emitted in the current chunk, its own lowered statement already preserves the init call in execution order, making the fallback a duplicate. The finalizer now skips the fallback in that case; two integration snapshots lose their redundant `init_lib()` / `init_lib_impl()` lines.
@graphite-app graphite-app Bot force-pushed the 05-05-fix_remove_redundant_wrapp_init branch from f9d9863 to 776ec77 Compare May 18, 2026 05:34
@graphite-app graphite-app Bot merged commit 776ec77 into main May 18, 2026
32 checks passed
@graphite-app graphite-app Bot deleted the 05-05-fix_remove_redundant_wrapp_init branch May 18, 2026 05:38
@rolldown-guard rolldown-guard Bot mentioned this pull request May 20, 2026
shulaoda added a commit that referenced this pull request May 20, 2026
## [1.0.2] - 2026-05-20

### 🚀 Features

- devtools: emit package size in PackageGraphReady (#9434) by @IWANABETHATGUY
- devtools: classify package dependency types (#9427) by @IWANABETHATGUY
- devtools: map packages to modules and chunks (#9426) by @IWANABETHATGUY
- devtools: mark used packages (#9423) by @IWANABETHATGUY
- devtools: make duplicate packages discoverable (#9422) by @IWANABETHATGUY
- devtools: emit package metadata (#9421) by @IWANABETHATGUY
- update oxc to 0.132.0 (#9449) by @shulaoda
- update oxc to 0.131.0 (#9424) by @shulaoda
- allow checks.* to escalate emissions to hard errors (#9388) by @IWANABETHATGUY
- dev: support watcher options `include` and `exclude` (#9395) by @h-a-n-a
- emit warnings for invalid pure annotations (#9381) by @Kyujenius

### 🐛 Bug Fixes

- hash: keep chunk file names stable when an unrelated entry is added (#9444) by @hyf0
- call `codeSplitting.groups[].name` in deterministic order (#9457) by @sapphi-red
- dev/lazy: make `resolve_id` idempotent when the resolved id is already a lazy entry (#9439) by @h-a-n-a
- chunk-optimization: publish absorbed dynamic-entry namespace cross-chunk (#9448) by @IWANABETHATGUY
- treeshake: propagate pure annotation through compound exprs (#9431) by @Dunqing
- finalizer: skip redundant init call when barrel executes in same chunk (#9354) by @IWANABETHATGUY
- linking: initialize wrapped ESM re-export owners (#9353) by @IWANABETHATGUY
- do not inherit __toESM across chunks for named-only external imports (#9333) (#9415) by @IWANABETHATGUY
- watcher: don't write output or emit events after close() (#9328) by @situ2001
- chunk-optimization: avoid unsafe dynamic-only merges (#9398) by @IWANABETHATGUY
- cjs: rename CJS-wrapped locals that would shadow chunk-scope names (#9392) by @hyf0
- dev/lazy: watch lazy modules added in rebuilds (#9391) by @h-a-n-a

### 🚜 Refactor

- rolldown_dev: move dev example to break publish cycle (#9465) by @Boshen
- binding: drop unsafe napi string helper, hoist transform ArcStr (#9456) by @hyf0
- ecmascript_utils: split rewrite_ident_reference off JsxExt trait (#9417) by @IWANABETHATGUY
- use `ThreadsafeFunction::call_async_catch` (#9390) by @sapphi-red

### 📚 Documentation

- devtools: document @rolldown/debug usage and package graph consumption (#9435) by @IWANABETHATGUY
- replace `Inter` with system font stack in OG template SVG (#9240) by @yvbopeng
- remove `output.comments` warning as all issues have been resolved (#9393) by @sapphi-red
- in-depth: clarify @__PURE__ scope and document positions (#9389) by @Kyujenius
- readme: remove release candidate notice (#9387) by @shulaoda

### ⚡ Performance

- vite-resolve: cache importer existence checks (#9443) by @Brooooooklyn
- binding: reduce plugin string clones (#9436) by @Brooooooklyn

### 🧪 Testing

- enable `legal_comments_inline` test (#9394) by @sapphi-red

### ⚙️ Miscellaneous Tasks

- bump pnpm to v11.1.2 (#9447) by @Boshen
- deps: update rust crates (#9461) by @renovate[bot]
- deps: update rollup submodule for tests to v4.60.4 (#9453) by @rolldown-guard[bot]
- deps: update test262 submodule for tests (#9454) by @rolldown-guard[bot]
- deps: update npm packages (#9430) by @renovate[bot]
- deps: update github actions (#9429) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.25.1 (#9452) by @renovate[bot]
- deps: update rust crates (#9428) by @renovate[bot]
- revert allow checks.* to escalate emissions to hard errors (#9388) (#9438) by @IWANABETHATGUY
- update mimalloc-safe to 0.1.61 (#9413) by @shulaoda
- deny `todo`, `unimplemented`, and `print_stderr` clippy lints (#9412) by @Boshen
- deps: update mimalloc-safe to 0.1.60 (#9410) by @shulaoda
- remove `pip install setuptools` workaround for node-gyp on macOS (#9370) by @sapphi-red
- renovate: disable automerge to require manual approval (#9386) by @shulaoda
- deps: update napi (#9385) by @renovate[bot]

### ❤️ New Contributors

* @yvbopeng made their first contribution in [#9240](#9240)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants