Skip to content

fix(rolldown_plugin_vite_web_worker_post): avoid replacing new.target#8488

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-27-fix_rolldown_plugin_vite_web_worker_post_avoid_replacing_new.target_
Feb 27, 2026
Merged

fix(rolldown_plugin_vite_web_worker_post): avoid replacing new.target#8488
graphite-app[bot] merged 1 commit intomainfrom
02-27-fix_rolldown_plugin_vite_web_worker_post_avoid_replacing_new.target_

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Feb 27, 2026

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@netlify
Copy link

netlify bot commented Feb 27, 2026

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 1d04c1f
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69a17b8b4ed26f00084724ff
😎 Deploy Preview https://deploy-preview-8488--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sapphi-red sapphi-red marked this pull request as ready for review February 27, 2026 10:25
Copilot AI review requested due to automatic review settings February 27, 2026 10:25
Copy link
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

This PR fixes a bug in the vite-web-worker-post plugin where new.target was incorrectly being replaced with _vite_importMeta. The issue occurred because the plugin was matching all MetaProperty expressions without distinguishing between import.meta and new.target.

Changes:

  • Updated AST visitor to check both meta and property names before transforming MetaProperty expressions
  • Added test case to ensure new.target is preserved while import.meta is still transformed

Reviewed changes

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

File Description
crates/rolldown_plugin_vite_web_worker_post/src/ast_visitor.rs Added guard condition to check for import.meta specifically, preventing new.target from being incorrectly transformed
packages/rolldown/tests/fixtures/builtin-plugin/vite-web-worker-post/new-target/main.js Test fixture with both new.target and import.meta.url to verify correct behavior
packages/rolldown/tests/fixtures/builtin-plugin/vite-web-worker-post/new-target/_config.ts Test configuration that verifies new.target is preserved and import.meta is transformed

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

@rolldown/browser

npm i https://pkg.pr.new/@rolldown/browser@8488

@rolldown/debug

npm i https://pkg.pr.new/@rolldown/debug@8488

@rolldown/pluginutils

npm i https://pkg.pr.new/@rolldown/pluginutils@8488

rolldown

npm i https://pkg.pr.new/rolldown@8488

@rolldown/binding-android-arm64

npm i https://pkg.pr.new/@rolldown/binding-android-arm64@8488

@rolldown/binding-darwin-arm64

npm i https://pkg.pr.new/@rolldown/binding-darwin-arm64@8488

@rolldown/binding-darwin-x64

npm i https://pkg.pr.new/@rolldown/binding-darwin-x64@8488

@rolldown/binding-freebsd-x64

npm i https://pkg.pr.new/@rolldown/binding-freebsd-x64@8488

@rolldown/binding-linux-arm-gnueabihf

npm i https://pkg.pr.new/@rolldown/binding-linux-arm-gnueabihf@8488

@rolldown/binding-linux-arm64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-gnu@8488

@rolldown/binding-linux-arm64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-musl@8488

@rolldown/binding-linux-x64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-gnu@8488

@rolldown/binding-linux-x64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-musl@8488

@rolldown/binding-openharmony-arm64

npm i https://pkg.pr.new/@rolldown/binding-openharmony-arm64@8488

@rolldown/binding-wasm32-wasi

npm i https://pkg.pr.new/@rolldown/binding-wasm32-wasi@8488

@rolldown/binding-win32-arm64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-arm64-msvc@8488

@rolldown/binding-win32-x64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-x64-msvc@8488

commit: fe398a4

@github-actions
Copy link
Contributor

Benchmarks Rust

  • target: main(456b9f2)
  • pr: 02-27-fix_rolldown_plugin_vite_web_worker_post_avoid_replacing_new.target_(e4b566a)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     91.9±5.05ms        ? ?/sec    1.01     92.4±2.38ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     99.0±3.07ms        ? ?/sec    1.05    103.6±3.57ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    183.6±6.37ms        ? ?/sec    1.03    189.4±6.73ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    204.9±6.43ms        ? ?/sec    1.03    211.6±6.46ms        ? ?/sec
bundle/bundle@threejs                                        1.00     81.7±4.06ms        ? ?/sec    1.00     82.0±3.02ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     89.6±3.14ms        ? ?/sec    1.04     93.1±3.70ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    905.9±9.40ms        ? ?/sec    1.01   916.5±14.99ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00   1046.7±8.85ms        ? ?/sec    1.00  1045.9±12.30ms        ? ?/sec
scan/scan@rome_ts                                            1.00     76.2±1.71ms        ? ?/sec    1.00     76.5±1.93ms        ? ?/sec
scan/scan@threejs                                            1.00     26.4±0.43ms        ? ?/sec    1.06     28.0±0.58ms        ? ?/sec
scan/scan@threejs10x                                         1.00    275.4±3.35ms        ? ?/sec    1.00    276.4±3.97ms        ? ?/sec

Copy link
Member Author

sapphi-red commented Feb 27, 2026

Merge activity

  • Feb 27, 11:04 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 27, 11:09 AM UTC: sapphi-red added this pull request to the Graphite merge queue.
  • Feb 27, 11:20 AM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot force-pushed the 02-27-fix_rolldown_plugin_vite_web_worker_post_avoid_replacing_new.target_ branch from e4b566a to 1d04c1f Compare February 27, 2026 11:10
@graphite-app graphite-app bot merged commit 1d04c1f into main Feb 27, 2026
34 checks passed
@graphite-app graphite-app bot deleted the 02-27-fix_rolldown_plugin_vite_web_worker_post_avoid_replacing_new.target_ branch February 27, 2026 11:20
This was referenced Mar 4, 2026
shulaoda added a commit that referenced this pull request Mar 5, 2026
## [1.0.0-rc.7] - 2026-03-05

⚡ Smarter Code Generation Defaults
- DCE-only minification and smart constant inlining are now enabled by default
- Produces cleaner, smaller output bundles without requiring explicit configuration

💡 LLM-Friendly Bundle Analyzer Reports
- New markdown output format for the bundle analyzer plugin with bundle summaries, module graphs, dependency chains, and optimization suggestions
- Optimization suggestions now also recommend using the entriesAware option when common chunks contain modules only reachable from specific entries


### 💥 BREAKING CHANGES

- enable minify: 'dce-only' by default (#8465) by @IWANABETHATGUY
- settings `inlineConst: { mode: 'smart', pass: 1}`  by default (#8444) by @IWANABETHATGUY

### 🚀 Features

- binding: add original getter to BindingMagicString (#8533) by @IWANABETHATGUY
- native-magic-string: add `offset` property support (#8531) by @IWANABETHATGUY
- add `output.strict` option to control `"use strict"` directive emission (#8489) by @Copilot
- watch: expose `watcher.compareContentsForPolling` (#8526) by @hyf0
- watch: use new watcher to support watch mode (#8475) by @hyf0
- rust/watch: handle bulk-change (#8466) by @hyf0
- add LLM-friendly markdown output format to bundle analyzer plugin (#8242) by @IWANABETHATGUY

### 🐛 Bug Fixes

- expose `plugins` on `NormalizedInputOptions` for `buildStart` hook (#8521) by @Copilot
- only uppercase facade symbols in JSX preserve mode (#8519) by @IWANABETHATGUY
- binding: export BindingResult in generated dts header (#8537) by @minsoo-web
- pre-resolve paths option to avoid `invoke_sync` deadlock (#8518) by @IWANABETHATGUY
- remove debug-only jsx_preset and UntranspiledSyntaxError (#8511) by @IWANABETHATGUY
- apply `topLevelVar` to exported `const`/`let` declarations (#8507) by @IWANABETHATGUY
- rolldown_plugin_vite_web_worker_post: avoid replacing `new.target` (#8488) by @sapphi-red
- update copyright year to 2026 (#8486) by @maciekzygmunt

### 🚜 Refactor

- rust: use Oxc's SymbolFlags::ConstVariable instead of custom IsConst flag (#8543) by @Dunqing
- rust: remove FacadeScoping, use Scoping::create_symbol for facade symbols (#8540) by @Dunqing
- rust/watch: remove hacky `reset_closed_for_watch_mode` (#8530) by @hyf0
- binding: return &str instead of String in filename() getter (#8534) by @IWANABETHATGUY
- rust: remove old watch mode implementation (#8525) by @hyf0
- rust/watch: simply watch logic in the binding layer (#8516) by @hyf0
- rust/watch: tweak struct/function names (#8464) by @hyf0

### 📚 Documentation

- explain how external modules work in rolldown (#8457) by @sapphi-red
- add some diagrams using graphviz (#8499) by @sapphi-red
- use `vitepress-plugin-graphviz` (#8498) by @sapphi-red
- list s390x/ppc64le prebuilt binaries (#8495) by @crusty-voidzero
- fix error type for `RolldownBuild.generate` and others (#8490) by @sapphi-red

### ⚡ Performance

- string_wizard: reduce allocations and add ASCII fast paths (#8541) by @IWANABETHATGUY
- use IndexBitSet to replace IndexVec<XXXIdx, bool> for module/stmt inclusion tracking (#8503) by @IWANABETHATGUY
- plugin: use IndexBitSet to optimize skipped plugins checking (#8497) by @ShroXd
- rust/tla: skip compute_tla if there is no module use TLA (#8487) by @ShroXd

### 🧪 Testing

- node/watch: make watch tests run in concurrent and retry-able (#8512) by @hyf0
- add test case for static flag tree-shaking (#8476) by @IWANABETHATGUY
- migrate post-banner sourcemap-with-shebang to Rust (#8477) by @Copilot

### ⚙️ Miscellaneous Tasks

- vscode: `formatOnSave` for markdown files using oxc formatter (#8536) by @minsoo-web
- deps: update test262 submodule for tests (#8528) by @sapphi-red
- remove `retry` workaround from output paths test fixtures (#8520) by @Copilot
- docs: add Shuyuan Wang (h-a-n-a) and remove from acknowledgements (#8509) by @Copilot
- consolidate top_level_var test cases using configVariants (#8508) by @IWANABETHATGUY
- add s390x and ppc64le linux gnu targets (#8493) by @Brooooooklyn

### ◀️ Revert

- fix(rolldown): increase tokio blocking threads size for watch mode (#8517) by @hyf0

### ❤️ New Contributors

* @minsoo-web made their first contribution in [#8536](#8536)
* @crusty-voidzero made their first contribution in [#8495](#8495)
* @maciekzygmunt made their first contribution in [#8486](#8486)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
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.

Incorrect new.target.prototype transformation

3 participants