Skip to content

fix(deps): update react monorepo to v19 (major) #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions playground/class-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "workspace:*"
}
}
4 changes: 2 additions & 2 deletions playground/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"devDependencies": {
"@babel/plugin-transform-react-jsx-development": "^7.25.9",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "workspace:*",
"babel-plugin-react-compiler": "0.0.0-experimental-dc8bd44-20241121",
"typescript": "^5.8.3"
Expand Down
8 changes: 4 additions & 4 deletions playground/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@mdx-js/rollup": "^3.1.0",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "workspace:*"
}
}
20 changes: 5 additions & 15 deletions playground/react-classic/__tests__/react.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from 'vitest'
import { editFile, isServe, page, untilUpdated } from '~utils'
import { editFile, isServe, page, untilUpdated, viteTestUrl } from '~utils'

test('should render', async () => {
expect(await page.textContent('h1')).toMatch('Hello Vite + React')
Expand All @@ -21,19 +21,9 @@ test.runIf(isServe)('should hmr', async () => {
test.runIf(isServe)(
'should have annotated jsx with file location metadata',
async () => {
const meta = await page.evaluate(() => {
const button = document.querySelector('button')
const key = Object.keys(button).find(
(key) => key.indexOf('__reactFiber') === 0,
)
return button[key]._debugSource
})
// If the evaluate call doesn't crash, and the returned metadata has
// the expected fields, we're good.
expect(Object.keys(meta).sort()).toEqual([
'columnNumber',
'fileName',
'lineNumber',
])
const res = await page.request.get(viteTestUrl + '/App.jsx')
const code = await res.text()
expect(code).toMatch(/lineNumber:\s*\d+/)
expect(code).toMatch(/columnNumber:\s*\d+/)
Comment on lines -24 to +27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this code does not work with React 19 (facebook/react#28265), I changed the test to check the transformed code instead.

},
)
4 changes: 2 additions & 2 deletions playground/react-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions playground/react-emotion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-switch": "^7.1.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions playground/react-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions playground/react-sourcemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*"
Expand Down
19 changes: 5 additions & 14 deletions playground/react/__tests__/react.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
page,
untilBrowserLogAfter,
untilUpdated,
viteTestUrl,
} from '~utils'

test('should render', async () => {
Expand Down Expand Up @@ -53,20 +54,10 @@ test.runIf(isServe)('should not invalidate when code is invalid', async () => {
test.runIf(isServe)(
'should have annotated jsx with file location metadata',
async () => {
const meta = await page.evaluate(() => {
const button = document.querySelector('#state-button')
const key = Object.keys(button).find(
(key) => key.indexOf('__reactFiber') === 0,
)
return button[key]._debugSource
})
// If the evaluate call doesn't crash, and the returned metadata has
// the expected fields, we're good.
expect(Object.keys(meta).sort()).toEqual([
'columnNumber',
'fileName',
'lineNumber',
])
const res = await page.request.get(viteTestUrl + '/App.jsx')
const code = await res.text()
expect(code).toMatch(/lineNumber:\s*\d+/)
expect(code).toMatch(/columnNumber:\s*\d+/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with above.

},
)

Expand Down
4 changes: 2 additions & 2 deletions playground/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
},
"dependencies": {
"jsx-entry": "file:./jsx-entry",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions playground/ssr-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*"
Expand Down
Loading
Loading