Skip to content

Comments

feat: make native json plugin callable#4908

Merged
shulaoda merged 1 commit intomainfrom
06-11-feat_make_native_json_plugin_callable
Jun 11, 2025
Merged

feat: make native json plugin callable#4908
shulaoda merged 1 commit intomainfrom
06-11-feat_make_native_json_plugin_callable

Conversation

@shulaoda
Copy link
Member

@shulaoda shulaoda commented Jun 11, 2025

By the way, are there any native plugins that can be used in dev other than the resolver? If there aren't, I wonder if it's better to disable them in resolveConfig.

Currently, we only have three native plugins that are potentially used in the dev environment: resolver, wasmFallback, and maybe this json plugin. The rest aren't callable in dev because they either use the transform_ast hook, rely on internal context, or are only used in build environment.

Originally posted by @shulaoda in vitejs/rolldown-vite#246 (comment)

Copy link
Member Author

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

@netlify
Copy link

netlify bot commented Jun 11, 2025

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit f1a2087
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/68491484d99e820008d8593e
😎 Deploy Preview https://deploy-preview-4908--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.

@shulaoda shulaoda requested a review from sapphi-red June 11, 2025 05:32
@shulaoda shulaoda marked this pull request as ready for review June 11, 2025 05:32
@shulaoda
Copy link
Member Author

This adaptation is currently only for the JSON plugin, and it might introduce some performance overhead in the dev environment. Is it really worth it — or should we just use the JS JSON plugin during dev instead? @sapphi-red cc

IWANABETHATGUY
IWANABETHATGUY previously approved these changes Jun 11, 2025
@github-actions
Copy link
Contributor

Benchmarks Rust

  • target: main(84e624d)
  • pr: 06-11-feat_make_native_json_plugin_callable(f1a2087)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     74.1±2.09ms        ? ?/sec    1.07     79.2±2.00ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     84.6±2.13ms        ? ?/sec    1.09     91.9±2.58ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    113.5±2.73ms        ? ?/sec    1.03    116.4±3.47ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    126.9±2.31ms        ? ?/sec    1.05    132.7±3.14ms        ? ?/sec
bundle/bundle@threejs                                        1.00     40.5±2.40ms        ? ?/sec    1.05     42.5±1.04ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     47.9±1.25ms        ? ?/sec    1.04     49.9±0.90ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    431.9±6.96ms        ? ?/sec    1.04   451.0±10.84ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    504.6±6.74ms        ? ?/sec    1.03    517.5±5.33ms        ? ?/sec
scan/scan@rome_ts                                            1.00     90.8±2.23ms        ? ?/sec    1.02     92.4±1.98ms        ? ?/sec
scan/scan@threejs                                            1.00     32.4±1.80ms        ? ?/sec    1.06     34.1±0.68ms        ? ?/sec
scan/scan@threejs10x                                         1.01    333.7±8.43ms        ? ?/sec    1.00    329.5±5.65ms        ? ?/sec

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

I tested this native json plugin on https://github.com/sapphi-red/performance-compare and the diff of the native plugin and js plugin was less than 2% (which is within the margin of error). So I think it's worth.

@shulaoda shulaoda added this pull request to the merge queue Jun 11, 2025
Merged via the queue into main with commit b4f3890 Jun 11, 2025
25 checks passed
@shulaoda shulaoda deleted the 06-11-feat_make_native_json_plugin_callable branch June 11, 2025 07:01
github-actions bot pushed a commit that referenced this pull request Jun 11, 2025
## [1.0.0-beta.15] - 2025-06-11

### 🚀 Features

- feat: make native json plugin callable by @shulaoda in [#4908](#4908)
- feat: support preserveSignature in `this.emitFile` by @IWANABETHATGUY in [#4895](#4895)
- rolldown_plugin_module_preload_polyfill: feat(rolldown_plugin_module_preload_polyfill): expose plugin config by @shulaoda in [#4896](#4896)

### 🐛 Bug Fixes

- fix: add missing pathe polyfill by @sxzz in [#4912](#4912)
- node: fix(node): call options hook for experimental_scan by @sapphi-red in [#4911](#4911)
- fix: better `NoEntryPoint` error message by @IWANABETHATGUY in [#4903](#4903)
- fix: fail to bundle when provide entryPoint dynamiclly by @IWANABETHATGUY in [#4902](#4902)

### 🧪 Testing

- pluginutils: test(pluginutils): add query suffix case for `makeIdFiltersToMatchWithQuery` by @sapphi-red in [#4914](#4914)
- test: copy rollup preserveEntrySignature override-via-plugin test by @IWANABETHATGUY in [#4910](#4910)
- test: include error in hmr test snapshots by @sapphi-red in [#4899](#4899)

### ⚙️ Miscellaneous Tasks

- chore: update committed dts by @sapphi-red in [#4913](#4913)
- chore: bump rolldown-ariadne by @IWANABETHATGUY in [#4909](#4909)
- improve prepare release commit message by @Boshen
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