Skip to content

Commit

Permalink
MBS-13716: Upgrade React to v19 RC
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
mwiencek committed Jul 30, 2024
1 parent 189264b commit e833f5e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 122 deletions.
Original file line number Diff line number Diff line change
@@ -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' {
/**
Expand Down Expand Up @@ -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<any, any>
): null | Element | Text;

declare function render<ElementType: React.ElementType>(
element: React.Element<ElementType>,
container: Element,
callback?: () => void
): React.ElementRef<ElementType>;

declare function hydrate<ElementType: React.ElementType>(
element: React.Element<ElementType>,
container: Element,
callback?: () => void
): React.ElementRef<ElementType>;

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<A, B, C, D, E>(
Expand Down Expand Up @@ -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<any>
): React$Component<any, any>;

declare function mockComponent(
componentClass: React.ElementType,
mockTagName?: string
): { [key: string]: mixed, ... };

declare function isElement(element: React.Element<any>): boolean;

declare function isElementOfType(
element: React.Element<any>,
componentClass: React.ElementType
): boolean;

declare function isDOMComponent(instance: any): boolean;

declare function isCompositeComponent(
instance: React$Component<any, any>
): boolean;

declare function isCompositeComponentWithType(
instance: React$Component<any, any>,
componentClass: React.ElementType
): boolean;

declare function findAllInRenderedTree(
tree: React$Component<any, any>,
test: (child: React$Component<any, any>) => boolean
): Array<React$Component<any, any>>;

declare function scryRenderedDOMComponentsWithClass(
tree: React$Component<any, any>,
className: string
): Array<Element>;

declare function findRenderedDOMComponentWithClass(
tree: React$Component<any, any>,
className: string
): ?Element;

declare function scryRenderedDOMComponentsWithTag(
tree: React$Component<any, any>,
tagName: string
): Array<Element>;

declare function findRenderedDOMComponentWithTag(
tree: React$Component<any, any>,
tagName: string
): ?Element;

declare function scryRenderedComponentsWithType(
tree: React$Component<any, any>,
componentClass: React.ElementType
): Array<React$Component<any, any>>;

declare function findRenderedComponentWithType(
tree: React$Component<any, any>,
componentClass: React.ElementType
): ?React$Component<any, any>;

declare function act(callback: () => void | Thenable): Thenable;
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
39 changes: 17 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e833f5e

Please sign in to comment.