Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vitejs/vite-plugin-react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0aaf2e56de64d566af9636877200029ec6437918
Choose a base ref
...
head repository: vitejs/vite-plugin-react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d758a2a44b0a2cb3c206fa61166cda9d5cf58221
Choose a head ref
  • 9 commits
  • 8 files changed
  • 3 contributors

Commits on Dec 12, 2022

  1. Copy the full SHA
    d71849c View commit details

Commits on Dec 13, 2022

  1. Copy the full SHA
    82f686f View commit details
  2. chore(deps): update all non-major dependencies (#58)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 13, 2022
    Copy the full SHA
    9955e30 View commit details

Commits on Dec 19, 2022

  1. Copy the full SHA
    9231a86 View commit details
  2. chore(deps): update all non-major dependencies (#65)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 19, 2022
    Copy the full SHA
    65f210d View commit details

Commits on Dec 27, 2022

  1. fix(deps): update all non-major dependencies (#69)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 27, 2022
    Copy the full SHA
    0a8e099 View commit details
  2. chore(deps): update dependency unbuild to v1 (#60)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 27, 2022
    Copy the full SHA
    9ca6f9c View commit details

Commits on Jan 2, 2023

  1. Copy the full SHA
    370e884 View commit details

Commits on Jan 5, 2023

  1. Copy the full SHA
    d758a2a View commit details
2 changes: 1 addition & 1 deletion .github/workflows/lock-closed-issues.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ jobs:
if: github.repository == 'vitejs/vite-plugin-react'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
- uses: dessant/lock-threads@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-inactive-days: "14"
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -34,35 +34,35 @@
"@types/babel__core": "^7.1.20",
"@types/fs-extra": "^9.0.13",
"@types/minimist": "^1.2.2",
"@types/node": "^18.11.10",
"@types/node": "^18.11.18",
"@types/picomatch": "^2.3.0",
"@types/prompts": "^2.4.1",
"@types/prompts": "^2.4.2",
"@types/semver": "^7.3.13",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^8.29.0",
"eslint-define-config": "^1.12.0",
"eslint": "^8.31.0",
"eslint-define-config": "^1.13.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-regexp": "^1.11.0",
"execa": "^6.1.0",
"fs-extra": "^10.1.0",
"fs-extra": "^11.1.0",
"lint-staged": "^13.1.0",
"minimist": "^1.2.7",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"playwright-chromium": "^1.28.1",
"prettier": "2.8.0",
"playwright-chromium": "^1.29.1",
"prettier": "2.8.1",
"prompts": "^2.4.2",
"rollup": "^3.7.0",
"semver": "^7.3.8",
"simple-git-hooks": "^2.8.1",
"tsx": "^3.12.1",
"typescript": "^4.6.4",
"unbuild": "^0.9.4",
"vite": "^4.0.0",
"vitest": "^0.25.3"
"unbuild": "^1.0.2",
"vite": "^4.0.3",
"vitest": "^0.26.3"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false",
@@ -82,5 +82,5 @@
"eslint --cache --fix"
]
},
"packageManager": "pnpm@7.18.1"
"packageManager": "pnpm@7.21.0"
}
7 changes: 7 additions & 0 deletions packages/plugin-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## <small>3.0.1 (2023-01-05)</small>

* fix: don't invalidate when code is invalid (#67) ([9231a86](https://github.com/vitejs/vite-plugin-react/commit/9231a86)), closes [#67](https://github.com/vitejs/vite-plugin-react/issues/67)
* fix(deps): update all non-major dependencies (#69) ([0a8e099](https://github.com/vitejs/vite-plugin-react/commit/0a8e099)), closes [#69](https://github.com/vitejs/vite-plugin-react/issues/69)



## 3.0.0 (2022-12-09)

* chore: update vite to ^4.0.0 (#57) ([941b20d](https://github.com/vitejs/vite-plugin-react/commit/941b20d)), closes [#57](https://github.com/vitejs/vite-plugin-react/issues/57)
4 changes: 2 additions & 2 deletions packages/plugin-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vitejs/plugin-react",
"version": "3.0.0",
"version": "3.0.1",
"license": "MIT",
"author": "Evan You",
"contributors": [
@@ -38,7 +38,7 @@
},
"homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme",
"dependencies": {
"@babel/core": "^7.20.5",
"@babel/core": "^7.20.7",
"@babel/plugin-transform-react-jsx-self": "^7.18.6",
"@babel/plugin-transform-react-jsx-source": "^7.19.6",
"magic-string": "^0.27.0",
1 change: 1 addition & 0 deletions packages/plugin-react/src/fast-refresh.ts
Original file line number Diff line number Diff line change
@@ -92,6 +92,7 @@ function isReactRefreshBoundary(mod) {
}
import.meta.hot.accept(mod => {
if (!mod) return;
if (isReactRefreshBoundary(mod)) {
${timeout}
} else {
30 changes: 26 additions & 4 deletions playground/react/__tests__/react.spec.ts
Original file line number Diff line number Diff line change
@@ -19,10 +19,34 @@ test('should update', async () => {
})

test('should hmr', async () => {
editFile('App.jsx', (code) => code.replace('Vite + React', 'Updated'))
await untilUpdated(() => page.textContent('h1'), 'Hello Updated')
editFile('App.jsx', (code) =>
code.replace('Vite + React', 'Vite + React Updated'),
)
await untilUpdated(() => page.textContent('h1'), 'Hello Vite + React Updated')
// preserve state
expect(await page.textContent('#state-button')).toMatch('count is: 1')

editFile('App.jsx', (code) =>
code.replace('Vite + React Updated', 'Vite + React'),
)
await untilUpdated(() => page.textContent('h1'), 'Hello Vite + React')
})

test.runIf(isServe)('should not invalidate when code is invalid', async () => {
editFile('App.jsx', (code) =>
code.replace('<div className="App">', '<div className="App"}>'),
)

await untilUpdated(
() => page.textContent('vite-error-overlay .message-body'),
'Unexpected token',
)
// if import.meta.invalidate happened, the old page won't be shown because the page is reloaded
expect(await page.textContent('h1')).toMatch('Hello Vite + React')

editFile('App.jsx', (code) =>
code.replace('<div className="App"}>', '<div className="App">'),
)
})

test.runIf(isServe)(
@@ -59,7 +83,6 @@ if (!isBuild) {
'[vite] hot updated: /hmr/parent.jsx',
'Parent rendered',
],
true,
)
await untilUpdated(() => page.textContent('#parent'), 'Updated')
})
@@ -86,7 +109,6 @@ if (!isBuild) {
'[vite] hot updated: /context/ContextButton.jsx',
'Parent rendered',
],
true,
)
await untilUpdated(
() => page.textContent('#context-provider'),
2 changes: 1 addition & 1 deletion playground/ssr-react/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.4"
"react-router-dom": "^6.6.1"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*",
Loading