Repository navigation
fix: use computed access for arbitrary import names - #11075
Conversation
45ce087 to
aad31cd
Compare
aad31cd to
d2b4b4f
Compare
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently handles arbitrary names and includes comprehensive regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes invalid property access generation for arbitrary import names while preserving live bindings, call semantics, and source maps.
Changes:
- Uses computed access for non-identifier import names.
- Updates chunk re-export rendering.
- Adds behavior, minification, chunking, and source-map coverage.
| File | Description |
|---|---|
packages/rolldown/tests/behaviors/arbitrary-import-names.test.ts |
Adds regression coverage. |
crates/rolldown/tests/esbuild/default/inject/artifacts.snap |
Updates expected computed access. |
crates/rolldown/src/utils/chunk/render_chunk_exports.rs |
Safely renders namespace property accesses. |
crates/rolldown/src/module_finalizers/rename.rs |
Preserves spans for computed accesses. |
crates/rolldown/src/module_finalizers/mod.rs |
Builds valid static or computed member expressions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Merging this PR will not alter performance
Comparing Footnotes
|
632653c
into
fix/export-rendering-diagnostics
Imported names such as
""and"a-b"can produce invalid or incorrect dot accesses. Use computed property access when the imported name is not a valid identifier.For
import { "a-b" as value } from "dep", a read can be emitted as:The corrected access is:
Apply the existing property access helpers to imported expressions and chunk re-exports. Imported calls retain their unbound
this, and property reads remain live.