mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Upgrade flow to 0.235.0 (#30118)
See [Flow changelog](https://github.com/facebook/flow/blob/main/Changelog.md) for changes in this version.
This commit is contained in:
parent
094041495b
commit
21129d34a5
|
|
@ -63,8 +63,8 @@
|
|||
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
|
||||
"fbjs-scripts": "^3.0.1",
|
||||
"filesize": "^6.0.1",
|
||||
"flow-bin": "^0.234.0",
|
||||
"flow-remove-types": "^2.234.0",
|
||||
"flow-bin": "^0.235.0",
|
||||
"flow-remove-types": "^2.235.0",
|
||||
"glob": "^7.1.6",
|
||||
"glob-stream": "^6.1.0",
|
||||
"google-closure-compiler": "^20230206.0.0",
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ export function printToConsole(
|
|||
} else if (methodName === 'warn') {
|
||||
warn.apply(console, newArgs);
|
||||
} else {
|
||||
// eslint-disable-next-line react-internal/no-production-logging
|
||||
console[methodName].apply(console, newArgs);
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
console[methodName].apply(console, newArgs); // eslint-disable-line react-internal/no-production-logging
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export function printToConsole(
|
|||
} else if (methodName === 'warn') {
|
||||
warn.apply(console, newArgs);
|
||||
} else {
|
||||
// eslint-disable-next-line react-internal/no-production-logging
|
||||
console[methodName].apply(console, newArgs);
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
console[methodName].apply(console, newArgs); // eslint-disable-line react-internal/no-production-logging
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export function printToConsole(
|
|||
} else if (methodName === 'warn') {
|
||||
warn.apply(console, newArgs);
|
||||
} else {
|
||||
// eslint-disable-next-line react-internal/no-production-logging
|
||||
console[methodName].apply(console, newArgs);
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
console[methodName].apply(console, newArgs); // eslint-disable-line react-internal/no-production-logging
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -774,6 +774,7 @@ const Dispatcher: DispatcherType = {
|
|||
const DispatcherProxyHandler = {
|
||||
get(target: DispatcherType, prop: string) {
|
||||
if (target.hasOwnProperty(prop)) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
return target[prop];
|
||||
}
|
||||
const error = new Error('Missing method in Dispatcher: ' + prop);
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ const injectedRenderers: Map<
|
|||
let targetConsole: Object = console;
|
||||
let targetConsoleMethods: {[string]: $FlowFixMe} = {};
|
||||
for (const method in console) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
targetConsoleMethods[method] = console[method];
|
||||
}
|
||||
|
||||
|
|
@ -110,6 +111,7 @@ export function dangerous_setTargetConsoleForTesting(
|
|||
|
||||
targetConsoleMethods = ({}: {[string]: $FlowFixMe});
|
||||
for (const method in targetConsole) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
targetConsoleMethods[method] = console[method];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3391,6 +3391,7 @@ export function attach(
|
|||
// Temporarily disable all console logging before re-running the hook.
|
||||
for (const method in console) {
|
||||
try {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
originalConsoleMethods[method] = console[method];
|
||||
// $FlowFixMe[prop-missing]
|
||||
console[method] = () => {};
|
||||
|
|
|
|||
2
packages/react-devtools-shared/src/hook.js
vendored
2
packages/react-devtools-shared/src/hook.js
vendored
|
|
@ -32,6 +32,7 @@ export function installHook(target: any): DevToolsHook | null {
|
|||
let targetConsole: Object = console;
|
||||
let targetConsoleMethods: {[string]: $FlowFixMe} = {};
|
||||
for (const method in console) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
targetConsoleMethods[method] = console[method];
|
||||
}
|
||||
|
||||
|
|
@ -42,6 +43,7 @@ export function installHook(target: any): DevToolsHook | null {
|
|||
|
||||
targetConsoleMethods = ({}: {[string]: $FlowFixMe});
|
||||
for (const method in targetConsole) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
targetConsoleMethods[method] = console[method];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ const tagToRoleMappings = {
|
|||
};
|
||||
|
||||
function getImplicitRole(element: Element): string | null {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
const mappedByTag = tagToRoleMappings[element.tagName];
|
||||
if (mappedByTag !== undefined) {
|
||||
return mappedByTag;
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ export function setValueForPropertyOnCustomComponent(
|
|||
const eventName = name.slice(2, useCapture ? name.length - 7 : undefined);
|
||||
|
||||
const prevProps = getFiberCurrentPropsFromNode(node);
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
const prevValue = prevProps != null ? prevProps[name] : null;
|
||||
if (typeof prevValue === 'function') {
|
||||
node.removeEventListener(eventName, prevValue, useCapture);
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ export default function getListener(
|
|||
// Work in progress.
|
||||
return null;
|
||||
}
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
const listener = props[registrationName];
|
||||
if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -238,6 +238,7 @@ function trimOptions<
|
|||
let hasProperties = false;
|
||||
const trimmed: T = ({}: any);
|
||||
for (const key in options) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
if (options[key] != null) {
|
||||
hasProperties = true;
|
||||
(trimmed: any)[key] = options[key];
|
||||
|
|
|
|||
|
|
@ -6073,6 +6073,7 @@ function getPreloadAsHeader(
|
|||
let value = `<${escapedHref}>; rel=preload; as="${escapedAs}"`;
|
||||
for (const paramName in params) {
|
||||
if (hasOwnProperty.call(params, paramName)) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
const paramValue = params[paramName];
|
||||
if (typeof paramValue === 'string') {
|
||||
value += `; ${paramName.toLowerCase()}="${escapeStringForLinkHeaderQuotedParamValueContext(
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ function publishEventForPlugin(
|
|||
if (phasedRegistrationNames) {
|
||||
for (const phaseName in phasedRegistrationNames) {
|
||||
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
const phasedRegistrationName = phasedRegistrationNames[phaseName];
|
||||
publishRegistrationName(
|
||||
phasedRegistrationName,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ function escape(key: string): string {
|
|||
':': '=2',
|
||||
};
|
||||
const escapedString = key.replace(escapeRegex, function (match) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
return escaperLookup[match];
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export default function enqueueTask(task: () => void): void {
|
|||
// read require off the module object to get around the bundlers.
|
||||
// we don't want them to detect a require and bundle a Node polyfill.
|
||||
const requireString = ('require' + Math.random()).slice(0, 7);
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
const nodeRequire = module && module[requireString];
|
||||
// assuming we're in node, let's try to get node's
|
||||
// version of setImmediate, bypassing fake timers if any.
|
||||
|
|
|
|||
10
yarn.lock
10
yarn.lock
|
|
@ -8321,12 +8321,12 @@ flatted@^3.2.9:
|
|||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a"
|
||||
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==
|
||||
|
||||
flow-bin@^0.234.0:
|
||||
version "0.234.0"
|
||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.234.0.tgz#17dfc5aac1d928b6d7194f93bd0bf742d735c77d"
|
||||
integrity sha512-uLmvfFRW6yEcz2wSJ2H6192RwknBpzAHBezDcXzmxJASxB6QzjKadhPxZvsJ74uJ+9Th1hDNuRB4mGrVUeneyA==
|
||||
flow-bin@^0.235.0:
|
||||
version "0.235.1"
|
||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.235.1.tgz#7dfca9c480bb7cb83fa3caca58386e9beca09bc3"
|
||||
integrity sha512-SuXw5NQDIdSBMg/NgvS5mzdI6dPEYWubnucnYno9wWLd6xoK1nkH6t2Dn2GsML9bIoVqp3E/ni1jo18A4G4FrQ==
|
||||
|
||||
flow-remove-types@^2.234.0:
|
||||
flow-remove-types@^2.235.0:
|
||||
version "2.238.2"
|
||||
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.238.2.tgz#85c9d26e83ba395f0206a23bce438223bc035609"
|
||||
integrity sha512-WJXRomjPiZ34nG14y7AceoPxg1L00FxjPSA3TDBTG2OPt8QFNtiYEmO4/3WG58n3C4wjxyVuoE6KjxQIvCDyjw==
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user