Skip to content

Commit ac6028d

Browse files
authored
Merge branch 'main' into chore-rsc-nightly
2 parents 442d665 + 713a320 commit ac6028d

File tree

21 files changed

+330
-393
lines changed

21 files changed

+330
-393
lines changed

.github/renovate.json5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,9 @@
4343
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
4444

4545
"prettier", // waiting for stable choice on ternaries
46+
47+
// plugin-rsc
48+
"react-router",
49+
"@react-router/dev",
4650
],
4751
}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
env:
5656
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5757

58-
- if: steps.tag.outputs.isAlpha == 'false'
58+
- if: steps.tag.outputs.isAlpha == 'false' && steps.tag.outputs.pkgName != 'plugin-rsc'
5959
uses: ArnaudBarre/github-release@4fa6eafe8e2449c7c1c5a91ae50de4ee34db0b40 # v1.5.0
6060
with:
6161
path: packages/${{ steps.tag.outputs.pkgName }}/CHANGELOG.md

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@vitejs/release-scripts": "^1.6.0",
4040
"eslint": "^9.30.1",
4141
"eslint-plugin-import-x": "^4.16.1",
42-
"eslint-plugin-n": "^17.20.0",
42+
"eslint-plugin-n": "^17.21.0",
4343
"eslint-plugin-regexp": "^2.9.0",
4444
"fs-extra": "^11.3.0",
4545
"globals": "^16.3.0",

packages/plugin-react-oxc/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
### Return `Plugin[]` instead of `PluginOption[]`
6+
57
## 0.2.3 (2025-06-16)
68

79
### Disable refresh transform when `server.hmr: false` is set [#502](https://github.com/vitejs/vite-plugin-react/pull/502)

packages/plugin-react-oxc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848
"vite": "catalog:rolldown-vite"
4949
},
5050
"dependencies": {
51-
"@rolldown/pluginutils": "1.0.0-beta.23"
51+
"@rolldown/pluginutils": "1.0.0-beta.24"
5252
}
5353
}

packages/plugin-react-oxc/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { dirname, join } from 'node:path'
22
import { fileURLToPath } from 'node:url'
33
import { readFileSync } from 'node:fs'
4-
import type { BuildOptions, Plugin, PluginOption } from 'vite'
4+
import type { BuildOptions, Plugin } from 'vite'
55
import {
66
addRefreshWrapper,
77
avoidSourceMapOption,
@@ -30,7 +30,7 @@ export interface Options {
3030

3131
const defaultIncludeRE = /\.[tj]sx?(?:$|\?)/
3232

33-
export default function viteReact(opts: Options = {}): PluginOption[] {
33+
export default function viteReact(opts: Options = {}): Plugin[] {
3434
const include = opts.include ?? defaultIncludeRE
3535
const exclude = [
3636
...(Array.isArray(opts.exclude)

packages/plugin-react-swc/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
### Return `Plugin[]` instead of `PluginOption[]`
6+
57
## 3.10.2 (2025-06-10)
68

79
### Suggest `@vitejs/plugin-react-oxc` if rolldown-vite is detected [#491](https://github.com/vitejs/vite-plugin-react/pull/491)

packages/plugin-react-swc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc#readme",
3131
"dependencies": {
32-
"@rolldown/pluginutils": "1.0.0-beta.23",
32+
"@rolldown/pluginutils": "1.0.0-beta.24",
3333
"@swc/core": "^1.12.9"
3434
},
3535
"peerDependencies": {

packages/plugin-react-swc/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
type Options as SWCOptions,
1212
transform,
1313
} from '@swc/core'
14-
import type { PluginOption } from 'vite'
14+
import type { Plugin } from 'vite'
1515
import {
1616
addRefreshWrapper,
1717
getPreambleCode,
@@ -83,7 +83,7 @@ type Options = {
8383
disableOxcRecommendation?: boolean
8484
}
8585

86-
const react = (_options?: Options): PluginOption[] => {
86+
const react = (_options?: Options): Plugin[] => {
8787
let hmrDisabled = false
8888
const options = {
8989
jsxImportSource: _options?.jsxImportSource ?? 'react',

packages/plugin-react/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
## Unreleased
44

5+
### Return `Plugin[]` instead of `PluginOption[]`
6+
7+
The return type has changed from `react(): PluginOption[]` to more specialized type `react(): Plugin[]`. This allows for type-safe manipulation of plugins, for example:
8+
9+
```tsx
10+
// previously this causes type errors
11+
react({ babel: { plugins: ['babel-plugin-react-compiler'] } })
12+
.map(p => ({ ...p, applyToEnvironment: e => e.name === 'client' }))
13+
```
14+
515
## 4.6.0 (2025-06-23)
616

717
### Add raw Rolldown support

0 commit comments

Comments
 (0)