Flow upgrade to 0.188

ghstack-source-id: 5c359b97cc
Pull Request resolved: https://github.com/facebook/react/pull/25423
This commit is contained in:
Jan Kassens 2022-10-04 15:39:26 -04:00
parent 3b6826ed9e
commit 9813edef29
17 changed files with 24 additions and 6 deletions

View File

@ -63,7 +63,7 @@
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "1.2.0",
"filesize": "^6.0.1",
"flow-bin": "^0.185.0",
"flow-bin": "^0.188.0",
"glob": "^7.1.6",
"glob-stream": "^6.1.0",
"google-closure-compiler": "^20200517.0.0",

View File

@ -173,6 +173,7 @@ export function launchEditor(
// There's an existing editor process already and it's attached
// to the terminal, so go kill it. Otherwise two separate editor
// instances attach to the stdin/stdout which gets confusing.
// $FlowFixMe[incompatible-use] found when upgrading Flow
childProcess.kill('SIGKILL');
}

View File

@ -121,6 +121,7 @@ export function describeNativeComponentFrame(
} catch (x) {
control = x;
}
// $FlowFixMe[prop-missing] found when upgrading Flow
fn.call(Fake.prototype);
}
} else {

View File

@ -18,6 +18,7 @@ function wrapWithHoc(Component, index) {
// $FlowFixMe
const displayName = Component.displayName || Component.name;
// $FlowFixMe[incompatible-type] found when upgrading Flow
HOC.displayName = `withHoc${index}(${displayName})`;
return HOC;
}

View File

@ -109,6 +109,7 @@ function wrapWithHoc(Component) {
}
// $FlowFixMe
const displayName = Component.displayName || Component.name;
// $FlowFixMe[incompatible-type] found when upgrading Flow
Hoc.displayName = `withHoc(${displayName})`;
return Hoc;
}

View File

@ -81,6 +81,7 @@ function createSyntheticEvent(Interface: EventInterfaceType) {
return this;
}
// $FlowFixMe[prop-missing] found when upgrading Flow
assign(SyntheticBaseEvent.prototype, {
preventDefault: function() {
this.defaultPrevented = true;

View File

@ -94,6 +94,7 @@ function ReactDOMRoot(internalRoot: FiberRoot) {
this._internalRoot = internalRoot;
}
// $FlowFixMe[prop-missing] found when upgrading Flow
ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(
children: ReactNodeList,
): void {
@ -139,6 +140,7 @@ ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = functio
updateContainer(children, root, null, null);
};
// $FlowFixMe[prop-missing] found when upgrading Flow
ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function(): void {
if (__DEV__) {
if (typeof arguments[0] === 'function') {
@ -260,6 +262,7 @@ function scheduleHydration(target: Node) {
queueExplicitHydrationTarget(target);
}
}
// $FlowFixMe[prop-missing] found when upgrading Flow
ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration;
export function hydrateRoot(

View File

@ -77,6 +77,7 @@ export function Pool(options: mixed) {
type NestedMap = Map<any, Record | NestedMap>;
// $FlowFixMe[prop-missing] found when upgrading Flow
Pool.prototype.query = function(query: string, values?: Array<mixed>) {
const pool = this.pool;
const outerMap = unstable_getCacheForType(this.createRecordMap);

View File

@ -1237,6 +1237,7 @@ function abortRootTransitions(
transitionInstance.pendingBoundaries !== null &&
transitionInstance.pendingBoundaries.has(deletedOffscreenInstance)
) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
transitionInstance.pendingBoundaries.delete(
deletedOffscreenInstance,
);

View File

@ -1237,6 +1237,7 @@ function abortRootTransitions(
transitionInstance.pendingBoundaries !== null &&
transitionInstance.pendingBoundaries.has(deletedOffscreenInstance)
) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
transitionInstance.pendingBoundaries.delete(
deletedOffscreenInstance,
);

View File

@ -1944,6 +1944,7 @@ function mountEvent<Args, Return, F: (...Array<Args>) => Return>(
"A function wrapped in useEvent can't be called during rendering.",
);
}
// $FlowFixMe[prop-missing] found when upgrading Flow
return eventFn._impl.apply(undefined, arguments);
};
eventFn._impl = callback;

View File

@ -1944,6 +1944,7 @@ function mountEvent<Args, Return, F: (...Array<Args>) => Return>(
"A function wrapped in useEvent can't be called during rendering.",
);
}
// $FlowFixMe[prop-missing] found when upgrading Flow
return eventFn._impl.apply(undefined, arguments);
};
eventFn._impl = callback;

View File

@ -1425,6 +1425,7 @@ function markRootSuspended(root, suspendedLanes) {
suspendedLanes,
workInProgressRootInterleavedUpdatedLanes,
);
// $FlowFixMe[incompatible-call] found when upgrading Flow
markRootSuspended_dontCallThisOneDirectly(root, suspendedLanes);
}
@ -2066,6 +2067,7 @@ function workLoopConcurrent() {
}
while (workInProgress !== null && !shouldYield()) {
// $FlowFixMe[incompatible-call] found when upgrading Flow
performUnitOfWork(workInProgress);
}
}

View File

@ -1425,6 +1425,7 @@ function markRootSuspended(root, suspendedLanes) {
suspendedLanes,
workInProgressRootInterleavedUpdatedLanes,
);
// $FlowFixMe[incompatible-call] found when upgrading Flow
markRootSuspended_dontCallThisOneDirectly(root, suspendedLanes);
}
@ -2066,6 +2067,7 @@ function workLoopConcurrent() {
}
while (workInProgress !== null && !shouldYield()) {
// $FlowFixMe[incompatible-call] found when upgrading Flow
performUnitOfWork(workInProgress);
}
}

View File

@ -123,6 +123,7 @@ export function describeNativeComponentFrame(
} catch (x) {
control = x;
}
// $FlowFixMe[prop-missing] found when upgrading Flow
fn.call(Fake.prototype);
}
} else {

View File

@ -48,4 +48,4 @@ munge_underscores=false
%REACT_RENDERER_FLOW_OPTIONS%
[version]
^0.185.0
^0.188.0

View File

@ -7912,10 +7912,10 @@ flatted@^2.0.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
flow-bin@^0.185.0:
version "0.185.2"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.185.2.tgz#b45a07d45cf641198e86e47848e35f64b0688c4c"
integrity sha512-Vphs8Z4Qo17dzlPKe/l8M85JvGn1Tf5NV6xESZLg8p9ktdIbNUYaxnq/WBQPoESiLrGdrC2v+rfezfh3tvxkvQ==
flow-bin@^0.188.0:
version "0.188.1"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.188.1.tgz#1043ec955eec8cd402ec9fb4c49054bf14368c06"
integrity sha512-tQehbFoeXKz/MZqEClBB2ezuT1HHKoBlv6t8mAoUdFk1PaFhqcEmjx+1Bn0xygykrqHy0FY6C3z+AGleOnFbdQ==
fluent-syntax@0.13.0:
version "0.13.0"