Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a473d08

Browse filesBrowse files
authored
Update to Flow from 0.97 to 0.122 (#25204)
* flow 0.122 * update ReactModel type
1 parent fe55c0e commit a473d08
Copy full SHA for a473d08

43 files changed

+109-51Lines changed: 109 additions & 51 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
6464
"fbjs-scripts": "1.2.0",
6565
"filesize": "^6.0.1",
66-
"flow-bin": "0.97",
66+
"flow-bin": "^0.122",
6767
"glob": "^7.1.6",
6868
"glob-stream": "^6.1.0",
6969
"google-closure-compiler": "^20200517.0.0",
Collapse file

‎packages/jest-react/src/internalAct.js‎

Copy file name to clipboardExpand all lines: packages/jest-react/src/internalAct.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export function act<T>(scope: () => Thenable<T> | T): Thenable<T> {
2828
'This version of `act` requires a special mock build of Scheduler.',
2929
);
3030
}
31+
32+
// $FlowFixMe: _isMockFunction doesn't exist on function
3133
if (setTimeout._isMockFunction !== true) {
3234
throw Error(
3335
"This version of `act` requires Jest's timer mocks " +
Collapse file

‎packages/react-debug-tools/src/ReactDebugHooks.js‎

Copy file name to clipboardExpand all lines: packages/react-debug-tools/src/ReactDebugHooks.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ function handleRenderFunctionError(error: any): void {
683683
// TODO: refactor this if we ever combine the devtools and debug tools packages
684684
wrapperError.name = 'ReactDebugToolsRenderError';
685685
// this stage-4 proposal is not supported by all environments yet.
686+
// $FlowFixMe Flow doesn't have this type yet.
686687
wrapperError.cause = error;
687688
throw wrapperError;
688689
}
Collapse file

‎packages/react-devtools-shared/src/backend/StyleX/utils.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/backend/StyleX/utils.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ function getPropertyValueForStyleName(styleName: string): string | null {
9292
]: any): CSSStyleSheet);
9393
// $FlowFixMe Flow doesn't konw about these properties
9494
const rules = styleSheet.rules || styleSheet.cssRules;
95+
// $FlowFixMe `rules` is mixed
9596
for (let ruleIndex = 0; ruleIndex < rules.length; ruleIndex++) {
97+
// $FlowFixMe `rules` is mixed
9698
const rule = rules[ruleIndex];
9799
// $FlowFixMe Flow doesn't konw about these properties
98100
const {cssText, selectorText, style} = rule;
Collapse file

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

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/backend/renderer.js
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ import type {
124124
} from 'react-devtools-shared/src/types';
125125

126126
type getDisplayNameForFiberType = (fiber: Fiber) => string | null;
127-
type getTypeSymbolType = (type: any) => Symbol | number;
127+
type getTypeSymbolType = (type: any) => symbol | number;
128128

129129
type ReactPriorityLevelsType = {|
130130
ImmediatePriority: number,
@@ -382,13 +382,14 @@ export function getInternalReactConstants(
382382
// End of copied code.
383383
// **********************************************************
384384

385-
function getTypeSymbol(type: any): Symbol | number {
385+
function getTypeSymbol(type: any): symbol | number {
386386
const symbolOrNumber =
387387
typeof type === 'object' && type !== null ? type.$$typeof : type;
388388

389389
// $FlowFixMe Flow doesn't know about typeof "symbol"
390390
return typeof symbolOrNumber === 'symbol'
391-
? symbolOrNumber.toString()
391+
? // $FlowFixMe `toString()` doesn't match the type signature?
392+
symbolOrNumber.toString()
392393
: symbolOrNumber;
393394
}
394395

Collapse file

‎packages/react-devtools-shared/src/backend/types.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/backend/types.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export type GetFiberIDForNative = (
8484
export type FindNativeNodesForFiberID = (id: number) => ?Array<NativeType>;
8585

8686
export type ReactProviderType<T> = {
87-
$$typeof: Symbol | number,
87+
$$typeof: symbol | number,
8888
_context: ReactContext<T>,
8989
...
9090
};
Collapse file

‎packages/react-devtools-shared/src/devtools/views/Button.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/devtools/views/Button.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default function Button({
2828
...rest
2929
}: Props) {
3030
let button = (
31+
// $FlowFixMe unsafe spread
3132
<button
3233
className={`${styles.Button} ${className}`}
3334
data-testname={testName}
Collapse file

‎packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/AutoSizeInput.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/AutoSizeInput.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default function AutoSizeInput({
4242
const isEmpty = value === '' || value === '""';
4343

4444
return (
45+
// $FlowFixMe unsafe rest spread
4546
<input
4647
className={[styles.Input, className].join(' ')}
4748
data-testname={testName}
Collapse file

‎packages/react-devtools-shared/src/devtools/views/Components/reach-ui/menu-button.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/devtools/views/Components/reach-ui/menu-button.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import useThemeStyles from '../../useThemeStyles';
1919
const MenuList = ({children, ...props}: {children: React$Node, ...}) => {
2020
const style = useThemeStyles();
2121
return (
22+
// $FlowFixMe unsafe spread
2223
<ReachMenuList style={style} {...props}>
2324
{children}
2425
</ReachMenuList>
Collapse file

‎packages/react-devtools-shared/src/devtools/views/Components/reach-ui/tooltip.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/devtools/views/Components/reach-ui/tooltip.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const Tooltip = ({
2323
}) => {
2424
const style = useThemeStyles();
2525
return (
26+
// $FlowFixMe unsafe spread
2627
<ReachTooltip
2728
className={`${tooltipStyles.Tooltip} ${className}`}
2829
style={style}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.