Skip to content

Commit

Permalink
chore: upgrade playground deps (#8587)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Jun 15, 2022
1 parent 4e6c26f commit 6234bcd
Show file tree
Hide file tree
Showing 22 changed files with 144 additions and 443 deletions.
2 changes: 0 additions & 2 deletions .github/renovate.json5
Expand Up @@ -19,8 +19,6 @@
"typescript",

// breaking changes
"react-router", // `react-router:v6.0.0+` has breaking changes
"react-router-dom", // `react-router-dom:v6.0.0+` has breaking changes
"source-map", // `source-map:v0.7.0+` needs more investigation
"dotenv-expand", // `dotenv-expand:6.0.0+` has breaking changes (#6858)
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
Expand Down
2 changes: 1 addition & 1 deletion playground/backend-integration/package.json
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"tailwindcss": "^2.2.19"
"tailwindcss": "^3.1.2"
},
"devDependencies": {
"fast-glob": "^3.2.11"
Expand Down
4 changes: 1 addition & 3 deletions playground/backend-integration/tailwind.config.js
@@ -1,7 +1,5 @@
module.exports = {
mode: 'jit',
purge: [__dirname + '/frontend/**/*.{css,html,ts,js}'],
darkMode: false, // or 'media' or 'class'
content: [__dirname + '/frontend/**/*.{css,html,ts,js}'],
theme: {
extend: {}
},
Expand Down
6 changes: 4 additions & 2 deletions playground/file-delete-restore/index.html
@@ -1,8 +1,10 @@
<div id="app"></div>
<script type="module">
import React from 'react'
import ReactDOM from 'react-dom'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'

ReactDOM.render(React.createElement(App), document.getElementById('app'))
ReactDOM.createRoot(document.getElementById('app')).render(
React.createElement(App)
)
</script>
4 changes: 2 additions & 2 deletions playground/file-delete-restore/package.json
Expand Up @@ -9,8 +9,8 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.1.0",
"react-dom": "^18.1.0"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*"
Expand Down
7 changes: 3 additions & 4 deletions playground/optimize-deps/cjs-dynamic.js
Expand Up @@ -4,7 +4,7 @@
;(async () => {
const { useState } = await import('react')
const React = (await import('react')).default
const ReactDOM = await import('react-dom')
const ReactDOM = await import('react-dom/client')

const clip = await import('clipboard')
if (typeof clip.default === 'function') {
Expand Down Expand Up @@ -42,9 +42,8 @@
)
}

ReactDOM.render(
React.createElement(App),
document.querySelector('.cjs-dynamic')
ReactDOM.createRoot(document.querySelector('.cjs-dynamic')).render(
React.createElement(App)
)

function text(el, text) {
Expand Down
6 changes: 4 additions & 2 deletions playground/optimize-deps/cjs.js
Expand Up @@ -2,7 +2,7 @@
// React is the ultimate test of this because its dynamic exports assignments
// are not statically detectable by @rollup/plugin-commonjs.
import React, { useState } from 'react'
import ReactDOM from 'react-dom'
import ReactDOM from 'react-dom/client'
import { Socket } from 'phoenix'
import clip from 'clipboard'

Expand All @@ -28,7 +28,9 @@ function App() {
)
}

ReactDOM.render(React.createElement(App), document.querySelector('.cjs'))
ReactDOM.createRoot(document.querySelector('.cjs')).render(
React.createElement(App)
)

function text(el, text) {
document.querySelector(el).textContent = text
Expand Down
6 changes: 4 additions & 2 deletions playground/optimize-deps/dedupe.js
@@ -1,5 +1,5 @@
import React from 'react'
import ReactDOM from 'react-dom'
import ReactDOM from 'react-dom/client'

// #1302: The linked package has a different version of React in its deps
// and is itself optimized. Without `dedupe`, the linked package is optimized
Expand All @@ -20,4 +20,6 @@ function App() {
)
}

ReactDOM.render(React.createElement(App), document.querySelector('.dedupe'))
ReactDOM.createRoot(document.querySelector('.dedupe')).render(
React.createElement(App)
)
2 changes: 1 addition & 1 deletion playground/optimize-deps/dep-linked-include/package.json
Expand Up @@ -4,6 +4,6 @@
"version": "0.0.0",
"main": "index.mjs",
"dependencies": {
"react": "17.0.2"
"react": "18.1.0"
}
}
4 changes: 2 additions & 2 deletions playground/optimize-deps/package.json
Expand Up @@ -26,8 +26,8 @@
"lodash-es": "^4.17.21",
"nested-exclude": "file:./nested-exclude",
"phoenix": "^1.6.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"resolve-linked": "workspace:0.0.0",
"url": "^0.11.0",
"vue": "^3.2.37",
Expand Down
6 changes: 4 additions & 2 deletions playground/react-emotion/index.html
@@ -1,8 +1,10 @@
<div id="app"></div>
<script type="module">
import React from 'react'
import ReactDOM from 'react-dom'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'

ReactDOM.render(React.createElement(App), document.getElementById('app'))
ReactDOM.createRoot(document.getElementById('app')).render(
React.createElement(App)
)
</script>
6 changes: 3 additions & 3 deletions playground/react-emotion/package.json
Expand Up @@ -10,9 +10,9 @@
},
"dependencies": {
"@emotion/react": "^11.9.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-switch": "^6.1.0"
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-switch": "^7.0.0"
},
"devDependencies": {
"@babel/plugin-proposal-pipeline-operator": "^7.18.2",
Expand Down
6 changes: 4 additions & 2 deletions playground/react/index.html
@@ -1,8 +1,10 @@
<div id="app"></div>
<script type="module">
import React from 'react'
import ReactDOM from 'react-dom'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'

ReactDOM.render(React.createElement(App), document.getElementById('app'))
ReactDOM.createRoot(document.getElementById('app')).render(
React.createElement(App)
)
</script>
4 changes: 2 additions & 2 deletions playground/react/package.json
Expand Up @@ -10,8 +10,8 @@
},
"dependencies": {
"jsx-entry": "file:./jsx-entry",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.1.0",
"react-dom": "^18.1.0"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*"
Expand Down
7 changes: 3 additions & 4 deletions playground/ssr-react/package.json
Expand Up @@ -13,10 +13,9 @@
"debug": "node --inspect-brk server"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router": "^5.3.3",
"react-router-dom": "^5.3.3"
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0"
},
"devDependencies": {
"@vitejs/plugin-react": "workspace:*",
Expand Down
12 changes: 4 additions & 8 deletions playground/ssr-react/src/App.jsx
@@ -1,4 +1,4 @@
import { Link, Route, Switch } from 'react-router-dom'
import { Link, Route, Routes } from 'react-router-dom'

// Auto generates routes from files under ./pages
// https://vitejs.dev/guide/features.html#glob-import
Expand Down Expand Up @@ -27,15 +27,11 @@ export function App() {
})}
</ul>
</nav>
<Switch>
<Routes>
{routes.map(({ path, component: RouteComp }) => {
return (
<Route key={path} path={path}>
<RouteComp />
</Route>
)
return <Route key={path} path={path} element={<RouteComp />}></Route>
})}
</Switch>
</Routes>
</>
)
}
8 changes: 4 additions & 4 deletions playground/ssr-react/src/entry-client.jsx
@@ -1,10 +1,10 @@
import ReactDOM from 'react-dom'
import ReactDOM from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'
import { App } from './App'

ReactDOM.hydrate(
ReactDOM.hydrateRoot(
document.getElementById('app'),
<BrowserRouter>
<App />
</BrowserRouter>,
document.getElementById('app')
</BrowserRouter>
)
2 changes: 1 addition & 1 deletion playground/ssr-react/src/entry-server.jsx
@@ -1,5 +1,5 @@
import ReactDOMServer from 'react-dom/server'
import { StaticRouter } from 'react-router-dom'
import { StaticRouter } from 'react-router-dom/server'
import { App } from './App'

export function render(url, context) {
Expand Down
2 changes: 1 addition & 1 deletion playground/ssr-webworker/package.json
Expand Up @@ -8,7 +8,7 @@
"build:worker": "vite build --ssr src/entry-worker.jsx --outDir dist/worker"
},
"dependencies": {
"react": "^17.0.2"
"react": "^18.1.0"
},
"devDependencies": {
"miniflare": "^1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion playground/tailwind/package.json
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"autoprefixer": "^10.4.7",
"tailwindcss": "^2.2.19",
"tailwindcss": "^3.1.2",
"vue": "^3.2.37",
"vue-router": "^4.0.16"
},
Expand Down
4 changes: 1 addition & 3 deletions playground/tailwind/tailwind.config.js
@@ -1,12 +1,10 @@
module.exports = {
mode: 'jit',
purge: [
content: [
// Before editing this section, make sure no paths are matching with `/src/App.vue`
// Look https://github.com/vitejs/vite/pull/6959 for more details
__dirname + '/src/{components,views}/**/*.vue',
__dirname + '/src/App.vue'
],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {}
},
Expand Down

0 comments on commit 6234bcd

Please sign in to comment.