Skip to content

fix(react): make the react compiler preset filter linear - #1353

Merged
sapphi-red merged 2 commits into
mainfrom
fix/react-react-compiler-preset-filter-linear
Jul 30, 2026
Merged

fix(react): make the react compiler preset filter linear#1353
sapphi-red merged 2 commits into
mainfrom
fix/react-react-compiler-preset-filter-linear

Conversation

@sapphi-red

@sapphi-red sapphi-red commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description

/forwardRef|memo|(?:const|let|var|function)\s+(?:[A-Z]|use[A-Z0-9])|(?:^|[^\w$\u0080-\uFFFF])(?:[A-Z]|use[A-Z0-9])[\w$\u0080-\uFFFF]*\s*(?:\(|[:=]\s*(?:function|\())/
/forwardRef|memo|(?:const|let|var|function)\s+(?:[A-Z]|use[A-Z0-9])|(?:^|[^\p{ID_Continue}$\u200C\u200D])(?:[A-Z]|use[A-Z0-9])[\p{ID_Continue}$\u200C\u200D]*\s*(?:\(|[:=]\s*(?:function|\())/u

AI initially suggested these, but I think it's too complex and is better to accept false-positives here.

fixes #1349
refs #1138

@sapphi-red sapphi-red added p4-important ❗ Violate documented behavior or significantly improves performance (priority) plugin: react labels Jul 30, 2026
@sapphi-red
sapphi-red merged commit 555cdbc into main Jul 30, 2026
13 checks passed
@sapphi-red
sapphi-red deleted the fix/react-react-compiler-preset-filter-linear branch July 30, 2026 05:11
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Aug 1, 2026
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 6.0.2 | 6.0.5 |


## [v6.0.5](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#605-2026-07-30)

##### Fixed the react compiler preset filter to be linear ([#1353](vitejs/vite-plugin-react#1353))

The improved filter in v6.0.3 was non-linear and caused a performance regression ([#1349](vitejs/vite-plugin-react#1349)). The filter was changed to be linear to avoid that.


## [v6.0.4](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#604-2026-07-22)

##### Fixed `$RefreshSig$ is not defined` error when running `vite dev` with `NODE_ENV=production`

When running `vite dev` with `NODE_ENV=production`, the app errored with `$RefreshSig$ is not defined`.
This error is now fixed.


## [v6.0.3](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#603-2026-06-23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p4-important ❗ Violate documented behavior or significantly improves performance (priority) plugin: react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance regression since version above 6.0.2

2 participants