Update Flow to 0.265 (#34270)

Looks like this version removed `Object.prototype` although I didn't see
that in the changelog. This is fine for this code here.
This commit is contained in:
Jan Kassens 2025-08-22 15:22:22 -04:00 committed by GitHub
parent 425ba0ad6d
commit d260b0d8b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 22 additions and 176 deletions

View File

@ -3236,7 +3236,7 @@ declare module 'util' {
declare class TextDecoder { declare class TextDecoder {
constructor( constructor(
encoding?: string, encoding?: string,
options: { options?: {
fatal?: boolean, fatal?: boolean,
ignoreBOM?: boolean, ignoreBOM?: boolean,
... ...
@ -3253,8 +3253,12 @@ declare module 'util' {
declare class TextEncoder { declare class TextEncoder {
constructor(): void; constructor(): void;
encode(input?: string): Uint8Array; encode(input: string): Uint8Array;
encoding: string; encodeInto(
input: string,
buffer: Uint8Array
): {written: number, read: number};
encoding: 'utf-8';
} }
declare var types: { declare var types: {

View File

@ -74,8 +74,8 @@
"eslint-plugin-react-internal": "link:./scripts/eslint-rules", "eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "^3.0.1", "fbjs-scripts": "^3.0.1",
"filesize": "^6.0.1", "filesize": "^6.0.1",
"flow-bin": "^0.263", "flow-bin": "^0.265",
"flow-remove-types": "^2.263", "flow-remove-types": "^2.265",
"flow-typed": "^4.1.1", "flow-typed": "^4.1.1",
"glob": "^7.1.6", "glob": "^7.1.6",
"glob-stream": "^6.1.0", "glob-stream": "^6.1.0",

View File

@ -11,6 +11,7 @@ const {MessageChannel} = require('node:worker_threads');
export default function enqueueTask(task: () => void): void { export default function enqueueTask(task: () => void): void {
const channel = new MessageChannel(); const channel = new MessageChannel();
// $FlowFixMe[prop-missing]
channel.port1.onmessage = () => { channel.port1.onmessage = () => {
channel.port1.close(); channel.port1.close();
task(); task();

View File

@ -278,6 +278,7 @@ export function createProfilingHooks({
const top = currentReactMeasuresStack.pop(); const top = currentReactMeasuresStack.pop();
// $FlowFixMe[incompatible-type] // $FlowFixMe[incompatible-type]
// $FlowFixMe[incompatible-use]
if (top.type !== type) { if (top.type !== type) {
console.error( console.error(
'Unexpected type "%s" completed at %sms before "%s" completed.', 'Unexpected type "%s" completed at %sms before "%s" completed.',

View File

@ -712,7 +712,6 @@ export function logTransitionStart(
const color = eventIsRepeat ? 'secondary-light' : 'warning'; const color = eventIsRepeat ? 'secondary-light' : 'warning';
if (__DEV__ && debugTask) { if (__DEV__ && debugTask) {
debugTask.run( debugTask.run(
// $FlowFixMe[method-unbinding]
console.timeStamp.bind( console.timeStamp.bind(
console, console,
eventIsRepeat ? '' : 'Event: ' + eventType, eventIsRepeat ? '' : 'Event: ' + eventType,

View File

@ -671,8 +671,10 @@ export function isLikelyComponentType(type: any): boolean {
// This looks like a class. // This looks like a class.
return false; return false;
} }
// eslint-disable-next-line no-proto if (
if (type.prototype.__proto__ !== Object.prototype) { // $FlowFixMe[prop-missing]
type.prototype.__proto__ !== Object.prototype // eslint-disable-line no-proto
) {
// It has a superclass. // It has a superclass.
return false; return false;
} }

View File

@ -17,83 +17,17 @@ declare const __REACT_DEVTOOLS_GLOBAL_HOOK__: any; /*?{
inject: ?((stuff: Object) => void) inject: ?((stuff: Object) => void)
};*/ };*/
declare const globalThis: Object;
declare const queueMicrotask: (fn: Function) => void;
declare const reportError: (error: mixed) => void; declare const reportError: (error: mixed) => void;
declare const AggregateError: Class<Error>;
declare const FinalizationRegistry: any;
declare module 'create-react-class' { declare module 'create-react-class' {
declare const exports: $FlowFixMe; declare const exports: $FlowFixMe;
} }
declare module 'error-stack-parser' {
// flow-typed signature: 132e48034ef4756600e1d98681a166b5
// flow-typed version: c6154227d1/error-stack-parser_v2.x.x/flow_>=v0.104.x
declare interface StackFrame {
constructor(object: StackFrame): StackFrame;
isConstructor?: boolean;
getIsConstructor(): boolean;
setIsConstructor(): void;
isEval?: boolean;
getIsEval(): boolean;
setIsEval(): void;
isNative?: boolean;
getIsNative(): boolean;
setIsNative(): void;
isTopLevel?: boolean;
getIsTopLevel(): boolean;
setIsTopLevel(): void;
columnNumber?: number;
getColumnNumber(): number;
setColumnNumber(): void;
lineNumber?: number;
getLineNumber(): number;
setLineNumber(): void;
fileName?: string;
getFileName(): string;
setFileName(): void;
functionName?: string;
getFunctionName(): string;
setFunctionName(): void;
source?: string;
getSource(): string;
setSource(): void;
args?: any[];
getArgs(): any[];
setArgs(): void;
evalOrigin?: StackFrame;
getEvalOrigin(): StackFrame;
setEvalOrigin(): void;
toString(): string;
}
declare class ErrorStackParser {
parse(error: Error): Array<StackFrame>;
}
declare module.exports: ErrorStackParser;
}
declare interface ConsoleTask { declare interface ConsoleTask {
run<T>(f: () => T): T; run<T>(f: () => T): T;
} }
// $FlowFixMe[libdef-override]
declare var console: { declare var console: {
assert(condition: mixed, ...data: Array<any>): void, assert(condition: mixed, ...data: Array<any>): void,
clear(): void, clear(): void,
@ -148,7 +82,7 @@ declare class ScrollTimeline extends AnimationTimeline {
// Flow hides the props of React$Element, this overrides it to unhide // Flow hides the props of React$Element, this overrides it to unhide
// them for React internals. // them for React internals.
// prettier-ignore // $FlowFixMe[libdef-override]
declare opaque type React$Element< declare opaque type React$Element<
+ElementType: React$ElementType, +ElementType: React$ElementType,
+P = React$ElementProps<ElementType>, +P = React$ElementProps<ElementType>,
@ -227,100 +161,12 @@ declare var parcelRequire: {
}, },
}; };
declare module 'fs/promises' {
declare const access: (path: string, mode?: number) => Promise<void>;
declare const lstat: (
path: string,
options?: ?{bigint?: boolean},
) => Promise<mixed>;
declare const readdir: (
path: string,
options?:
| ?string
| {
encoding?: ?string,
withFileTypes?: ?boolean,
},
) => Promise<Buffer>;
declare const readFile: (
path: string,
options?:
| ?string
| {
encoding?: ?string,
},
) => Promise<Buffer>;
declare const readlink: (
path: string,
options?:
| ?string
| {
encoding?: ?string,
},
) => Promise<mixed>;
declare const realpath: (
path: string,
options?:
| ?string
| {
encoding?: ?string,
},
) => Promise<mixed>;
declare const stat: (
path: string,
options?: ?{bigint?: boolean},
) => Promise<mixed>;
}
declare module 'pg' { declare module 'pg' {
declare const Pool: (options: mixed) => { declare const Pool: (options: mixed) => {
query: (query: string, values?: Array<mixed>) => void, query: (query: string, values?: Array<mixed>) => void,
}; };
} }
declare module 'util' {
declare function debuglog(section: string): (data: any, ...args: any) => void;
declare function format(format: string, ...placeholders: any): string;
declare function log(string: string): void;
declare function inspect(object: any, options?: util$InspectOptions): string;
declare function isArray(object: any): boolean;
declare function isRegExp(object: any): boolean;
declare function isDate(object: any): boolean;
declare function isError(object: any): boolean;
declare function inherits(
constructor: Function,
superConstructor: Function,
): void;
declare function deprecate(f: Function, string: string): Function;
declare function promisify(f: Function): Function;
declare function callbackify(f: Function): Function;
declare class TextDecoder {
constructor(
encoding?: string,
options?: {
fatal?: boolean,
ignoreBOM?: boolean,
...
},
): void;
decode(
input?: ArrayBuffer | DataView | $TypedArray,
options?: {stream?: boolean, ...},
): string;
encoding: string;
fatal: boolean;
ignoreBOM: boolean;
}
declare class TextEncoder {
constructor(encoding?: string): TextEncoder;
encode(buffer: string): Uint8Array;
encodeInto(
buffer: string,
dest: Uint8Array,
): {read: number, written: number};
encoding: string;
}
}
declare module 'busboy' { declare module 'busboy' {
import type {Writable, Readable} from 'stream'; import type {Writable, Readable} from 'stream';
@ -456,13 +302,6 @@ declare const async_hooks: {
executionAsyncId(): number, executionAsyncId(): number,
}; };
declare module 'node:worker_threads' {
declare class MessageChannel {
port1: MessagePort;
port2: MessagePort;
}
}
declare module 'jest-diff' { declare module 'jest-diff' {
declare type CompareKeys = ((a: string, b: string) => number) | void; declare type CompareKeys = ((a: string, b: string) => number) | void;
declare type DiffOptions = { declare type DiffOptions = {

View File

@ -9298,12 +9298,12 @@ flatted@^3.2.9:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a"
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==
flow-bin@^0.263: flow-bin@^0.265:
version "0.263.0" version "0.265.3"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.263.0.tgz#0a836bdf82855d5df9858c781818ce51612be064" resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.265.3.tgz#cbaad2115f4622e34920981dc79949824c27f421"
integrity sha512-FkQywD+7wXru/7/SWJPVnZXUp6CW3XtrVZ26vhAdVfMx9xlwq/Zk/tXcn3OQuiHUA4kQvZNyfgRztp6oXgjsog== integrity sha512-08PjO2kjuQxy8MxYJNCzmgRpAe1uqTf7kQ+U32QTavRzTD/7IJASYKFEEvCkVNHlhSy8CTJsN+AQdHsXVqChIw==
flow-remove-types@^2.263: flow-remove-types@^2.265:
version "2.279.0" version "2.279.0"
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.279.0.tgz#3a3388d9158eba0f82c40d80d31d9640b883a3f5" resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.279.0.tgz#3a3388d9158eba0f82c40d80d31d9640b883a3f5"
integrity sha512-bPFloMR/A2b/r/sIsf7Ix0LaMicCJNjwhXc4xEEQVzJCIz5u7C7XDaEOXOiqveKlCYK7DcBNn6R01Cbbc9gsYA== integrity sha512-bPFloMR/A2b/r/sIsf7Ix0LaMicCJNjwhXc4xEEQVzJCIz5u7C7XDaEOXOiqveKlCYK7DcBNn6R01Cbbc9gsYA==