Upgrade to Flow 0.196.3 (#25974)
After the previous changes these upgrade are easy. - removes config options that were removed - object index access now requires an indexer key in the type, this cause a handful of errors that were fixed - undefined keys error in all places, this needed a few extra suppressions for repeated undefined identifiers. Flow's [CHANGELOG.md](https://github.com/facebook/flow/blob/main/Changelog.md).
This commit is contained in:
parent
e2424f33b3
commit
34464fb16c
|
@ -61,7 +61,7 @@
|
||||||
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
|
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
|
||||||
"fbjs-scripts": "1.2.0",
|
"fbjs-scripts": "1.2.0",
|
||||||
"filesize": "^6.0.1",
|
"filesize": "^6.0.1",
|
||||||
"flow-bin": "^0.190.0",
|
"flow-bin": "^0.196.3",
|
||||||
"flow-remove-types": "^2.196.1",
|
"flow-remove-types": "^2.196.1",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"glob-stream": "^6.1.0",
|
"glob-stream": "^6.1.0",
|
||||||
|
|
|
@ -3271,6 +3271,7 @@ export function attach(
|
||||||
for (const method in console) {
|
for (const method in console) {
|
||||||
try {
|
try {
|
||||||
originalConsoleMethods[method] = console[method];
|
originalConsoleMethods[method] = console[method];
|
||||||
|
// $FlowFixMe[prop-missing]
|
||||||
console[method] = () => {};
|
console[method] = () => {};
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
}
|
}
|
||||||
|
@ -3285,6 +3286,7 @@ export function attach(
|
||||||
// Restore original console functionality.
|
// Restore original console functionality.
|
||||||
for (const method in originalConsoleMethods) {
|
for (const method in originalConsoleMethods) {
|
||||||
try {
|
try {
|
||||||
|
// $FlowFixMe[prop-missing]
|
||||||
console[method] = originalConsoleMethods[method];
|
console[method] = originalConsoleMethods[method];
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,6 +248,7 @@ export function dehydrate(
|
||||||
// Other types (e.g. typed arrays, Sets) will not spread correctly.
|
// Other types (e.g. typed arrays, Sets) will not spread correctly.
|
||||||
Array.from(data).forEach(
|
Array.from(data).forEach(
|
||||||
(item, i) =>
|
(item, i) =>
|
||||||
|
// $FlowFixMe[prop-missing] Unserializable doesn't have an index signature
|
||||||
(unserializableValue[i] = dehydrate(
|
(unserializableValue[i] = dehydrate(
|
||||||
item,
|
item,
|
||||||
cleaned,
|
cleaned,
|
||||||
|
|
|
@ -11,6 +11,7 @@ function ignoreStrings(
|
||||||
methodName: string,
|
methodName: string,
|
||||||
stringsToIgnore: Array<string>,
|
stringsToIgnore: Array<string>,
|
||||||
): void {
|
): void {
|
||||||
|
// $FlowFixMe[prop-missing] index access only allowed for objects with index keys
|
||||||
console[methodName] = (...args) => {
|
console[methodName] = (...args) => {
|
||||||
const maybeString = args[0];
|
const maybeString = args[0];
|
||||||
if (typeof maybeString === 'string') {
|
if (typeof maybeString === 'string') {
|
||||||
|
|
|
@ -23,9 +23,10 @@ export function isLegacyActEnvironment(fiber: Fiber): boolean {
|
||||||
// to false.
|
// to false.
|
||||||
|
|
||||||
const isReactActEnvironmentGlobal =
|
const isReactActEnvironmentGlobal =
|
||||||
// $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
|
// $FlowFixMe[cannot-resolve-name] Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
|
||||||
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
|
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
|
||||||
? IS_REACT_ACT_ENVIRONMENT
|
? // $FlowFixMe[cannot-resolve-name]
|
||||||
|
IS_REACT_ACT_ENVIRONMENT
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
// $FlowFixMe - Flow doesn't know about jest
|
// $FlowFixMe - Flow doesn't know about jest
|
||||||
|
@ -40,8 +41,10 @@ export function isLegacyActEnvironment(fiber: Fiber): boolean {
|
||||||
export function isConcurrentActEnvironment(): void | boolean {
|
export function isConcurrentActEnvironment(): void | boolean {
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
const isReactActEnvironmentGlobal =
|
const isReactActEnvironmentGlobal =
|
||||||
|
// $FlowFixMe[cannot-resolve-name] Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
|
||||||
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
|
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
|
||||||
? IS_REACT_ACT_ENVIRONMENT
|
? // $FlowFixMe[cannot-resolve-name]
|
||||||
|
IS_REACT_ACT_ENVIRONMENT
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
|
if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ export const MountPassiveDev = /* */ 0b100000000000000000000000000;
|
||||||
// Groups of flags that are used in the commit phase to skip over trees that
|
// Groups of flags that are used in the commit phase to skip over trees that
|
||||||
// don't contain effects, by checking subtreeFlags.
|
// don't contain effects, by checking subtreeFlags.
|
||||||
|
|
||||||
export const BeforeMutationMask =
|
export const BeforeMutationMask: number =
|
||||||
// TODO: Remove Update flag from before mutation phase by re-landing Visibility
|
// TODO: Remove Update flag from before mutation phase by re-landing Visibility
|
||||||
// flag logic (see #20043)
|
// flag logic (see #20043)
|
||||||
Update |
|
Update |
|
||||||
|
|
|
@ -43,11 +43,9 @@ untyped-type-import=error
|
||||||
%CI_MAX_WORKERS%
|
%CI_MAX_WORKERS%
|
||||||
exact_by_default=true
|
exact_by_default=true
|
||||||
munge_underscores=false
|
munge_underscores=false
|
||||||
enforce_local_inference_annotations=true
|
|
||||||
exact_empty_objects=true
|
|
||||||
|
|
||||||
# Substituted by createFlowConfig.js:
|
# Substituted by createFlowConfig.js:
|
||||||
%REACT_RENDERER_FLOW_OPTIONS%
|
%REACT_RENDERER_FLOW_OPTIONS%
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
^0.190.0
|
^0.196.3
|
||||||
|
|
|
@ -7915,10 +7915,10 @@ flatted@^3.1.0:
|
||||||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
|
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
|
||||||
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
|
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
|
||||||
|
|
||||||
flow-bin@^0.190.0:
|
flow-bin@^0.196.3:
|
||||||
version "0.190.0"
|
version "0.196.3"
|
||||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.190.0.tgz#cfc50e1474facf8150232a6c498fe66a6bb75969"
|
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.196.3.tgz#b6df48986a2629f2c6a26fb79d73fc07c8056af0"
|
||||||
integrity sha512-Qo3bvN3cmGFXsq63ZxcHFZXQDvgx84fCuq8cXuKk5xbvuebBGwMqS+ku/rH+gEkciRrcTYrXqoSzb9b6ShcoJg==
|
integrity sha512-pmvjlksi1CvkSnDHpcfhDFj/KC3hwSgE2OpzvugW57dfgqfHzqX1UfZIcScGWM5AmP/IeOsQCW383k3zIbEnrA==
|
||||||
|
|
||||||
flow-parser@^0.196.1:
|
flow-parser@^0.196.1:
|
||||||
version "0.196.1"
|
version "0.196.1"
|
||||||
|
|
Loading…
Reference in New Issue