Skip to content

Commit

Permalink
React19: Update packages
Browse files Browse the repository at this point in the history
React19: Fix build by extracting const in a separate file

The build did not like that we imported the useMapParam file inside the middleware even though we only picked the mapParamFallback const from it. Moving the const to a separate file resolved the issue.

Update to react 19-rc

Following https://react.dev/blog/2024/04/25/react-19-upgrade-guide

And https://nextjs.org/blog/next-15-rc#react-compiler-experimental

React19: Update "Removed deprecated TypeScript types"

`npx types-react-codemod@latest preset-19 ./`

https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-deprecated-typescript-types

And then fix the useRef type to add `undefined`

Update next, react packages to latest RC version

`npm install next@canary babel-plugin-react-compiler react@rc react-dom@rc types-react@rc types-react-dom@rc`

Update to `@headlessui/react@insiders` to test React 19 fix

Update to `@headlessui/react@insiders` to test React 19 fix; And update everything else as well

`npm install @headlessui/react@insiders next@canary babel-plugin-react-compiler react@rc react-dom@rc types-react@rc types-react-dom@rc`

Update RC packages

`npm install next@canary babel-plugin-react-compiler@latest react@rc react-dom@rc types-react@rc types-react-dom@rc nuqs@latest @headlessui/react@insiders`

Update packages nuqs:2, other packages

`npm install next@canary babel-plugin-react-compiler@latest react@rc react-dom@rc types-react@rc types-react-dom@rc @headlessui/react@insiders`
`npm i [email protected]`

Update "bleach" commands

Update packages 2024-08-05: `npm install next@canary babel-plugin-react-compiler@latest react@rc react-dom@rc types-react@rc types-react-dom@rc @headlessui/react@insiders [email protected]`
  • Loading branch information
tordans committed Aug 5, 2024
1 parent eafccd1 commit 34ae557
Show file tree
Hide file tree
Showing 10 changed files with 652 additions and 1,420 deletions.
2 changes: 2 additions & 0 deletions app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = withBlitz(
// See also: https://github.com/facebook/react/issues/29130
reactStrictMode: true,
experimental: {
// https://react.dev/learn/react-compiler#usage-with-nextjs
reactCompiler: true,
// https://nextjs.org/docs/app/building-your-application/configuring/typescript#statically-typed-links
typedRoutes: true,
instrumentationHook: true,
Expand Down
Loading

0 comments on commit 34ae557

Please sign in to comment.