Skip to content

Commit ec5dd0a

Browse files
authored
Update Flow to 0.257 (#34253)
After an easy couple version with #34252, this version is less flexible (and safer) on inferring exported types mainly. We require to annotate some exported types to differentiate between `boolean` and literal `true` types, etc.
1 parent 8120753 commit ec5dd0a

31 files changed

+348
-346
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
7474
"fbjs-scripts": "^3.0.1",
7575
"filesize": "^6.0.1",
76-
"flow-bin": "^0.256",
77-
"flow-remove-types": "^2.256",
76+
"flow-bin": "^0.257",
77+
"flow-remove-types": "^2.257",
7878
"glob": "^7.1.6",
7979
"glob-stream": "^6.1.0",
8080
"google-closure-compiler": "^20230206.0.0",

packages/react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function renameStyle(
194194
const {instance, style} = data;
195195

196196
const newStyle = newName
197-
? {[oldName]: undefined, [newName]: value}
197+
? {[oldName]: (undefined: string | void), [newName]: value}
198198
: {[oldName]: undefined};
199199

200200
let customStyle;

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.core-fb.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* It should always be imported from "react-devtools-feature-flags".
1414
************************************************************************/
1515

16-
export const enableLogger = true;
17-
export const enableStyleXFeatures = true;
18-
export const isInternalFacebookBuild = true;
16+
export const enableLogger: boolean = true;
17+
export const enableStyleXFeatures: boolean = true;
18+
export const isInternalFacebookBuild: boolean = true;
1919

2020
/************************************************************************
2121
* Do not edit the code below.

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.core-oss.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* It should always be imported from "react-devtools-feature-flags".
1414
************************************************************************/
1515

16-
export const enableLogger = false;
17-
export const enableStyleXFeatures = false;
18-
export const isInternalFacebookBuild = false;
16+
export const enableLogger: boolean = false;
17+
export const enableStyleXFeatures: boolean = false;
18+
export const isInternalFacebookBuild: boolean = false;
1919

2020
/************************************************************************
2121
* Do not edit the code below.

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.default.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
* It should always be imported from "react-devtools-feature-flags".
1414
************************************************************************/
1515

16-
export const enableLogger = false;
17-
export const enableStyleXFeatures = false;
18-
export const isInternalFacebookBuild = false;
16+
export const enableLogger: boolean = false;
17+
export const enableStyleXFeatures: boolean = false;
18+
export const isInternalFacebookBuild: boolean = false;

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.extension-fb.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* It should always be imported from "react-devtools-feature-flags".
1414
************************************************************************/
1515

16-
export const enableLogger = true;
17-
export const enableStyleXFeatures = true;
18-
export const isInternalFacebookBuild = true;
16+
export const enableLogger: boolean = true;
17+
export const enableStyleXFeatures: boolean = true;
18+
export const isInternalFacebookBuild: boolean = true;
1919

2020
/************************************************************************
2121
* Do not edit the code below.

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.extension-oss.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* It should always be imported from "react-devtools-feature-flags".
1414
************************************************************************/
1515

16-
export const enableLogger = false;
17-
export const enableStyleXFeatures = false;
18-
export const isInternalFacebookBuild = false;
16+
export const enableLogger: boolean = false;
17+
export const enableStyleXFeatures: boolean = false;
18+
export const isInternalFacebookBuild: boolean = false;
1919

2020
/************************************************************************
2121
* Do not edit the code below.

packages/react-devtools-timeline/src/content-views/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const MARKER_TEXT_PADDING = 8;
1616
export const COLOR_HOVER_DIM_DELTA = 5;
1717
export const TOP_ROW_PADDING = 4;
1818
export const NATIVE_EVENT_HEIGHT = 14;
19-
export const SUSPENSE_EVENT_HEIGHT = 14;
19+
export const SUSPENSE_EVENT_HEIGHT: number = 14;
2020
export const PENDING_SUSPENSE_EVENT_SIZE = 8;
2121
export const REACT_EVENT_DIAMETER = 6;
2222
export const USER_TIMING_MARK_SIZE = 8;

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ export const scheduleTimeout: any =
746746
typeof setTimeout === 'function' ? setTimeout : (undefined: any);
747747
export const cancelTimeout: any =
748748
typeof clearTimeout === 'function' ? clearTimeout : (undefined: any);
749-
export const noTimeout = -1;
749+
export const noTimeout: -1 = -1;
750750
const localPromise = typeof Promise === 'function' ? Promise : undefined;
751751
const localRequestAnimationFrame =
752752
typeof requestAnimationFrame === 'function'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export function listenToNativeEventForNonManagedEventTarget(
407407
isCapturePhaseListener: boolean,
408408
target: EventTarget,
409409
): void {
410-
let eventSystemFlags = IS_EVENT_HANDLE_NON_MANAGED_NODE;
410+
let eventSystemFlags: number = IS_EVENT_HANDLE_NON_MANAGED_NODE;
411411
const listenerSet = getEventListenerSet(target);
412412
const listenerSetKey = getListenerSetKey(
413413
domEventName,

0 commit comments

Comments
 (0)