-
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
base: develop
Are you sure you want to change the base?
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. |
14906bd
to
a91ab83
Compare
Fixes the following lint error on `TestUtils.act`: ``` The signature '(callback: () => VoidOrUndefinedOnly): void' of 'TestUtils.act' is deprecated. ```
a91ab83
to
84c1c4e
Compare
Skip failing tests resulting from React 18 upgradeBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
@@ -1098,7 +1097,7 @@ describe("<NumericInput>", () => { | |||
incrementButton.simulate("mousedown", { shiftKey: true }); | |||
expect(component.find("input").prop("value")).to.equal("1.101"); | |||
|
|||
TestUtils.act(() => { |
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.
Fixes a deprecation in React 18. Act is now exported from React as of v18.3.1
.
https://react.dev/warnings/react-dom-test-utils#reactdomtestutilsact-warning
act from react-dom/test-utils has been deprecated in favor of act from react.
@@ -101,7 +101,7 @@ export interface DefaultIconProps extends IntentProps, Props, DefaultSVGIconProp | |||
* @see https://stackoverflow.com/a/73795494/7406866 | |||
*/ | |||
export interface IconComponent extends React.FC<IconProps<Element>> { | |||
<T extends Element = Element>(props: IconProps<T>): React.ReactElement | null; |
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.
Attempted to cherry-pick this type change into develop, but unfortunately encountered errors. This type fix is valid in React 18, but fails with React 16 types.
See type failures on branch based off of develop: https://github.com/palantir/blueprint/compare/gdouglas/test-Icon-compile-break
@@ -42,7 +42,7 @@ export type SVGIconContainerProps<T extends Element> = Omit<SVGIconProps<T>, "ch | |||
* @see https://stackoverflow.com/a/73795494/7406866 | |||
*/ | |||
export interface SVGIconContainerComponent extends React.FC<SVGIconContainerProps<Element>> { | |||
<T extends Element = Element>(props: SVGIconContainerProps<T>): React.ReactElement | null; |
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.
Similar to type compile issue with Icon, this fix compiles in React 18, but not 16.
See: https://github.com/palantir/blueprint/compare/gdouglas/test-SVGIconContainer-compile-break
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 #7145Fixes/skips test breaks
Related issues: