Skip to content

Rename BindingMagicString export to RolldownMagicString#8641

Merged
IWANABETHATGUY merged 4 commits intomainfrom
copilot/sub-pr-8639
Mar 12, 2026
Merged

Rename BindingMagicString export to RolldownMagicString#8641
IWANABETHATGUY merged 4 commits intomainfrom
copilot/sub-pr-8639

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

  • Rename BindingMagicString to RolldownMagicString in binding-magic-string.ts (interface, constructor type, and exported const)
  • Update index.ts: import/export RolldownMagicString directly
  • Update plugin files to use RolldownMagicString
  • Rebase onto current main (bring unrelated files up to date)
  • Build and magic-string tests pass

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Address feedback on JSDoc naming for RolldownMagicString Rename BindingMagicString export to RolldownMagicString Mar 11, 2026
Copilot finished work on behalf of hyf0 March 11, 2026 12:04
@hyf0 hyf0 unassigned hyf0 and Copilot Mar 11, 2026
@hyf0
Copy link
Copy Markdown
Member

hyf0 commented Mar 11, 2026

I leave it to you to decide if to use this PR @IWANABETHATGUY

@graphite-app graphite-app bot force-pushed the 03-11-chore_add_experimental_js_doc_on_binding-magic-string_ branch from 9b656b2 to 7e1ef16 Compare March 11, 2026 12:11
Base automatically changed from 03-11-chore_add_experimental_js_doc_on_binding-magic-string_ to main March 11, 2026 12:16
@IWANABETHATGUY
Copy link
Copy Markdown
Member

The reason why I use BindingMagicString is to keep name style consistent for internal ts code, but this pr also makes sense to me(Since it is used both internally and externally).

@IWANABETHATGUY
Copy link
Copy Markdown
Member

@copilot resolve the conflict

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 12, 2026

@copilot resolve the conflict

Resolved in d6c430c. Brought the branch up to date with main (syncing CHANGELOG, Rust files, binding.cjs, package.json files, and new test fixtures from the commits that landed after this branch was created).

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 12, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit b230c73
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69b279e121461e0008750299

@IWANABETHATGUY
Copy link
Copy Markdown
Member

@copilot continue resolve the conflict

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 12, 2026

@copilot continue resolve the conflict

The conflict was already resolved in d6c430c. The branch is now up to date with main — the only remaining diffs are the 6 intentional TypeScript files with the BindingMagicStringRolldownMagicString rename.

@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review March 12, 2026 05:12
Copilot AI review requested due to automatic review settings March 12, 2026 05:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Renames the public MagicString export used by rolldown’s plugin APIs from BindingMagicString to RolldownMagicString, and updates internal plugin hook plumbing/types accordingly so plugins can continue to return/use MagicString with native sourcemap support.

Changes:

  • Rename the MagicString wrapper export in binding-magic-string.ts to RolldownMagicString (type + constructor + exported const).
  • Update plugin API type surfaces (transform/renderChunk contexts and hook result types) to reference RolldownMagicString.
  • Update bindingify hook adapters to construct/check RolldownMagicString for lazy MagicString usage and direct return handling.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/rolldown/src/binding-magic-string.ts Renames wrapper interface/constructor/export to RolldownMagicString.
packages/rolldown/src/index.ts Re-exports RolldownMagicString from the package entrypoint.
packages/rolldown/src/plugin/index.ts Updates public plugin hook/result typings to use RolldownMagicString.
packages/rolldown/src/plugin/transform-plugin-context.ts Updates sendMagicString typing to accept RolldownMagicString.
packages/rolldown/src/plugin/bindingify-build-hooks.ts Updates transform hook adapter to create/detect RolldownMagicString.
packages/rolldown/src/plugin/bindingify-output-hooks.ts Updates renderChunk adapter to lazy-create/detect RolldownMagicString.

@IWANABETHATGUY IWANABETHATGUY enabled auto-merge (squash) March 12, 2026 06:15
@IWANABETHATGUY IWANABETHATGUY requested a review from hyf0 March 12, 2026 08:31
@IWANABETHATGUY
Copy link
Copy Markdown
Member

Weird, why can't it be auto-merged after I approved it?

@IWANABETHATGUY IWANABETHATGUY merged commit d1f2388 into main Mar 12, 2026
29 checks passed
@IWANABETHATGUY IWANABETHATGUY deleted the copilot/sub-pr-8639 branch March 12, 2026 08:35
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.

4 participants