From e833f5e5469b8bd5d70a4bffac3f3e7f0399bc1d Mon Sep 17 00:00:00 2001 From: Michael Wiencek Date: Fri, 19 Jul 2024 22:26:34 -0500 Subject: [PATCH] MBS-13716: Upgrade React to v19 RC https://react.dev/blog/2024/04/25/react-19 https://react.dev/blog/2024/04/25/react-19-upgrade-guide It seems that a new version of the react-dom libdefs have not been published to flow-typed yet. I simply moved the existing v18 file and removed all removed functions. I didn't add any of the new functions (we don't use them yet). --- ...ct-dom_v18.x.x.js => react-dom_v19.x.x.js} | 99 +------------------ package.json | 4 +- yarn.lock | 39 ++++---- 3 files changed, 20 insertions(+), 122 deletions(-) rename flow-typed/npm/{react-dom_v18.x.x.js => react-dom_v19.x.x.js} (67%) diff --git a/flow-typed/npm/react-dom_v18.x.x.js b/flow-typed/npm/react-dom_v19.x.x.js similarity index 67% rename from flow-typed/npm/react-dom_v18.x.x.js rename to flow-typed/npm/react-dom_v19.x.x.js index cd8f2aa7b1a..c634d94a339 100644 --- a/flow-typed/npm/react-dom_v18.x.x.js +++ b/flow-typed/npm/react-dom_v19.x.x.js @@ -1,5 +1,4 @@ -// flow-typed signature: bd8a9984746306d26194a489f3aeff35 -// flow-typed version: 388e9edcf0/react-dom_v18.x.x/flow_>=v0.127.x +// @flow strict declare module 'react-dom_shared-types' { /** @@ -107,29 +106,11 @@ declare module 'react-dom_shared-types' { declare module 'react-dom' { declare var version: string; - declare function findDOMNode( - componentOrElement: Element | ?React$Component - ): null | Element | Text; - - declare function render( - element: React.Element, - container: Element, - callback?: () => void - ): React.ElementRef; - - declare function hydrate( - element: React.Element, - container: Element, - callback?: () => void - ): React.ElementRef; - declare function createPortal( node: React.Node, container: Element ): React$Portal; - declare function unmountComponentAtNode(container: any): boolean; - declare function flushSync(callback: () => mixed): void; declare function unstable_batchedUpdates( @@ -214,81 +195,3 @@ declare module 'react-dom/server' { element: React.Node ): stream$Readable; } - -declare module 'react-dom/test-utils' { - declare interface Thenable { - then(resolve: () => mixed, reject?: () => mixed): mixed, - } - - declare var Simulate: { - [eventName: string]: ( - element: Element, - eventData?: { [key: string]: mixed, ... } - ) => void, - ... - }; - - declare function renderIntoDocument( - instance: React.Element - ): React$Component; - - declare function mockComponent( - componentClass: React.ElementType, - mockTagName?: string - ): { [key: string]: mixed, ... }; - - declare function isElement(element: React.Element): boolean; - - declare function isElementOfType( - element: React.Element, - componentClass: React.ElementType - ): boolean; - - declare function isDOMComponent(instance: any): boolean; - - declare function isCompositeComponent( - instance: React$Component - ): boolean; - - declare function isCompositeComponentWithType( - instance: React$Component, - componentClass: React.ElementType - ): boolean; - - declare function findAllInRenderedTree( - tree: React$Component, - test: (child: React$Component) => boolean - ): Array>; - - declare function scryRenderedDOMComponentsWithClass( - tree: React$Component, - className: string - ): Array; - - declare function findRenderedDOMComponentWithClass( - tree: React$Component, - className: string - ): ?Element; - - declare function scryRenderedDOMComponentsWithTag( - tree: React$Component, - tagName: string - ): Array; - - declare function findRenderedDOMComponentWithTag( - tree: React$Component, - tagName: string - ): ?Element; - - declare function scryRenderedComponentsWithType( - tree: React$Component, - componentClass: React.ElementType - ): Array>; - - declare function findRenderedComponentWithType( - tree: React$Component, - componentClass: React.ElementType - ): ?React$Component; - - declare function act(callback: () => void | Thenable): Thenable; -} diff --git a/package.json b/package.json index 6070199836b..698247780d7 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,8 @@ "pg-cursor": "2.10.5", "po2json": "https://github.com/metabrainz/po2json.git#905dd32b286c80b973ca3c7c27f31d0ef1f4e65b", "punycode": "2.3.1", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "19.0.0-rc-ab7c1663-20240730", + "react-dom": "19.0.0-rc-ab7c1663-20240730", "react-table": "7.8.0", "redux": "4.2.0", "shell-quote": "1.8.1", diff --git a/yarn.lock b/yarn.lock index 8518823232f..dbf57497c46 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5982,7 +5982,7 @@ __metadata: languageName: node linkType: hard -"loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": +"loose-envify@npm:^1.4.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" dependencies: @@ -6368,8 +6368,8 @@ __metadata: po2json: "https://github.com/metabrainz/po2json.git#905dd32b286c80b973ca3c7c27f31d0ef1f4e65b" process: "npm:0.11.10" punycode: "npm:2.3.1" - react: "npm:18.3.1" - react-dom: "npm:18.3.1" + react: "npm:19.0.0-rc-ab7c1663-20240730" + react-dom: "npm:19.0.0-rc-ab7c1663-20240730" react-is: "npm:18.3.1" react-table: "npm:7.8.0" redux: "npm:4.2.0" @@ -7278,15 +7278,14 @@ __metadata: languageName: node linkType: hard -"react-dom@npm:18.3.1": - version: 18.3.1 - resolution: "react-dom@npm:18.3.1" +"react-dom@npm:19.0.0-rc-ab7c1663-20240730": + version: 19.0.0-rc-ab7c1663-20240730 + resolution: "react-dom@npm:19.0.0-rc-ab7c1663-20240730" dependencies: - loose-envify: "npm:^1.1.0" - scheduler: "npm:^0.23.2" + scheduler: "npm:0.25.0-rc-ab7c1663-20240730" peerDependencies: - react: ^18.3.1 - checksum: 10c0/a752496c1941f958f2e8ac56239172296fcddce1365ce45222d04a1947e0cc5547df3e8447f855a81d6d39f008d7c32eab43db3712077f09e3f67c4874973e85 + react: 19.0.0-rc-ab7c1663-20240730 + checksum: 10c0/1b13ffa7d8ddf6840cb23032fc2314da670bc26376360db7b9bff87c850529374d0b8d5ff929f75e324469143981cc924c2233eb351ede7ddd631d9ab399e20e languageName: node linkType: hard @@ -7313,12 +7312,10 @@ __metadata: languageName: node linkType: hard -"react@npm:18.3.1": - version: 18.3.1 - resolution: "react@npm:18.3.1" - dependencies: - loose-envify: "npm:^1.1.0" - checksum: 10c0/283e8c5efcf37802c9d1ce767f302dd569dd97a70d9bb8c7be79a789b9902451e0d16334b05d73299b20f048cbc3c7d288bbbde10b701fa194e2089c237dbea3 +"react@npm:19.0.0-rc-ab7c1663-20240730": + version: 19.0.0-rc-ab7c1663-20240730 + resolution: "react@npm:19.0.0-rc-ab7c1663-20240730" + checksum: 10c0/69b397f4886e3a4273c2ade4cb231b088b58c57a03f8abe624178695f0b044f665f45fc70874e35440a81e1239844618a704857489b4f9ff4439470f668b850b languageName: node linkType: hard @@ -7835,12 +7832,10 @@ __metadata: languageName: node linkType: hard -"scheduler@npm:^0.23.2": - version: 0.23.2 - resolution: "scheduler@npm:0.23.2" - dependencies: - loose-envify: "npm:^1.1.0" - checksum: 10c0/26383305e249651d4c58e6705d5f8425f153211aef95f15161c151f7b8de885f24751b377e4a0b3dd42cce09aad3f87a61dab7636859c0d89b7daf1a1e2a5c78 +"scheduler@npm:0.25.0-rc-ab7c1663-20240730": + version: 0.25.0-rc-ab7c1663-20240730 + resolution: "scheduler@npm:0.25.0-rc-ab7c1663-20240730" + checksum: 10c0/39c907199babb7f5526152cffad66a6411b6afbf2aabcaa157a0a7419ba8db3638d39b17aed7b35cc3dee0b7ef94648f59ab5fa3c6ea0d802e82e5b51f5a70bf languageName: node linkType: hard