Skip to content

Commit 0207d97

Browse files
committed
Update Flow to 0.265
1 parent d910086 commit 0207d97

File tree

8 files changed

+22
-176
lines changed

8 files changed

+22
-176
lines changed

flow-typed/environments/node.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3236,7 +3236,7 @@ declare module 'util' {
32363236
declare class TextDecoder {
32373237
constructor(
32383238
encoding?: string,
3239-
options: {
3239+
options?: {
32403240
fatal?: boolean,
32413241
ignoreBOM?: boolean,
32423242
...
@@ -3253,8 +3253,12 @@ declare module 'util' {
32533253

32543254
declare class TextEncoder {
32553255
constructor(): void;
3256-
encode(input?: string): Uint8Array;
3257-
encoding: string;
3256+
encode(input: string): Uint8Array;
3257+
encodeInto(
3258+
input: string,
3259+
buffer: Uint8Array
3260+
): {written: number, read: number};
3261+
encoding: 'utf-8';
32583262
}
32593263

32603264
declare var types: {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
7575
"fbjs-scripts": "^3.0.1",
7676
"filesize": "^6.0.1",
77-
"flow-bin": "^0.264",
78-
"flow-remove-types": "^2.264",
77+
"flow-bin": "^0.265",
78+
"flow-remove-types": "^2.265",
7979
"flow-typed": "^4.1.1",
8080
"glob": "^7.1.6",
8181
"glob-stream": "^6.1.0",

packages/internal-test-utils/enqueueTask.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const {MessageChannel} = require('node:worker_threads');
1111

1212
export default function enqueueTask(task: () => void): void {
1313
const channel = new MessageChannel();
14+
// $FlowFixMe[prop-missing]
1415
channel.port1.onmessage = () => {
1516
channel.port1.close();
1617
task();

packages/react-devtools-shared/src/backend/profilingHooks.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export function createProfilingHooks({
278278

279279
const top = currentReactMeasuresStack.pop();
280280
// $FlowFixMe[incompatible-type]
281+
// $FlowFixMe[incompatible-use]
281282
if (top.type !== type) {
282283
console.error(
283284
'Unexpected type "%s" completed at %sms before "%s" completed.',

packages/react-reconciler/src/ReactFiberPerformanceTrack.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,6 @@ export function logTransitionStart(
712712
const color = eventIsRepeat ? 'secondary-light' : 'warning';
713713
if (__DEV__ && debugTask) {
714714
debugTask.run(
715-
// $FlowFixMe[method-unbinding]
716715
console.timeStamp.bind(
717716
console,
718717
eventIsRepeat ? '' : 'Event: ' + eventType,

packages/react-refresh/src/ReactFreshRuntime.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,10 @@ export function isLikelyComponentType(type: any): boolean {
671671
// This looks like a class.
672672
return false;
673673
}
674-
// eslint-disable-next-line no-proto
675-
if (type.prototype.__proto__ !== Object.prototype) {
674+
if (
675+
// $FlowFixMe[prop-missing]
676+
type.prototype.__proto__ !== Object.prototype // eslint-disable-line no-proto
677+
) {
676678
// It has a superclass.
677679
return false;
678680
}

scripts/flow/environment.js

Lines changed: 2 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -17,83 +17,17 @@ declare const __REACT_DEVTOOLS_GLOBAL_HOOK__: any; /*?{
1717
inject: ?((stuff: Object) => void)
1818
};*/
1919

20-
declare const globalThis: Object;
21-
22-
declare const queueMicrotask: (fn: Function) => void;
2320
declare const reportError: (error: mixed) => void;
24-
declare const AggregateError: Class<Error>;
25-
26-
declare const FinalizationRegistry: any;
2721

2822
declare module 'create-react-class' {
2923
declare const exports: $FlowFixMe;
3024
}
3125

32-
declare module 'error-stack-parser' {
33-
// flow-typed signature: 132e48034ef4756600e1d98681a166b5
34-
// flow-typed version: c6154227d1/error-stack-parser_v2.x.x/flow_>=v0.104.x
35-
36-
declare interface StackFrame {
37-
constructor(object: StackFrame): StackFrame;
38-
39-
isConstructor?: boolean;
40-
getIsConstructor(): boolean;
41-
setIsConstructor(): void;
42-
43-
isEval?: boolean;
44-
getIsEval(): boolean;
45-
setIsEval(): void;
46-
47-
isNative?: boolean;
48-
getIsNative(): boolean;
49-
setIsNative(): void;
50-
51-
isTopLevel?: boolean;
52-
getIsTopLevel(): boolean;
53-
setIsTopLevel(): void;
54-
55-
columnNumber?: number;
56-
getColumnNumber(): number;
57-
setColumnNumber(): void;
58-
59-
lineNumber?: number;
60-
getLineNumber(): number;
61-
setLineNumber(): void;
62-
63-
fileName?: string;
64-
getFileName(): string;
65-
setFileName(): void;
66-
67-
functionName?: string;
68-
getFunctionName(): string;
69-
setFunctionName(): void;
70-
71-
source?: string;
72-
getSource(): string;
73-
setSource(): void;
74-
75-
args?: any[];
76-
getArgs(): any[];
77-
setArgs(): void;
78-
79-
evalOrigin?: StackFrame;
80-
getEvalOrigin(): StackFrame;
81-
setEvalOrigin(): void;
82-
83-
toString(): string;
84-
}
85-
86-
declare class ErrorStackParser {
87-
parse(error: Error): Array<StackFrame>;
88-
}
89-
90-
declare module.exports: ErrorStackParser;
91-
}
92-
9326
declare interface ConsoleTask {
9427
run<T>(f: () => T): T;
9528
}
9629

30+
// $FlowFixMe[libdef-override]
9731
declare var console: {
9832
assert(condition: mixed, ...data: Array<any>): void,
9933
clear(): void,
@@ -148,7 +82,7 @@ declare class ScrollTimeline extends AnimationTimeline {
14882

14983
// Flow hides the props of React$Element, this overrides it to unhide
15084
// them for React internals.
151-
// prettier-ignore
85+
// $FlowFixMe[libdef-override]
15286
declare opaque type React$Element<
15387
+ElementType: React$ElementType,
15488
+P = React$ElementProps<ElementType>,
@@ -227,100 +161,12 @@ declare var parcelRequire: {
227161
},
228162
};
229163

230-
declare module 'fs/promises' {
231-
declare const access: (path: string, mode?: number) => Promise<void>;
232-
declare const lstat: (
233-
path: string,
234-
options?: ?{bigint?: boolean},
235-
) => Promise<mixed>;
236-
declare const readdir: (
237-
path: string,
238-
options?:
239-
| ?string
240-
| {
241-
encoding?: ?string,
242-
withFileTypes?: ?boolean,
243-
},
244-
) => Promise<Buffer>;
245-
declare const readFile: (
246-
path: string,
247-
options?:
248-
| ?string
249-
| {
250-
encoding?: ?string,
251-
},
252-
) => Promise<Buffer>;
253-
declare const readlink: (
254-
path: string,
255-
options?:
256-
| ?string
257-
| {
258-
encoding?: ?string,
259-
},
260-
) => Promise<mixed>;
261-
declare const realpath: (
262-
path: string,
263-
options?:
264-
| ?string
265-
| {
266-
encoding?: ?string,
267-
},
268-
) => Promise<mixed>;
269-
declare const stat: (
270-
path: string,
271-
options?: ?{bigint?: boolean},
272-
) => Promise<mixed>;
273-
}
274164
declare module 'pg' {
275165
declare const Pool: (options: mixed) => {
276166
query: (query: string, values?: Array<mixed>) => void,
277167
};
278168
}
279169

280-
declare module 'util' {
281-
declare function debuglog(section: string): (data: any, ...args: any) => void;
282-
declare function format(format: string, ...placeholders: any): string;
283-
declare function log(string: string): void;
284-
declare function inspect(object: any, options?: util$InspectOptions): string;
285-
declare function isArray(object: any): boolean;
286-
declare function isRegExp(object: any): boolean;
287-
declare function isDate(object: any): boolean;
288-
declare function isError(object: any): boolean;
289-
declare function inherits(
290-
constructor: Function,
291-
superConstructor: Function,
292-
): void;
293-
declare function deprecate(f: Function, string: string): Function;
294-
declare function promisify(f: Function): Function;
295-
declare function callbackify(f: Function): Function;
296-
declare class TextDecoder {
297-
constructor(
298-
encoding?: string,
299-
options?: {
300-
fatal?: boolean,
301-
ignoreBOM?: boolean,
302-
...
303-
},
304-
): void;
305-
decode(
306-
input?: ArrayBuffer | DataView | $TypedArray,
307-
options?: {stream?: boolean, ...},
308-
): string;
309-
encoding: string;
310-
fatal: boolean;
311-
ignoreBOM: boolean;
312-
}
313-
declare class TextEncoder {
314-
constructor(encoding?: string): TextEncoder;
315-
encode(buffer: string): Uint8Array;
316-
encodeInto(
317-
buffer: string,
318-
dest: Uint8Array,
319-
): {read: number, written: number};
320-
encoding: string;
321-
}
322-
}
323-
324170
declare module 'busboy' {
325171
import type {Writable, Readable} from 'stream';
326172

@@ -456,13 +302,6 @@ declare const async_hooks: {
456302
executionAsyncId(): number,
457303
};
458304

459-
declare module 'node:worker_threads' {
460-
declare class MessageChannel {
461-
port1: MessagePort;
462-
port2: MessagePort;
463-
}
464-
}
465-
466305
declare module 'jest-diff' {
467306
declare type CompareKeys = ((a: string, b: string) => number) | void;
468307
declare type DiffOptions = {

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9298,12 +9298,12 @@ flatted@^3.2.9:
92989298
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a"
92999299
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==
93009300

9301-
flow-bin@^0.264:
9302-
version "0.264.0"
9303-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.264.0.tgz#783d3062fbc6792be38a914c6e5b1639482fe3e2"
9304-
integrity sha512-9sEmxu7TuV2ZXOwSBwa3rPVxA0rMuxzBkzZVZ7Elmu8f4HzC7/+6E2yq/zya+AGLDyIxzZNP38fbXRiBYkUD2Q==
9301+
flow-bin@^0.265:
9302+
version "0.265.3"
9303+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.265.3.tgz#cbaad2115f4622e34920981dc79949824c27f421"
9304+
integrity sha512-08PjO2kjuQxy8MxYJNCzmgRpAe1uqTf7kQ+U32QTavRzTD/7IJASYKFEEvCkVNHlhSy8CTJsN+AQdHsXVqChIw==
93059305

9306-
flow-remove-types@^2.264:
9306+
flow-remove-types@^2.265:
93079307
version "2.279.0"
93089308
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.279.0.tgz#3a3388d9158eba0f82c40d80d31d9640b883a3f5"
93099309
integrity sha512-bPFloMR/A2b/r/sIsf7Ix0LaMicCJNjwhXc4xEEQVzJCIz5u7C7XDaEOXOiqveKlCYK7DcBNn6R01Cbbc9gsYA==

0 commit comments

Comments
 (0)