Skip to content

Commit a958f2a

Browse files
authored
Merge branch 'main' into chore-rsc-nightly
2 parents defa67b + 54e9a9d commit a958f2a

File tree

26 files changed

+352
-619
lines changed

26 files changed

+352
-619
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ jobs:
5050
run: pnpm build
5151

5252
- name: Publish package
53-
run: pnpm run ci-publish ${{ github.ref_name }}
54-
env:
55-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
run: npm i -g npm@^11.5.2 && pnpm run ci-publish ${{ github.ref_name }}
5654

5755
- if: steps.tag.outputs.isAlpha == 'false' && steps.tag.outputs.pkgName != 'plugin-rsc'
5856
uses: ArnaudBarre/github-release@4fa6eafe8e2449c7c1c5a91ae50de4ee34db0b40 # v1.5.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+
## 0.4.2 (2025-09-17)
6+
57
### Perf: simplify refresh wrapper generation ([#835](https://github.com/vitejs/vite-plugin-react/pull/835))
68

79
## 0.4.1 (2025-08-19)

packages/plugin-react-oxc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-react-oxc",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"license": "MIT",
55
"author": "Evan You",
66
"contributors": [

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+
## 4.1.0 (2025-09-17)
6+
57
### Set SWC cacheRoot options
68

79
This is set to `{viteCacheDir}/swc` and override the default of `.swc`.

packages/plugin-react-swc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-react-swc",
3-
"version": "4.0.1",
3+
"version": "4.1.0",
44
"license": "MIT",
55
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
66
"description": "Speed up your Vite dev server with SWC",

packages/plugin-react/CHANGELOG.md

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

33
## Unreleased
44

5+
## 5.0.3 (2025-09-17)
6+
7+
### HMR did not work for components imported with queries with rolldown-vite ([#872](https://github.com/vitejs/vite-plugin-react/pull/872))
8+
59
### Perf: simplify refresh wrapper generation ([#835](https://github.com/vitejs/vite-plugin-react/pull/835))
610

711
## 5.0.2 (2025-08-28)

packages/plugin-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-react",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"license": "MIT",
55
"author": "Evan You",
66
"description": "The default Vite plugin for React projects",

packages/plugin-react/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ export default function viteReact(opts: Options = {}): Plugin[] {
144144
// if development is enabled and those properties are already present
145145
development: false,
146146
},
147-
jsxRefreshInclude: include,
148-
jsxRefreshExclude: exclude,
147+
jsxRefreshInclude: makeIdFiltersToMatchWithQuery(include),
148+
jsxRefreshExclude: makeIdFiltersToMatchWithQuery(exclude),
149149
},
150150
}
151151
} else {
@@ -156,8 +156,8 @@ export default function viteReact(opts: Options = {}): Plugin[] {
156156
importSource: opts.jsxImportSource,
157157
refresh: command === 'serve',
158158
},
159-
jsxRefreshInclude: include,
160-
jsxRefreshExclude: exclude,
159+
jsxRefreshInclude: makeIdFiltersToMatchWithQuery(include),
160+
jsxRefreshExclude: makeIdFiltersToMatchWithQuery(exclude),
161161
},
162162
optimizeDeps: {
163163
rollupOptions: { transform: { jsx: { runtime: 'automatic' } } },

packages/plugin-rsc/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## <small>[0.4.31](https://github.com/vitejs/vite-plugin-react/compare/[email protected]@0.4.31) (2025-09-17)</small>
2+
### Bug Fixes
3+
4+
* **rsc:** fix plugin name in `client-only` error message ([#862](https://github.com/vitejs/vite-plugin-react/issues/862)) ([0f2fbc7](https://github.com/vitejs/vite-plugin-react/commit/0f2fbc7c1fe2b6228864c5b424cea2309323fb67))
5+
* **rsc:** remove server style when css import is removed ([#849](https://github.com/vitejs/vite-plugin-react/issues/849)) ([4ae3f18](https://github.com/vitejs/vite-plugin-react/commit/4ae3f184eaa3e7fe559ccaf67c35e17a6e7fefa0))
6+
* **rsc:** show import chain for server-only and client-only import error ([#867](https://github.com/vitejs/vite-plugin-react/issues/867)) ([ba16c34](https://github.com/vitejs/vite-plugin-react/commit/ba16c34f6b70e68f29bff110c6906829ec3b2e8d))
7+
8+
### Documentation
9+
10+
* **rsc:** mention `validateImports` option for build time `server-only` and `client-only` validation ([#858](https://github.com/vitejs/vite-plugin-react/issues/858)) ([a96a6b2](https://github.com/vitejs/vite-plugin-react/commit/a96a6b2ef0afc1cc914885d4514865711d978fbf))
11+
* **rsc:** separate "Tips" section ([#864](https://github.com/vitejs/vite-plugin-react/issues/864)) ([32cfa5f](https://github.com/vitejs/vite-plugin-react/commit/32cfa5fe1e9c255e59a29c14d1b8585772f7b61e))
12+
13+
### Miscellaneous Chores
14+
15+
* **rsc:** add missing rsc-html-stream dep (fix [#857](https://github.com/vitejs/vite-plugin-react/issues/857)) ([#868](https://github.com/vitejs/vite-plugin-react/issues/868)) ([c30cf1a](https://github.com/vitejs/vite-plugin-react/commit/c30cf1a7db312a2643de426c7ac13479ce90289a))
16+
17+
### Tests
18+
19+
* **rsc:** tweak assertions for rolldown-vite ([#869](https://github.com/vitejs/vite-plugin-react/issues/869)) ([a2a287a](https://github.com/vitejs/vite-plugin-react/commit/a2a287aef6be302a771b8f7c512f190578412685))
20+
121
## <small>[0.4.30](https://github.com/vitejs/vite-plugin-react/compare/[email protected]@0.4.30) (2025-09-15)</small>
222
### Features
323

packages/plugin-rsc/e2e/basic.test.ts

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -855,31 +855,42 @@ function defineTest(f: Fixture) {
855855
'rgb(255, 165, 0)',
856856
)
857857

858-
// remove css import
859858
const editor = f.createEditor('src/routes/style-server/server.tsx')
860-
editor.edit((s) =>
861-
s.replaceAll(`import './server.css'`, `/* import './server.css' */`),
862-
)
859+
860+
// removing and adding new css works via hmr
861+
{
862+
await using _ = await expectNoReload(page)
863+
864+
// remove css import
865+
editor.edit((s) =>
866+
s.replaceAll(`import './server.css'`, `/* import './server.css' */`),
867+
)
868+
await expect(page.locator('.test-style-server')).toHaveCSS(
869+
'color',
870+
'rgb(0, 0, 0)',
871+
)
872+
873+
// add new css
874+
editor.edit((s) =>
875+
s.replaceAll(`/* import './server.css' */`, `import './server2.css'`),
876+
)
877+
await expect(page.locator('.test-style-server')).toHaveCSS(
878+
'color',
879+
'rgb(0, 255, 165)',
880+
)
881+
}
882+
883+
// TODO: React doesn't re-inert same css link. so manual reload is required.
884+
editor.reset()
863885
await page.waitForTimeout(100)
864886
await expect(async () => {
865-
// TODO: shouldn't require reload
866887
await page.reload()
867888
await expect(page.locator('.test-style-server')).toHaveCSS(
868889
'color',
869-
'rgb(0, 0, 0)',
890+
'rgb(255, 165, 0)',
870891
{ timeout: 10 },
871892
)
872893
}).toPass()
873-
874-
// adding css works without reload
875-
await waitForHydration(page)
876-
await using _ = await expectNoReload(page)
877-
878-
editor.reset()
879-
await expect(page.locator('.test-style-server')).toHaveCSS(
880-
'color',
881-
'rgb(255, 165, 0)',
882-
)
883894
})
884895

885896
testNoJs('adding/removing css server @nojs', async ({ page }) => {

0 commit comments

Comments
 (0)