refactor: rename _id suffixes to _idx for oxc_index types#7767
Conversation
How to use the Graphite Merge QueueAdd 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. |
✅ Deploy Preview for rolldown-rs canceled.
|
✅ Deploy Preview for rolldown-rs canceled.
|
There was a problem hiding this comment.
Pull request overview
This PR performs a systematic refactoring to improve naming consistency across the codebase by renaming variables and fields with _id suffixes to _idx when they represent oxc_index types (like ModuleIdx, ChunkIdx, ImportRecordIdx, StmtInfoIdx). This aligns with Rust naming conventions where "idx" is preferred for index types to distinguish them from identifier types.
Key changes:
- Renamed struct fields and function parameters from
*_idto*_idxfor all oxc_index types - Updated all references throughout the codebase to use the new naming convention
- Maintained backward compatibility and functional behavior
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/rolldown_common/src/types/symbol_ref_db.rs |
Renamed chunk_id field to chunk_idx and module_id parameter to module_idx |
crates/rolldown_common/src/types/symbol_ref.rs |
Updated reference from record_id to record_idx |
crates/rolldown_common/src/types/named_import.rs |
Renamed record_id field to record_idx |
crates/rolldown_common/src/ecmascript/dynamic_import_usage.rs |
Renamed map field from dynamic_import_binding_to_import_record_id to dynamic_import_binding_to_import_record_idx |
crates/rolldown/src/utils/external_import_interop.rs |
Renamed parameter rec_id to rec_idx |
crates/rolldown/src/types/module_factory.rs |
Renamed module_index field to module_idx |
crates/rolldown/src/types/generator.rs |
Updated chunk_id field reference to chunk_idx |
crates/rolldown/src/stages/link_stage/tree_shaking/include_statements.rs |
Renamed runtime_id and stmt_info_id parameters to runtime_idx and stmt_info_idx |
crates/rolldown/src/stages/link_stage/bind_imports_and_exports.rs |
Updated multiple parameter and variable references from *_id to *_idx |
crates/rolldown/src/stages/generate_stage/mod.rs |
Renamed context fields id to idx and chunk_id to chunk_idx |
crates/rolldown/src/stages/generate_stage/compute_cross_chunk_links.rs |
Renamed loop variables and references from chunk_id to chunk_idx |
crates/rolldown/src/stages/generate_stage/chunk_optimizer.rs |
Updated runtime_id parameter to runtime_idx |
crates/rolldown/src/module_loader/module_task.rs |
Updated field reference from module_index to module_idx |
crates/rolldown/src/module_loader/module_loader.rs |
Renamed runtime_id field to runtime_idx and updated all references |
crates/rolldown/src/module_finalizers/rename.rs |
Updated context field references from id to idx |
crates/rolldown/src/module_finalizers/mod.rs |
Renamed multiple parameters and field references from *_id to *_idx |
crates/rolldown/src/module_finalizers/impl_visit_mut.rs |
Updated context field reference from id to idx |
crates/rolldown/src/module_finalizers/finalizer_context.rs |
Renamed struct fields id to idx and chunk_id to chunk_idx |
crates/rolldown/src/ecmascript/format/esm.rs |
Updated field references from record_id to record_idx |
crates/rolldown/src/ecmascript/ecma_module_view_factory.rs |
Updated parameter from module_index to module_idx |
crates/rolldown/src/ast_scanner/mod.rs |
Renamed parameters and field references from record_id to record_idx |
crates/rolldown/src/ast_scanner/dynamic_import.rs |
Updated field and parameter references from import_record_id to import_record_idx |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Benchmarks Rust |
Merge activity
|
9796015 to
a3ad020
Compare
a3ad020 to
925e30c
Compare
## [1.0.0-beta.59] - 2026-01-07 ⚡ Inline Dynamic Imports for Statically Imported Modules - When a module is already statically imported, dynamic imports to that same module are now inlined instead of creating a separate chunk ### 🚀 Features - plugin_timings: add 3s threshold and doc link to warning message (#7741) by @shulaoda - improve treeshaking logic to handle empty parameter list in dynamic import .then() callbacks (#7781) by @Copilot - dev/lazy: don't include already executed modules (#7745) by @hyf0 - dev/lazy: support dynamic `import(..)` (#7726) by @hyf0 - inline dynamic imports that imports statically imported modules (#7742) by @IWANABETHATGUY - option: add experimental option to control chunk optimization (#7738) by @IWANABETHATGUY ### 🐛 Bug Fixes - inline dynamic entry to user defined entry with esm wrap kind (#7783) by @IWANABETHATGUY - use canonical namespace reference for property access (#7777) by @IWANABETHATGUY - dynamic entry merged into common chunk with cjs and esm wrap kind (#7771) by @IWANABETHATGUY - tla: should not await non-tla-related modules (#7768) by @hyf0 - dynamic entry captured by common chunk with CJS format (#7757) by @IWANABETHATGUY - module_loader: mark emitted chunks as user-defined entry when already loaded (#7765) by @shulaoda - normalize preserveModulesRoot path (#7737) by @IWANABETHATGUY - linker: resolve race condition in side effects computation for export-star (#7728) by @camc314 ### 🚜 Refactor - plugin_timings: filter out plugins with duration < 1s from timing warnings (#7785) by @shulaoda - module_loader: remove unnecessary collect before extend (#7769) by @shulaoda - rename _id suffixes to _idx for oxc_index types (#7767) by @IWANABETHATGUY - remove duplicate `preserve_entry_signatures` from `AddEntryModuleMsg` (#7762) by @shulaoda - module_loader: pass `user_defined_entries` by reference (#7756) by @shulaoda - dev/lazy: get proxy entry's `ResolvedId` correctly (#7746) by @hyf0 - simplify try_rewrite_import_expression control flow (#7753) by @IWANABETHATGUY - module_loader: remove unnecessary dynamic import handling for runtime module (#7754) by @shulaoda - inline __toDynamicImportESM (#7747) by @IWANABETHATGUY - use From impl for ModuleLoaderOutput conversion (#7732) by @shulaoda - remove duplicate fields from `ModuleLoader` (#7731) by @shulaoda - tweak `resolve_user_defined_entries` (#7727) by @shulaoda ### 📚 Documentation - add rolldown-string reference to native MagicString compatibility section (#7778) by @Copilot - improve comments for export star side effects handling (#7730) by @IWANABETHATGUY ### 🧪 Testing - use assertion instead of console.log for some testcase (#7744) by @IWANABETHATGUY ### ⚙️ Miscellaneous Tasks - tweak some `output.dynamicImportInCjs` related rollup test results (#7776) by @sapphi-red - mark esbuild/dce/dce_of_symbol_ctor_call as passed (#7775) by @sapphi-red - deps: update oxc apps (#7772) by @renovate[bot] - vite-tests: allow running on PRs with `test: vite-tests` label (#7770) by @shulaoda - deps: update oxc apps (#7760) by @renovate[bot] - deps: update rollup submodule for tests to v4.55.1 (#7763) by @sapphi-red - deps: update test262 submodule for tests (#7764) by @sapphi-red - deps: update oxc to v0.107.0 (#7758) by @camc314 - deps: update taiki-e/install-action action to v2.65.13 (#7751) by @renovate[bot] - deps: update rust crates (#7750) by @renovate[bot] - deps: update npm packages (#7749) by @renovate[bot] - deps: update github-actions (#7748) by @renovate[bot] - deps: update dependency oxlint-tsgolint to v0.10.1 (#7729) by @renovate[bot] - deps: update crate-ci/typos action to v1.41.0 (#7725) by @renovate[bot] Co-authored-by: shulaoda <[email protected]>

No description provided.