Skip to content

Commit fda1f0b

Browse files
authored
Flow upgrade to 0.205.1 (facebook#26796)
Just a small upgrade to keep us current and remove unused suppressions (probably fixed by some upgrade since). - `*` is no longer allowed and has been an alias for `any` for a while now.
1 parent 7ac5e9a commit fda1f0b

File tree

21 files changed

+41
-49
lines changed

21 files changed

+41
-49
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
6666
"fbjs-scripts": "^3.0.1",
6767
"filesize": "^6.0.1",
68-
"flow-bin": "^0.202.0",
69-
"flow-remove-types": "^2.202.0",
68+
"flow-bin": "^0.205.1",
69+
"flow-remove-types": "^2.205.1",
7070
"glob": "^7.1.6",
7171
"glob-stream": "^6.1.0",
7272
"google-closure-compiler": "^20230206.0.0",

packages/react-client/src/ReactFlightReplyClient.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ export function processReply(
291291
// Possibly a Date, whose toJSON automatically calls toISOString
292292
// $FlowFixMe[incompatible-use]
293293
const originalValue = parent[key];
294-
// $FlowFixMe[method-unbinding]
295294
if (originalValue instanceof Date) {
296295
return serializeDateFromDateJSON(value);
297296
}

packages/react-devtools-core/src/standalone.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ function onDisconnected() {
167167
disconnectedCallback();
168168
}
169169

170-
// $FlowFixMe[missing-local-annot]
171170
function onError({code, message}: $FlowFixMe) {
172171
safeUnmount();
173172

packages/react-devtools-extensions/flow-typed/jest.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/* eslint-disable no-unused-vars */
1313

14-
type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
14+
type JestMockFn<TArguments: $ReadOnlyArray<any>, TReturn> = {
1515
(...args: TArguments): TReturn,
1616
/**
1717
* An object for introspecting mock calls
@@ -626,7 +626,7 @@ interface JestExpectType {
626626
* Use .toBeInstanceOf(Class) to check that an object is an instance of a
627627
* class.
628628
*/
629-
toBeInstanceOf(cls: Class<*>): void;
629+
toBeInstanceOf(cls: Class<any>): void;
630630
/**
631631
* .toBeNull() is the same as .toBe(null) but the error messages are a bit
632632
* nicer.
@@ -815,7 +815,7 @@ type JestObjectType = {
815815
* Returns a new, unused mock function. Optionally takes a mock
816816
* implementation.
817817
*/
818-
fn<TArguments: $ReadOnlyArray<*>, TReturn>(
818+
fn<TArguments: $ReadOnlyArray<any>, TReturn>(
819819
implementation?: (...args: TArguments) => TReturn
820820
): JestMockFn<TArguments, TReturn>,
821821
/**

packages/react-devtools-extensions/src/backendManager.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {COMPACT_VERSION_NAME} from './utils';
1616

1717
let welcomeHasInitialized = false;
1818

19-
// $FlowFixMe[missing-local-annot]
2019
function welcome(event: $FlowFixMe) {
2120
if (
2221
event.source !== window ||

packages/react-devtools-shared/src/backend/legacy/renderer.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ export function attach(
244244
parentIDStack.pop();
245245
return result;
246246
} catch (err) {
247-
// $FlowFixMe[incompatible-type] found when upgrading Flow
248247
parentIDStack = [];
249248
throw err;
250249
} finally {
@@ -281,7 +280,6 @@ export function attach(
281280
parentIDStack.pop();
282281
return result;
283282
} catch (err) {
284-
// $FlowFixMe[incompatible-type] found when upgrading Flow
285283
parentIDStack = [];
286284
throw err;
287285
} finally {
@@ -318,7 +316,6 @@ export function attach(
318316
parentIDStack.pop();
319317
return result;
320318
} catch (err) {
321-
// $FlowFixMe[incompatible-type] found when upgrading Flow
322319
parentIDStack = [];
323320
throw err;
324321
} finally {
@@ -350,7 +347,6 @@ export function attach(
350347

351348
return result;
352349
} catch (err) {
353-
// $FlowFixMe[incompatible-type] found when upgrading Flow
354350
parentIDStack = [];
355351
throw err;
356352
} finally {

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ let supportsUserTiming =
5454
let supportsUserTimingV3 = false;
5555
if (supportsUserTiming) {
5656
const CHECK_V3_MARK = '__v3';
57-
const markOptions = ({}: {startTime?: number});
57+
const markOptions: {
58+
detail?: mixed,
59+
startTime?: number,
60+
} = {};
5861
Object.defineProperty(markOptions, 'startTime', {
5962
get: function () {
6063
supportsUserTimingV3 = true;
@@ -64,7 +67,6 @@ if (supportsUserTiming) {
6467
});
6568

6669
try {
67-
// $FlowFixMe[extra-arg]: Flow expects the User Timing level 2 API.
6870
performance.mark(CHECK_V3_MARK, markOptions);
6971
} catch (error) {
7072
// Ignore

packages/react-devtools-shared/src/devtools/views/Components/OwnersListContext.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const resource: Resource<
4545
(element: Element) => {
4646
const request = inProgressRequests.get(element);
4747
if (request != null) {
48-
// $FlowFixMe[incompatible-call] found when upgrading Flow
4948
return request.promise;
5049
}
5150

packages/react-dom-bindings/src/events/DOMPluginEventSystem.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ function addTrappedEventListener(
472472
if (enableLegacyFBSupport && isDeferredListenerForLegacyFBSupport) {
473473
const originalListener = listener;
474474
// $FlowFixMe[missing-this-annot]
475-
// $FlowFixMe[definition-cycle]
476475
listener = function (...p) {
477476
removeEventListener(
478477
targetContainer,

packages/react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ if (document.body != null) {
4646
}
4747
});
4848
// documentElement must already exist at this point
49-
// $FlowFixMe[incompatible-call]
5049
domBodyObserver.observe(document.documentElement, {childList: true});
5150
}
5251

0 commit comments

Comments
 (0)