Skip to content

Use Rolldown native MagicString for faster sourcemap generation#345

Open
ElMassimo wants to merge 2 commits intomainfrom
claude/native-magic-string-sourcemaps-SuX5u
Open

Use Rolldown native MagicString for faster sourcemap generation#345
ElMassimo wants to merge 2 commits intomainfrom
claude/native-magic-string-sourcemaps-SuX5u

Conversation

@ElMassimo
Copy link
Copy Markdown
Owner

Replace the JS magic-string dependency with Rolldown's native
RolldownMagicString in all transform handlers. Native magic string
performs string mutations and sourcemap generation in Rust, avoiding
the overhead of JS-based sourcemap encoding. Transform hooks now
return the RolldownMagicString instance directly as code, letting
Rolldown handle sourcemap generation internally without serialization.

https://claude.ai/code/session_01Gk9SG3CqsszLBotJRTf45S

Replace the JS `magic-string` dependency with Rolldown's native
`RolldownMagicString` in all transform handlers. Native magic string
performs string mutations and sourcemap generation in Rust, avoiding
the overhead of JS-based sourcemap encoding. Transform hooks now
return the `RolldownMagicString` instance directly as `code`, letting
Rolldown handle sourcemap generation internally without serialization.

https://claude.ai/code/session_01Gk9SG3CqsszLBotJRTf45S
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 7, 2026

View your CI Pipeline Execution ↗ for commit 9de2ba1

Command Status Duration Result
nx run-many --target=build --all --exclude docs... ✅ Succeeded 26s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-07 14:15:08 UTC

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 7, 2026

Deploying iles with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9de2ba1
Status:🚫  Build failed.

View logs

…ances

Reuse the lazily-created RolldownMagicString that Rolldown provides
via the transform hook's meta parameter, avoiding redundant instance
creation. The wrapLayout and wrapIslandsInSFC helpers now receive the
magic string from their callers instead of constructing their own.

https://claude.ai/code/session_01Gk9SG3CqsszLBotJRTf45S
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.

2 participants