Skip to content

Commit 873f711

Browse files
authored
Update Flow to 0.248 (#34248)
This update remove support for `%checks`. Thanks @SamChou19815 for finding a close replacement that works.
1 parent 5f06c3d commit 873f711

File tree

7 files changed

+40
-14
lines changed

7 files changed

+40
-14
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"@typescript-eslint/parser": "^6.21.0",
5151
"abortcontroller-polyfill": "^1.7.5",
5252
"art": "0.10.1",
53+
"babel-plugin-syntax-hermes-parser": "^0.32.0",
5354
"babel-plugin-syntax-trailing-function-commas": "^6.5.0",
5455
"chalk": "^3.0.0",
5556
"cli-table": "^0.3.1",
@@ -72,8 +73,8 @@
7273
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
7374
"fbjs-scripts": "^3.0.1",
7475
"filesize": "^6.0.1",
75-
"flow-bin": "^0.247",
76-
"flow-remove-types": "^2.247",
76+
"flow-bin": "^0.248",
77+
"flow-remove-types": "^2.248",
7778
"glob": "^7.1.6",
7879
"glob-stream": "^6.1.0",
7980
"google-closure-compiler": "^20230206.0.0",

packages/react-devtools-shared/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module.exports = api => {
3434
}
3535
}
3636
const plugins = [
37+
['babel-plugin-syntax-hermes-parser'],
3738
['@babel/plugin-transform-flow-strip-types'],
3839
['@babel/plugin-proposal-class-properties', {loose: false}],
3940
];

packages/react-devtools-timeline/src/utils/flow.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
*
77
* @flow
88
*/
9-
import type {SchedulingEvent} from '../types';
9+
import type {ReactScheduleStateUpdateEvent, SchedulingEvent} from '../types';
1010

11-
export function isStateUpdateEvent(event: SchedulingEvent): boolean %checks {
11+
export function isStateUpdateEvent(
12+
event: SchedulingEvent,
13+
// eslint-disable-next-line
14+
): event is ReactScheduleStateUpdateEvent {
1215
return event.type === 'schedule-state-update';
1316
}

packages/react-native-renderer/src/legacy-events/accumulate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ function accumulate<T>(
3131
// Both are not empty. Warning: Never call x.concat(y) when you are not
3232
// certain that x is an Array (x could be a string with concat method).
3333
if (isArray(current)) {
34-
/* $FlowFixMe[incompatible-return] if `current` is `T` and `T` an array,
35-
* `isArray` might refine to the array element type of `T` */
34+
// $FlowFixMe[incompatible-use] `isArray` does not ensure array is mutable
3635
return current.concat(next);
3736
}
3837

packages/react-native-renderer/src/legacy-events/accumulateInto.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ function accumulateInto<T>(
3838
// certain that x is an Array (x could be a string with concat method).
3939
if (isArray(current)) {
4040
if (isArray(next)) {
41-
// $FlowFixMe[prop-missing] `isArray` does not ensure array is mutable
41+
// $FlowFixMe[incompatible-use] `isArray` does not ensure array is mutable
4242
// $FlowFixMe[method-unbinding]
4343
current.push.apply(current, next);
4444
return current;
4545
}
46-
// $FlowFixMe[prop-missing] `isArray` does not ensure array is mutable
46+
// $FlowFixMe[incompatible-use] `isArray` does not ensure array is mutable
4747
current.push(next);
4848
return current;
4949
}

packages/shared/isArray.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
* @flow
88
*/
99

10-
declare function isArray(a: mixed): boolean %checks(Array.isArray(a));
10+
declare function isArray<T>(
11+
v: T,
12+
// eslint-disable-next-line
13+
): v is T extends $ReadOnlyArray<mixed> ? T : empty;
1114

1215
const isArrayImpl = Array.isArray;
1316

yarn.lock

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5351,6 +5351,13 @@ babel-plugin-polyfill-regenerator@^0.6.1:
53515351
dependencies:
53525352
"@babel/helper-define-polyfill-provider" "^0.6.3"
53535353

5354+
babel-plugin-syntax-hermes-parser@^0.32.0:
5355+
version "0.32.0"
5356+
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.32.0.tgz#06f7452bf91adf6cafd7c98e7467404d4eb65cec"
5357+
integrity sha512-m5HthL++AbyeEA2FcdwOLfVFvWYECOBObLHNqdR8ceY4TsEdn4LdX2oTvbB2QJSSElE2AWA/b2MXZ/PF/CqLZg==
5358+
dependencies:
5359+
hermes-parser "0.32.0"
5360+
53545361
babel-plugin-syntax-trailing-function-commas@^6.5.0:
53555362
version "6.22.0"
53565363
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
@@ -9101,12 +9108,12 @@ flatted@^3.2.9:
91019108
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a"
91029109
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==
91039110

9104-
flow-bin@^0.247:
9105-
version "0.247.1"
9106-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.247.1.tgz#8c8d08fcee11ca43cbb6059edb9933a29bdedc57"
9107-
integrity sha512-03wwQ5kPW4CYqhXvxTseMs2v6QuVwCtifVkON2UUyDg6Jp1+CaQpLAZK+sFNzQOExKp0Yvoug+fZOUb33ARwHQ==
9111+
flow-bin@^0.248:
9112+
version "0.248.1"
9113+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.248.1.tgz#1d1e78ac8a1b8024dda5582b4832b605a00c16bd"
9114+
integrity sha512-WnISMV7p4rRY2LIMGnryR7Pnml9wFs0bTdniI1Dj2dXIJigOGfV74FjhMG7BmZkuKztNxlTvK56zpuhpcne+sg==
91089115

9109-
flow-remove-types@^2.247:
9116+
flow-remove-types@^2.248:
91109117
version "2.279.0"
91119118
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.279.0.tgz#3a3388d9158eba0f82c40d80d31d9640b883a3f5"
91129119
integrity sha512-bPFloMR/A2b/r/sIsf7Ix0LaMicCJNjwhXc4xEEQVzJCIz5u7C7XDaEOXOiqveKlCYK7DcBNn6R01Cbbc9gsYA==
@@ -9985,6 +9992,11 @@ hermes-estree@0.29.1:
99859992
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.29.1.tgz#043c7db076e0e8ef8c5f6ed23828d1ba463ebcc5"
99869993
integrity sha512-jl+x31n4/w+wEqm0I2r4CMimukLbLQEYpisys5oCre611CI5fc9TxhqkBBCJ1edDG4Kza0f7CgNz8xVMLZQOmQ==
99879994

9995+
hermes-estree@0.32.0:
9996+
version "0.32.0"
9997+
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.32.0.tgz#bb7da6613ab8e67e334a1854ea1e209f487d307b"
9998+
integrity sha512-KWn3BqnlDOl97Xe1Yviur6NbgIZ+IP+UVSpshlZWkq+EtoHg6/cwiDj/osP9PCEgFE15KBm1O55JRwbMEm5ejQ==
9999+
998810000
hermes-parser@0.25.1, hermes-parser@^0.25.1:
998910001
version "0.25.1"
999010002
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.25.1.tgz#5be0e487b2090886c62bd8a11724cd766d5f54d1"
@@ -9999,6 +10011,13 @@ hermes-parser@0.29.1:
999910011
dependencies:
1000010012
hermes-estree "0.29.1"
1000110013

10014+
hermes-parser@0.32.0:
10015+
version "0.32.0"
10016+
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.32.0.tgz#7916984ef6fdce62e7415d354cf35392061cd303"
10017+
integrity sha512-g4nBOWFpuiTqjR3LZdRxKUkij9iyveWeuks7INEsMX741f3r9xxrOe8TeQfUxtda0eXmiIFiMQzoeSQEno33Hw==
10018+
dependencies:
10019+
hermes-estree "0.32.0"
10020+
1000210021
homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
1000310022
version "1.0.3"
1000410023
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"

0 commit comments

Comments
 (0)