-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Make React 19 the default version for development #12177
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
861f867
Upgrade types. Make react 19 default and alias React 18
jerelmiller cd1e537
Update jest config with swap of default react version
jerelmiller c7b9764
Fix reference to createFactory
jerelmiller fa5a2ed
Install prop-types types package
jerelmiller 3ab5ea3
Use type inference in test
jerelmiller 7156052
Use expect-error and type inference in mutation hoc
jerelmiller 7b0693a
Update testing library libraries to support React 19
jerelmiller 1fb3383
Pass arg to useRef
jerelmiller 707de38
Add expect error to renderHookAsync
jerelmiller e86d014
Swap testing library patch to 16.1.0
jerelmiller 60fd22a
Add shim for react-dom/client for React 17
jerelmiller 562f157
Clean up Prettier, Size-limit, and Api-Extractor
jerelmiller 782ed67
Fix type error in getDataFromTree
jerelmiller 554b45f
bump `@testing-library/react-render-stream` to 2.0.0
phryneas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"dist/apollo-client.min.cjs": 41613, | ||
"dist/apollo-client.min.cjs": 41615, | ||
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 34349 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Shim for React 17 react-dom/client entrypoint imported by React Testing | ||
// Library | ||
|
||
module.exports = { | ||
hydrateRoot: () => { | ||
throw new Error( | ||
"Cannot use hydrateRoot with React 17. Ensure this uses legacy root instead" | ||
); | ||
}, | ||
createRoot: () => { | ||
throw new Error( | ||
"Cannot use createRoot with React 17. Ensure this uses legacy root instead" | ||
); | ||
}, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Turns out that
react-dom/client
was imported by RTL in our v17 tests which actually used the v18 import. When upgrading to v19, that import no longer works, presumably because its using the React 19react-dom/client
file, but with React 17 core.This shim adds an entrypoint for
react-dom/client
that doesn't exist in 17 to satisfy the import path and avoid using the React 19 version. We throw to ensure thelegacyRoot
option is set in the tests though, which should be covered by the patch.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.
Very good call!