-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
React 18 Upgrade #7142
React 18 Upgrade #7142
Conversation
5c8f5ad
to
86bf2d0
Compare
Remove deprecated ReactDOM methods from demo-appBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Replace deprecated ReactDOM methods for docs-appBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
8f5a62b
to
c4dfcaf
Compare
Replace deprecated ReactDOM methods for docs-appBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Replace ResizeHandle with React.JSX.Element in resizableTestBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
1b22e7d
to
4811d90
Compare
Replace ResizeHandle with React.JSX.Element in resizableTestBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Disable ReactDOM API lint deprecations in contextMenuSingletonBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
(temp) Skip failing tests to check for stability/test flakeBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
(temp) Skip more tests that are now failing in CIBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Ignore deprecated ReactDOM methods in OverlayToasterBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Skip additional test flakeBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Skip flaky testsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
@@ -2,8 +2,10 @@ | |||
* Copyright 2017 Palantir Technologies, Inc. All rights reserved. | |||
*/ | |||
|
|||
import ReactEighteenAdapter from "@cfaester/enzyme-adapter-react-18"; |
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.
https://github.com/cfaester/enzyme-adapter-react-18
"A very unofficial adapter for React 18 for Enzyme."
Very unofficial, but it at least gets us moving forward until we can replace Enzyme.
const toasterRenderRoot = containerElement.firstElementChild; | ||
if (toasterRenderRoot == null) { | ||
throw new Error("No elements were found under Toaster container."); | ||
} | ||
ReactDOM.unmountComponentAtNode(toasterRenderRoot); | ||
const root = ReactDOM.createRoot(toasterRenderRoot); |
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.
I believe this calls ReactDOM.createRoot
on a DOM node that previously had a react root created on it, which leaks memory. The old root never gets unmounted.
The OverlayToaster.createAsync
call above doesn't seem to override the domRenderer
field. I think the React root that was previously created on toasterRenderRoot
is actually a React 17 legacy root. Without changes to how createAsync
is called above, I think ReactDOM.unmountComponentAtNode
is most correct here?
To fully remove unmountComponentAtNode
, there would need to be a change to the createAsync
call to create a React root, store a reference to it in the example here, and then call unmount in the cleanup effect.
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.
Ah, yup, good catch! I'll split this out, ignore the deprecated ReactDOM lint errors, and track this in #7166
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.
Ignore deprecated ReactDOM method in toastCreateAsyncExampleBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Update return types for Icon and SVGIconContainerBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Fixes the following lint error on `TestUtils.act`: ``` The signature '(callback: () => VoidOrUndefinedOnly): void' of 'TestUtils.act' is deprecated. ```
207f906
to
c56e0ca
Compare
Ignore deprecated ReactDOM method in toastCreateAsyncExampleBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Skip tests that pass locallyBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Skip tests that pass locallyBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
This feature branch PR serves as the central hub for upgrading Blueprint's documentation and internal dependencies to React 18. The initial changes in this PR involve updating dependencies relevant to the React 18 upgrade. Subsequent changes will be made in separate PRs that will be be merged into
develop
and rebased into this feature branch.Tracking progress in the list below:
Fixes type, lint, and compile breaks:
defaultProps
with destructuring in function components #7145Patch upcoming React 18 SFC compile breaks in [email protected] #7146Fixes/skips test breaks
Related issues: