Skip to content

Commit

Permalink
Upgrade flow to 0.235.0
Browse files Browse the repository at this point in the history
See [Flow changelog](https://github.com/facebook/flow/blob/main/Changelog.md) for changes in this version.
  • Loading branch information
kassens committed Jun 27, 2024
1 parent 4548674 commit f0a5768
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-client/src/ReactClientConsoleConfigBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions packages/react-client/src/ReactClientConsoleConfigPlain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions packages/react-client/src/ReactClientConsoleConfigServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
1 change: 1 addition & 0 deletions packages/react-debug-tools/src/ReactDebugHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-shared/src/backend/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand All @@ -110,6 +111,7 @@ export function dangerous_setTargetConsoleForTesting(

targetConsoleMethods = ({}: {[string]: $FlowFixMe});
for (const method in targetConsole) {
// $FlowFixMe[invalid-computed-prop]
targetConsoleMethods[method] = console[method];
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-shared/src/backend/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3386,6 +3386,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] = () => {};
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-shared/src/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand All @@ -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];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions packages/react-dom-bindings/src/events/getListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6071,6 +6071,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(
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/ReactChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function escape(key: string): string {
':': '=2',
};
const escapedString = key.replace(escapeRegex, function (match) {
// $FlowFixMe[invalid-computed-prop]
return escaperLookup[match];
});

Expand Down
1 change: 1 addition & 0 deletions packages/shared/enqueueTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8320,12 +8320,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==
Expand Down

0 comments on commit f0a5768

Please sign in to comment.