Skip to content

refactor(rust): remove BindingIdentifierExt to use BindingIdentifier::symbol_id() instead#8667

Merged
Boshen merged 1 commit intomainfrom
refactor/remove-binding-identifier-ext
Mar 14, 2026
Merged

refactor(rust): remove BindingIdentifierExt to use BindingIdentifier::symbol_id() instead#8667
Boshen merged 1 commit intomainfrom
refactor/remove-binding-identifier-ext

Conversation

@Dunqing
Copy link
Copy Markdown
Collaborator

@Dunqing Dunqing commented Mar 13, 2026

They are literally the same thing and much cleaner.

Copilot AI review requested due to automatic review settings March 13, 2026 09:13
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 37b9ca5
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69b55f71b1bac300084f98c8
😎 Deploy Preview https://deploy-preview-8667--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors rolldown’s Rust ECMAScript utilities to remove the custom BindingIdentifierExt::expect_symbol_id helper and use oxc’s inherent BindingIdentifier::symbol_id() instead, simplifying call sites across the linker, scanner, and HMR code.

Changes:

  • Removed BindingIdentifierExt from rolldown_ecmascript_utils exports/modules and deleted its implementation.
  • Updated multiple call sites to use id.symbol_id() instead of expect_symbol_id.
  • Minor formatting/cleanup in updated call sites.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/rolldown_ecmascript_utils/src/lib.rs Stops re-exporting BindingIdentifierExt from the crate’s public prelude.
crates/rolldown_ecmascript_utils/src/extensions/ast_ext/mod.rs Removes the binding_identifier_ext module from the extension module list.
crates/rolldown_ecmascript_utils/src/extensions/ast_ext/binding_identifier_ext.rs Deletes the redundant trait extension implementation.
crates/rolldown/src/stages/link_stage/cross_module_optimization.rs Uses BindingIdentifier::symbol_id() for default export local binding resolution.
crates/rolldown/src/hmr/hmr_ast_finalizer.rs Uses symbol_id() when recording import bindings for HMR output generation.
crates/rolldown/src/ast_scanner/mod.rs Replaces expect_symbol_id() usages with symbol_id() during scanning/import processing.

@Dunqing Dunqing force-pushed the refactor/remove-binding-identifier-ext branch from d8be921 to 9fa8031 Compare March 13, 2026 09:33
Copilot AI review requested due to automatic review settings March 13, 2026 09:43
@Dunqing Dunqing force-pushed the refactor/remove-binding-identifier-ext branch from 9fa8031 to 2ad5224 Compare March 13, 2026 09:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors Rust AST utilities by removing the BindingIdentifierExt trait in rolldown_ecmascript_utils and switching call sites to use BindingIdentifier::symbol_id() directly, simplifying the API surface.

Changes:

  • Remove BindingIdentifierExt re-export and module, deleting the now-redundant extension trait.
  • Update call sites in rolldown to use BindingIdentifier::symbol_id() instead of expect_symbol_id().
  • Minor formatting adjustments where the refactor touched import-binding insertion logic.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/rolldown_ecmascript_utils/src/lib.rs Stops re-exporting BindingIdentifierExt from the public API.
crates/rolldown_ecmascript_utils/src/extensions/ast_ext/mod.rs Removes the binding_identifier_ext module from the AST extension module list.
crates/rolldown_ecmascript_utils/src/extensions/ast_ext/binding_identifier_ext.rs Deletes the redundant BindingIdentifierExt trait implementation.
crates/rolldown/src/stages/link_stage/cross_module_optimization.rs Replaces expect_symbol_id usage with BindingIdentifier::symbol_id in default export handling.
crates/rolldown/src/hmr/hmr_ast_finalizer.rs Removes the extension trait import and uses .symbol_id() for import bindings.
crates/rolldown/src/ast_scanner/mod.rs Removes the extension trait import and replaces expect_symbol_id() calls with .symbol_id().

@Dunqing Dunqing force-pushed the refactor/remove-binding-identifier-ext branch from 2ad5224 to 9e08568 Compare March 13, 2026 09:47
Copilot AI review requested due to automatic review settings March 13, 2026 09:51
@Dunqing Dunqing force-pushed the refactor/remove-binding-identifier-ext branch from 9e08568 to ee2bbd8 Compare March 13, 2026 09:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors Rust ECMAScript utilities to remove the redundant BindingIdentifierExt trait and use oxc’s BindingIdentifier::symbol_id() API directly, simplifying symbol-id access across the codebase.

Changes:

  • Removes BindingIdentifierExt from rolldown_ecmascript_utils exports and deletes the extension module.
  • Updates rolldown call sites to use .symbol_id() / BindingIdentifier::symbol_id directly.
  • Adjusts imports accordingly where the associated function form is used.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/rolldown_ecmascript_utils/src/lib.rs Stops re-exporting BindingIdentifierExt from the crate public API.
crates/rolldown_ecmascript_utils/src/extensions/ast_ext/mod.rs Removes the now-deleted binding_identifier_ext public module.
crates/rolldown_ecmascript_utils/src/extensions/ast_ext/binding_identifier_ext.rs Deletes the redundant trait implementation.
crates/rolldown/src/stages/link_stage/cross_module_optimization.rs Switches default-export symbol extraction to BindingIdentifier::symbol_id.
crates/rolldown/src/hmr/hmr_ast_finalizer.rs Replaces expect_symbol_id() usage with .symbol_id() for import bindings.
crates/rolldown/src/ast_scanner/mod.rs Replaces expect_symbol_id() usage with .symbol_id() across scanning logic.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

Benchmarks Rust

  • target: main(8dff16b)
  • pr: refactor/remove-binding-identifier-ext(37b9ca5)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.02     72.2±1.51ms        ? ?/sec    1.00     71.1±1.58ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     80.6±1.39ms        ? ?/sec    1.01     81.2±2.16ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    147.7±4.27ms        ? ?/sec    1.03    152.1±2.37ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    170.5±3.04ms        ? ?/sec    1.02    174.4±3.01ms        ? ?/sec
bundle/bundle@threejs                                        1.00     67.2±3.30ms        ? ?/sec    1.03     69.4±2.80ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     76.7±2.20ms        ? ?/sec    1.06     81.0±2.33ms        ? ?/sec
bundle/bundle@threejs10x                                     1.01    710.6±5.59ms        ? ?/sec    1.00    705.5±6.76ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    826.8±6.14ms        ? ?/sec    1.01    832.1±7.52ms        ? ?/sec
scan/scan@rome_ts                                            1.00     66.9±1.21ms        ? ?/sec    1.00     66.8±1.17ms        ? ?/sec
scan/scan@threejs                                            1.00     24.5±1.60ms        ? ?/sec    1.00     24.5±1.54ms        ? ?/sec
scan/scan@threejs10x                                         1.01    241.5±2.29ms        ? ?/sec    1.00    239.6±3.88ms        ? ?/sec

@hyf0 hyf0 enabled auto-merge (squash) March 14, 2026 07:20
@hyf0
Copy link
Copy Markdown
Member

hyf0 commented Mar 14, 2026

Looks like #8678 didn't fix the CI issue

@Boshen Boshen force-pushed the refactor/remove-binding-identifier-ext branch from 9bc82c2 to 37b9ca5 Compare March 14, 2026 13:15
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Mar 14, 2026

Merge activity

  • Mar 14, 1:30 PM UTC: @Dunqing we removed the merge queue label because we could not find a Graphite account associated with your GitHub profile.

You must have a Graphite account in order to use the merge queue. Create an account and try again using this link

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 14, 2026

Merging this PR will not alter performance

✅ 8 untouched benchmarks


Comparing refactor/remove-binding-identifier-ext (37b9ca5) with main (8dff16b)

Open in CodSpeed

@Boshen Boshen disabled auto-merge March 14, 2026 14:18
@Boshen Boshen merged commit 52e84dd into main Mar 14, 2026
39 checks passed
@Boshen Boshen deleted the refactor/remove-binding-identifier-ext branch March 14, 2026 14:18
This was referenced Mar 18, 2026
shulaoda added a commit that referenced this pull request Mar 18, 2026
## [1.0.0-rc.10] - 2026-03-18

### 🚀 Features

- add indentExclusionRanges property to MagicString (#8746) by @IWANABETHATGUY
- expose `oxcRuntimePlugin` (#8654) by @sapphi-red
- rust: make bundler generic over FileSystem for in-memory benchmarks (#8652) by @Boshen

### 🐛 Bug Fixes

- rolldown_plugin_vite_dynamic_import_vars: align dynamic import fast check with Vite (#8760) by @shulaoda
- renamer: handle existing bindings in nested scopes when finding unique names (#8741) by @drewolson
- pass `yarn_pnp` option where needed (#8736) by @sapphi-red
- preserve optional chaining in namespace member expr rewrite (#8712) by @Copilot
- correct UTF-16 index handling in native MagicString (#8693) by @IWANABETHATGUY
- mark failing doctests as ignore (#8700) by @Boshen
- prevent may_partial_namespace from leaking through include_module (#8682) by @IWANABETHATGUY
- ci: bump native-build cache key to invalidate stale napi-rs artifacts (#8678) by @Boshen
- `comments.annotation: false` breaking tree-shaking (#8657) by @IWANABETHATGUY
- validate filenames for NUL bytes from chunkFileNames/entryFileNames (#8644) by @IWANABETHATGUY
- dce-only minify should not set NODE_ENV to production (#8651) by @IWANABETHATGUY

### 🚜 Refactor

- rust: remove dead `CrossModuleOptimizationConfig::side_effects_free_function_optimization` (#8673) by @Dunqing
- rust: simplify `cross_module_optimization` by removing redundant scope tracking (#8672) by @Dunqing
- simplify string repeat in guess_indentor (#8753) by @IWANABETHATGUY
- consolidate custom magic-string tests into one file (#8696) by @IWANABETHATGUY
- extract CJS bailout checks from include_symbol (#8683) by @IWANABETHATGUY
- rust: remove `BindingIdentifierExt` to use `BindingIdentifier::symbol_id()` instead (#8667) by @Dunqing
- bench: add bench_preset helper and inline presets (#8658) by @Boshen
- rust: filter external modules from entries instead of mapping bit positions (#8637) by @Dunqing

### 📚 Documentation

- clarify watch mode behavior and its limitations (#8751) by @sapphi-red
- add external link icon to GitHub button in Hero section (#8731) by @thisisnkc
- guide: clarify that `inject` option is only conceptually similar to esbuild's one (#8743) by @sapphi-red
- meta/design: add `devtools.md` (#8663) by @hyf0
- add viteplus alpha announcement banner (#8668) by @shulaoda

### ⚡ Performance

- rolldown: some minor perf optimization found by autoresearch (#8730) by @Brooooooklyn
- replace Vec allocation with lazy iterator in find_hash_placeholders (#8703) by @Boshen
- replace TypedDashMap with TypedMap in CustomField (#8708) by @Boshen
- bench: remove scan benchmark binary to halve LTO link time (#8694) by @Boshen

### 🧪 Testing

- watch: increase timeout for error output (#8766) by @sapphi-red
- vite-tests: remove JS plugin tests (#8767) by @sapphi-red
- watch: add CLI exit code test (#8752) by @sapphi-red
- normalize paths on Windows even if `resolve.symlinks` is false (#8483) by @sapphi-red

### ⚙️ Miscellaneous Tasks

- correct comment in bundle-analyzer-plugin.ts (#8770) by @origami-z
- upgrade oxc to 0.120.0 (#8764) by @Boshen
- enable all test for `reset` category in MagicString.test.ts (#8749) by @IWANABETHATGUY
- deps: update test262 submodule for tests (#8742) by @sapphi-red
- deps: update oxc apps (#8734) by @renovate[bot]
- deps: update softprops/action-gh-release action to v2.6.1 (#8724) by @renovate[bot]
- deps: update npm packages (major) (#8722) by @renovate[bot]
- deps: update github-actions (major) (#8721) by @renovate[bot]
- deps: update softprops/action-gh-release action to v2.6.0 (#8720) by @renovate[bot]
- deps: update npm packages (#8718) by @renovate[bot]
- deps: update rust crates (#8717) by @renovate[bot]
- deps: update github-actions (#8716) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.17.0 (#8713) by @renovate[bot]
- deps: bump cargo-shear to v1.11.2 (#8711) by @Boshen
- use org level `CODE_OF_CONDUCT.md` (#8706) by @sapphi-red
- fix cache key mismatch and remove redundant cache saves (#8695) by @Boshen
- deps: update oxc apps (#8692) by @renovate[bot]
- deps: update oxc apps (#8649) by @renovate[bot]
- should do matrix out side of reusable workflows 2 (#8691) by @hyf0
- should do matrix out side of reusable workflows (#8690) by @hyf0
- deps: update dependency rolldown-plugin-dts to v0.22.5 (#8689) by @renovate[bot]
- upgrade oxc to 0.119.0 and oxc_resolver to 11.19.1 (#8686) by @Boshen
- correct if condition of `type-check` job (#8677) by @hyf0
- Gate CI type-check job on node changes (#8669) by @Copilot
- benchmark: improve codspeed build (#8665) by @Boshen
- deps: update oxc to v0.118.0 (#8650) by @renovate[bot]
- deps: update crate-ci/typos action to v1.44.0 (#8647) by @renovate[bot]
- deps: update oxc resolver to v11.19.1 (#8646) by @renovate[bot]
- deps: update dependency rust to v1.94.0 (#8648) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.22.4 (#8645) by @renovate[bot]

### ◀️ Revert

- Revert "ci: Gate CI type-check job on node changes" (#8674) by @hyf0
- "chore(deps): update dependency rust to v1.94.0 (#8648)" (#8660) by @shulaoda

### ❤️ New Contributors

* @origami-z made their first contribution in [#8770](#8770)
* @drewolson made their first contribution in [#8741](#8741)
* @thisisnkc made their first contribution in [#8731](#8731)

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.

4 participants