-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix: Resolve warning using the wrong react-dom entrypoint #1018
Conversation
66d031d
to
c2bd65d
Compare
c2bd65d
to
8dd83cb
Compare
8dd83cb
to
f8e434f
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f8e434f:
|
Codecov Report
@@ Coverage Diff @@
## alpha #1018 +/- ##
===========================================
+ Coverage 90.51% 100.00% +9.48%
===========================================
Files 4 4
Lines 232 169 -63
Branches 49 35 -14
===========================================
- Hits 210 169 -41
+ Misses 20 0 -20
+ Partials 2 0 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
"rimraf": "^3.0.2", | ||
"typescript": "^4.1.2" | ||
}, | ||
"peerDependencies": { | ||
"react": "*", | ||
"react-dom": "*" | ||
"react": "18.0.0-rc.1", |
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.
Caret range would match 18.0.0-rc.0-next
which is definitely not what we want.
Will widen to ^18.0.0
once React 18 lands.
Well... for now. Later there will be features or bugfixes added on top of this release series. I'd lean towards adding an alternate entry point or flag. |
I'm ok with this on the condition that:
So basically: "Do whatever you want to with |
This comment was marked as spam.
This comment was marked as spam.
Definitely. The alpha branch will not land until after
Sure thing. React Testing Library is pretty mature. Last year was basically just type fixes (partially self inflicted pain) and JSDOC improvements. The actual features are all located in But overall I don't feel that bad about the change anymore considering we can drop 500 LoC.
Let's make this a "may" not a "will". We haven't released a fix or feature in over a year. All we've done in the past 1-2 years is bumping The whole idea of these renderer specific library is that they don't have many features. The bulk of the features is implemented in the host specific libraries ( I'm going to check how separate entrypoints will look. But if React 18 lands tomorrow I prefer this approach in which we can always add suport for legacy React later. |
@eps1lon, you and I are aligned 👍 |
This comment was marked as spam.
This comment was marked as spam.
Hm so branching for legacy and non-legacy root seems really heavy. We either have to copy 90% or create additional abstractions. This all seems like a maintenance nightmare. The current testing approach is already quite sketchy because we have to merge results to find missing coverage. At the same time this PR makes testing a lot more straight forward while removing a whooping 400 LoC. So I'd rather get this PR in and wait for feedback. And if we feel like supporting older versions it's probably easier to create two release lines. |
That sounds fine to me 👍 I have no problem telling people they can continue using what has been a very stable version of the software if they can't upgrade to v18 yet (when it's released of course). |
Ok let's try this in |
🎉 This PR is included in version 13.0.0-alpha.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
BREAKING CHANGE: Older versions of React (< 18.0.0-rc.1) are no longer supported.
Working group post: reactwg/react-18#125
Tested on mui/material-ui@
45e47e0
(#31263): https://app.circleci.com/pipelines/github/mui/material-ui/65789/workflows/b001664a-2d8f-4f70-b80b-f7366b2d11bfWhat:
Use new client entrypoint of react-dom. We would need a separate entry point if we would want to support older versions of React.
Why:
Avoids warnings when using
createRoot
fromreact-dom
The current alpha of React Testing Library doesn't contain any new features compared to the current stable other than support for React 18. So the only reason to upgrade is if you want to use React 18 at which point we might as well drop support for older version.
How:
Only access
createRoot
andhydrateRoot
fromreact-dom/client
Checklist:
[ ]Documentation added to thedocs site
[ ]TypeScript definitions updated