-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(react): Upgrade to React 18 #4992
Conversation
✅ Deploy Preview for redwoodjs-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@virtuoushub one important, helpful thing you could do in the OP is list the Redwood deps we need to have React 18 support before upgrading with link to open Issue if applicable. fwiw |
reopening, in case someone is interested in helping. |
e6bed51
to
e3d58c4
Compare
b0b0b72
to
9e0f18b
Compare
f57d861
to
49746aa
Compare
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 665037c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
✅ Successfully ran 9 targetsSent with 💌 from NxCloud. |
a4a5fc9
to
0b069da
Compare
Wouldn't this be an opportunity to upgrade to chakra 2? https://github.com/redwoodjs/redwood/tree/main/packages/cli/src/commands/setup/ui/libraries/chakra-ui.js#L31 |
Yes, although that upgrade will most likely happen in a different PR. Will add a note that it is a known dependency and that people interested in using it are waiting on this. |
# Conflicts: # __fixtures__/test-project/api/db/migrations/20220101120000_create_post_user/migration.sql # __fixtures__/test-project/api/db/migrations/20220102120000_create_contact/migration.sql # __fixtures__/test-project/api/db/migrations/20230114191659_create_post_user/migration.sql # __fixtures__/test-project/api/db/migrations/20230114191819_create_contact/migration.sql # __fixtures__/test-project/api/db/migrations/20230118153725_create_post_user/migration.sql # __fixtures__/test-project/api/db/migrations/20230118153843_create_contact/migration.sql # __fixtures__/test-project/api/package.json # __fixtures__/test-project/api/src/services/posts/posts.scenarios.ts # __fixtures__/test-project/api/src/services/users/users.scenarios.ts # __fixtures__/test-project/web/package.json # package.json # packages/auth-providers/auth0/web/package.json # packages/auth-providers/azureActiveDirectory/web/package.json # packages/auth-providers/clerk/web/package.json # packages/auth-providers/dbAuth/web/package.json # packages/auth-providers/firebase/web/package.json # packages/auth-providers/netlify/web/package.json # packages/auth-providers/supabase/web/package.json # packages/auth-providers/supertokens/web/package.json # packages/auth/package.json # packages/forms/package.json # packages/router/package.json # packages/testing/package.json # packages/web/package.json # yarn.lock
…chore/upgrade-to-react-18
"react": "18.2.0", | ||
"react-dom": "18.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of feels like we shouldn't be pinning these in the CRWA template; let me see what that involves.
we need to use expect for waitFor to do its thing, see https://testing-library.com/docs/dom-testing-library/api-async/#waitfor
> Version 2 of Chakra UI is only compatible with React 18. If you are still needing to use React 17 or earlier, please use version 1 of Chakra UI. see also: - https://chakra-ui.com/getting-started - redwoodjs#4992 (comment) - redwoodjs#5614
> Version 2 of Chakra UI is only compatible with React 18. If you are still needing to use React 17 or earlier, please use version 1 of Chakra UI. see also: - https://chakra-ui.com/getting-started - redwoodjs#4992 (comment) - redwoodjs#5614
> Version 2 of Chakra UI is only compatible with React 18. If you are still needing to use React 17 or earlier, please use version 1 of Chakra UI. see also: - https://chakra-ui.com/getting-started - redwoodjs#4992 (comment) - redwoodjs#5614
* chore(deps): bump Chakra UI to V2 > Version 2 of Chakra UI is only compatible with React 18. If you are still needing to use React 17 or earlier, please use version 1 of Chakra UI. see also: - https://chakra-ui.com/getting-started - #4992 (comment) - #5614 * Update packages/cli/src/commands/setup/ui/libraries/chakra-ui.js Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>
For RW application developers wanting to try out React 18
you don't need to wait for this PR to be merged in or released; to try out React 18 in your Redwood projects ✨right now✨:
web/package.json
to bump React's version to 18: e.g. fix(deps): update react monorepo to v18 (major) example-storybook#12web/src/index.js
: e.g. https://github.com/redwoodjs/example-storybook/pull/144/filesnote: the
example-storybook
project is in JavaScript, so if your project uses TypeScript then you'll also want to bump the relevant React@types/*
dependenciesalso note: React 18 support in Redwood is currently experimental, so please try at your own risk
What was done in this PR
children
prop - https://solverfox.dev/writing/no-implicit-children/unstable_batchedUpdates
@testing-library/react
and removed usage of@testing-library/react-hooks
since the functionality is moving into v13 ( https://github.com/testing-library/react-hooks-testing-library#a-note-about-react-18-support )packages/testing/src/web/customRender.tsx
to account for new downstream dependency's APItsc
build error around TypeScript 'declare' fieldsdocs
React at 17 due to dependency ondocusaurus
which does not yet support 18 (see: Migrate to React 18 facebook/docusaurus#7264)PR Notes
Redwood deps we need to have React 18 support before upgrading
(links to open Issue(s) if applicable)
Redwood deps that require React 18
react-testing-library@13+
( https://github.com/testing-library/react-testing-library/blob/main/package.json#L63-L64 )Redwood deps that are incompatible with React 18
docs
and not the core codeOutstanding Goals (can be separate from this PR if it makes sense)
react@18
usage, what a frictionless upgrade might be, and what a codemod(s?) might look like.Explore how Cells might be updated / redesigned with Suspenseout of scope for this PRSee also: