Skip to content

fix: escape namespace properties in IIFE and UMD output - #11077

Merged
hyfdev merged 1 commit into
fix/escape-dependency-specifiersfrom
fix/escape-namespace-properties
Oct 2, 2026
Merged

hyfdev merged 1 commit into
fix/escape-dependency-specifiersfrom
fix/escape-namespace-properties

Conversation

@hyfdev

@hyfdev hyfdev commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

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:

this.Root["a"b"]

to:

this.Root["a\"b"]

Reuse the existing property access helper for namespace segments and serialize each computed key once. Namespace initialization and extend use the same escaped keys.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-escape-namespace-properties-rolldown-rs.voidzero-docs.workers.dev (commit f959f4e)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://196239d6-rolldown-rs.voidzero-docs.workers.dev f959f4e 2026-10-02T04:05:45.904Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://888590ad-rolldown-rs.voidzero-docs.workers.dev ad2a290 2026-10-02T03:46:12.063Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ef13cecc-rolldown-rs.voidzero-docs.workers.dev 9087d15 2026-10-02T03:16:49.193Z Visit the dashboard ↗

@hyfdev
hyfdev added this pull request to stack #11078 October 2, 2026 03:17
@hyfdev
hyfdev force-pushed the fix/escape-namespace-properties branch from 9087d15 to ad2a290 Compare October 2, 2026 03:43
@hyfdev
hyfdev force-pushed the fix/escape-namespace-properties branch from ad2a290 to f959f4e Compare October 2, 2026 04:03
@hyfdev
hyfdev marked this pull request as ready for review October 2, 2026 04:21
Copilot AI balanced review requested due to automatic review settings October 2, 2026 04:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@codspeed

codspeed Bot commented Oct 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 7 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing fix/escape-namespace-properties (f959f4e) with fix/escape-dependency-specifiers (d16323a)

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. ↩

@hyfdev
hyfdev merged commit 326cdb8 into fix/export-rendering-diagnostics Oct 2, 2026
53 of 64 checks passed
@hyfdev
hyfdev deleted the fix/escape-namespace-properties branch October 2, 2026 09:16
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.

3 participants