Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sapphi-red
Copy link
Collaborator

@sapphi-red sapphi-red commented Sep 11, 2025

Rebased #5090 and added the missing features.

The reason why #5090 alone did not improve performance was because the refresh wrapper plugin injects import * as RefreshRuntime from "/@react-refresh"; which would cause this resolveId hook to be called for all react files.
https://github.com/vitejs/vite-plugin-react/blob/f63bb83c7070d07ae5f488cdc9ac643bac61ba59/packages/plugin-react/src/index.ts#L433-L440
In this case the filter doesn't help much.

Copy link
Collaborator Author

sapphi-red commented Sep 11, 2025


How to use the Graphite Merge Queue

Add the label graphite: merge 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.

@sapphi-red sapphi-red changed the base branch from main to graphite-base/6144 September 11, 2025 04:18
@sapphi-red sapphi-red force-pushed the 09-11-feat_add_native_react-refresh-wrapper_plugin branch from 62cfa1e to 2684379 Compare September 11, 2025 04:18
@netlify
Copy link

netlify bot commented Sep 11, 2025

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 2a3102d
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/68c3fc5de065a50008107b9e
😎 Deploy Preview https://deploy-preview-6144--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 changed the base branch from graphite-base/6144 to 09-11-fix_register_trace_subscriber September 11, 2025 04:18
@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2025

Benchmarks Rust

  • target: main(fb26798)
  • pr: 09-11-feat_add_native_react-refresh-wrapper_plugin(2a3102d)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     82.1±2.31ms        ? ?/sec    1.03     85.0±3.41ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     93.0±2.76ms        ? ?/sec    1.05     97.7±2.49ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    119.9±1.56ms        ? ?/sec    1.03    123.2±2.55ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    141.0±2.57ms        ? ?/sec    1.03    145.0±2.27ms        ? ?/sec
bundle/bundle@threejs                                        1.00     45.6±2.01ms        ? ?/sec    1.01     46.2±1.44ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     53.8±0.83ms        ? ?/sec    1.03     55.3±1.41ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    472.0±5.85ms        ? ?/sec    1.04    488.5±8.66ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    550.8±3.55ms        ? ?/sec    1.03    566.6±7.08ms        ? ?/sec
scan/scan@rome_ts                                            1.00     97.2±2.39ms        ? ?/sec    1.02     98.8±1.86ms        ? ?/sec
scan/scan@threejs                                            1.00     34.9±2.09ms        ? ?/sec    1.01     35.1±1.51ms        ? ?/sec
scan/scan@threejs10x                                         1.00    358.8±5.46ms        ? ?/sec    1.02    365.5±5.47ms        ? ?/sec

@sapphi-red sapphi-red force-pushed the 09-11-fix_register_trace_subscriber branch from 4695299 to 4e7996b Compare September 11, 2025 08:46
@sapphi-red sapphi-red force-pushed the 09-11-feat_add_native_react-refresh-wrapper_plugin branch 2 times, most recently from 3b02acc to 6e03c04 Compare September 11, 2025 09:34
@sapphi-red sapphi-red force-pushed the 09-11-fix_register_trace_subscriber branch from 4e7996b to 012c380 Compare September 11, 2025 09:34
@graphite-app graphite-app bot changed the base branch from 09-11-fix_register_trace_subscriber to graphite-base/6144 September 11, 2025 10:09
@graphite-app graphite-app bot force-pushed the 09-11-feat_add_native_react-refresh-wrapper_plugin branch from 6e03c04 to bf0c5a8 Compare September 11, 2025 10:19
@graphite-app graphite-app bot changed the base branch from graphite-base/6144 to main September 11, 2025 10:19
@graphite-app graphite-app bot force-pushed the 09-11-feat_add_native_react-refresh-wrapper_plugin branch from bf0c5a8 to da80ed4 Compare September 11, 2025 10:19
@sapphi-red sapphi-red force-pushed the 09-11-feat_add_native_react-refresh-wrapper_plugin branch 2 times, most recently from 8c1c23b to 759f3eb Compare September 11, 2025 12:18
@schiller-manuel
Copy link

is this related to vitejs/vite-plugin-react#871 ?

@sapphi-red
Copy link
Collaborator Author

No, it's not related to that issue.

@sapphi-red sapphi-red force-pushed the 09-11-feat_add_native_react-refresh-wrapper_plugin branch from 8d8806e to 0cc6bbd Compare September 12, 2025 03:16
@sapphi-red sapphi-red changed the base branch from main to graphite-base/6144 September 12, 2025 10:34
@sapphi-red sapphi-red force-pushed the 09-11-feat_add_native_react-refresh-wrapper_plugin branch from 0cc6bbd to 9b9c076 Compare September 12, 2025 10:34
@sapphi-red sapphi-red changed the base branch from graphite-base/6144 to 09-12-feat_rolldown_plugin_utils_add_to_string_literal_ September 12, 2025 10:35
@sapphi-red sapphi-red requested a review from shulaoda September 12, 2025 10:39
@sapphi-red sapphi-red assigned shulaoda and sapphi-red and unassigned shulaoda Sep 12, 2025
@sapphi-red sapphi-red marked this pull request as ready for review September 12, 2025 10:40
@graphite-app graphite-app bot changed the base branch from 09-12-feat_rolldown_plugin_utils_add_to_string_literal_ to graphite-base/6144 September 12, 2025 10:46
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 12, 2025

Merge activity

@graphite-app graphite-app bot changed the base branch from graphite-base/6144 to main September 12, 2025 10:56
Rebased #5090 and added the missing features.

The reason why #5090 alone did not improve performance was because the refresh wrapper plugin injects `import * as RefreshRuntime from "/@react-refresh";` which would cause this resolveId hook to be called for all react files.
https://github.com/vitejs/vite-plugin-react/blob/f63bb83c7070d07ae5f488cdc9ac643bac61ba59/packages/plugin-react/src/index.ts#L433-L440
In this case the filter doesn't help much.
@graphite-app graphite-app bot force-pushed the 09-11-feat_add_native_react-refresh-wrapper_plugin branch from a337fb4 to 2a3102d Compare September 12, 2025 10:56
@graphite-app graphite-app bot merged commit 2a3102d into main Sep 12, 2025
29 checks passed
@graphite-app graphite-app bot deleted the 09-11-feat_add_native_react-refresh-wrapper_plugin branch September 12, 2025 11:06
shulaoda pushed a commit that referenced this pull request Sep 15, 2025
## [1.0.0-beta.38] - 2025-09-15

📦 OXC Runtime Helpers Now Embedded

- Instant loading: Memory access instead of file I/O
- 91% smaller: From 229 KB external package to ~25 KB in binary
- Universal support: Works seamlessly in all environments including browsers
- Zero dependencies: Helpers embedded directly, no `@oxc-project/runtime` needed

⚡ Windows Performance Boost

- ~10% faster bundling on Windows
- Powered by `oxc-resolver` optimizations

Both improvements require zero configuration - just update to the latest version and enjoy! 🎉

> [!warning] 
> ### 💥 BREAKING CHANGES
> - rolldown_plugin_oxc_runtime: embed helpers to support browser environment (#6177) by @shulaoda

### 🚀 Features

- rolldown: oxc v0.89.0 (#6220) by @Boshen
- rolldown_plugin_esm_external_require: add duplicate external detection (#6202) by @shulaoda
- cross module noop function optimization (#6199) by @IWANABETHATGUY
- support to specify `scan_mode` in `bundler.scan` (#6204) by @IWANABETHATGUY
- warn when transform options override tsconfig compiler options (#6197) by @shulaoda
- support `false` in `resolve.alias` to ignore resolution (#6203) by @shulaoda
- cli: remove `getJsonSchema` (#6186) by @shulaoda
- cli: add Node.js version warning for unsupported versions (#6150) by @Copilot
- rolldown_plugin_oxc_runtime: include version in virtual module paths (#6179) by @shulaoda
- add native react-refresh-wrapper plugin (#6144) by @sapphi-red
- rolldown_plugin_utils: add `to_string_literal` (#6178) by @sapphi-red
- improve error messages for builtin plugins (#6175) by @shulaoda
- indent module content in IIFE format (#6174) by @IWANABETHATGUY
- rolldown_error: improve N-API error handling logic (#6171) by @shulaoda
- rolldown_error: improve `ByteLocator#byte_offset` (#6169) by @shulaoda
- dev: skip writing to file (#6148) by @sapphi-red
- dev: add `skip_write` option (#6151) by @sapphi-red
- dev: ignore file metadata changes (#6138) by @sapphi-red
- dev: add PathsMut for debounced PollWatcher (#6139) by @sapphi-red
- dev: use PathsMut for debounced RecommendedWatcher (#6137) by @sapphi-red
- improve bundler initialization error handling (#6132) by @shulaoda

### 🐛 Bug Fixes

- rolldown_plugin_vite_resolve: correctly handle Windows drive paths with leading slash (#6209) by @shulaoda
- allow `jsx.pragmaFrag` instead of `jsx.pragmaFlag` (#6200) by @sapphi-red
- improve import-glob plugin error handling without panic (#6106) by @hikomoon
- Panic with "jsx": "preserve" when rewrite a `memberExpression` (#6192) by @IWANABETHATGUY
- rolldown_error: use `byte_slice` instead of `slice` for correct span handling (#6185) by @shulaoda
- generate valid identifier for export names with `minifyInternalExports` (#6166) by @sapphi-red
- useless __export helper usage (#6160) by @IWANABETHATGUY
- incremental watch modify entry module (#6156) by @IWANABETHATGUY
- register trace subscriber (#6145) by @sapphi-red
- json imports error with `eval` or `arguments` in *strict mode* (#6140) by @IWANABETHATGUY
- `process` is not defined in repl (#6147) by @IWANABETHATGUY

### 💼 Other

- rolldown: support to build `rolldown` with `.wasm` binding (#6153) by @hyf0
- rolldown: refactor `build.ts` to prepare to support build `rolldown` package with wasi binding (#6152) by @hyf0

### 🚜 Refactor

- share `FlatOptions` in whole build session (#6211) by @IWANABETHATGUY
- remove unnecessary `comments` in ScopeHoistingFinalizerContext (#6205) by @IWANABETHATGUY
- move external string/regex matching from JS to Rust (#6201) by @shulaoda
- rename `cross_module_inline_const` to `cross_module_optimization` (#6193) by @IWANABETHATGUY
- rename `class` and `function` visitor to `class_decl`, `function_decl` (#6176) by @IWANABETHATGUY
- rolldown_error: tweak code (#6168) by @shulaoda
- improve `BuildDiagnostic` (#6165) by @shulaoda
- improve `RolldownBuild` (#6136) by @shulaoda
- rolldown_error: remove unused `EventKind::IoError` (#6134) by @shulaoda
- rename CustomPathsMut to NotifyPathsMutAdapter and move to utils (#6135) by @hyf0

### 📚 Documentation

- contrib-guide: add profiling instructions for macOS (#6183) by @sapphi-red
- contrib-guide: update just commands (#6181) by @sapphi-red

### ⚡ Performance

- pre calculate `side_effects_free_function_symbol_ref` (#6206) by @IWANABETHATGUY
- parallel clone ast (#6167) by @IWANABETHATGUY
- reserve capacity for rendered modules in `instantiate_chunk` (#6159) by @sapphi-red

### 🧪 Testing

- hmr: ensure each test isolated to be able to be retryed (#6142) by @hyf0

### ⚙️ Miscellaneous Tasks

- deps: lock file maintenance npm packages (#6219) by @renovate[bot]
- deps: lock file maintenance rust crates (#6217) by @renovate[bot]
- deps: update github-actions (#6213) by @renovate[bot]
- deps: lock file maintenance npm packages (#6215) by @renovate[bot]
- deps: update github-actions (major) (#6214) by @renovate[bot]
- tweak wordings (#6208) by @iiio2
- fix unused import warnings (#6196) by @shulaoda
- correct deprecated JSDoc reference for jsx option (#6195) by @shulaoda
- add `if: always()` to wasi-test (#6190) by @sapphi-red
- skip `@rolldown/browser` build if no node related changes detected (#6189) by @sapphi-red
- extract wasi build to reusable workflow (#6188) by @sapphi-red
- deps: update dependency tsdown to v0.15.1 (#6184) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.16.5 (#6182) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.16.4 (#6180) by @renovate[bot]
- dev: implement Debug trait for DevOptions (#6173) by @sapphi-red
- deps: update dependency rolldown-plugin-dts to v0.16.3 (#6172) by @renovate[bot]
- update @napi-rs/cli and js binding (#6157) by @Brooooooklyn
- ci: ensure `@rolldown/browser` build without errors (#6155) by @hyf0
- ci: ensure running wasi tests correctly (#6154) by @hyf0
- add more tracing instrumentation (#6149) by @sapphi-red
- extend timeout for rollup test (#6143) by @IWANABETHATGUY
- rolldown_error: remove unnecessary `type_aliases.rs` (#6133) by @shulaoda
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.

5 participants