Repository navigation
fix: escape namespace properties in IIFE and UMD output - #11077
Conversation
9087d15 to
ad2a290
Compare
ad2a290 to
f959f4e
Compare
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The fix is localized, preserves identifier handling, and includes regression coverage for the affected output paths.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes namespace property escaping in Rolldown’s IIFE and UMD output, preserving quotes, backslashes, and line breaks.
Changes:
- Reuses the existing property-access helper for namespace segments.
- Serializes each computed property key once.
- Adds runtime regression tests for namespace creation, extension, and UMD dependency lookup across minification modes.
| File | Description |
|---|---|
| packages/rolldown/tests/behaviors/namespace-property-escaping.test.ts | Tests escaped namespace keys and global dependency lookup. |
| crates/rolldown/src/ecmascript/format/utils/namespace.rs | Delegates namespace access to the escaping helper. |
| crates/rolldown_utils/src/ecmascript.rs | Serializes computed keys before concatenation. |
💡 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
|
326cdb8
into
fix/export-rendering-diagnostics
Quotes, backslashes, and line breaks in namespace segments can break IIFE or UMD output or select the wrong global property. Preserve these segments when assigning exports and resolving UMD global dependencies.
For
name: 'Root.a"b', the generated property access changes from:to:
Reuse the existing property access helper for namespace segments and serialize each computed key once. Namespace initialization and
extenduse the same escaped keys.