Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@typescript-eslint/parser": "^6.21.0",
"abortcontroller-polyfill": "^1.7.5",
"art": "0.10.1",
"babel-plugin-syntax-hermes-parser": "^0.32.0",
"babel-plugin-syntax-trailing-function-commas": "^6.5.0",
"chalk": "^3.0.0",
"cli-table": "^0.3.1",
Expand All @@ -72,8 +73,8 @@
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "^3.0.1",
"filesize": "^6.0.1",
"flow-bin": "^0.247",
"flow-remove-types": "^2.247",
"flow-bin": "^0.248",
"flow-remove-types": "^2.248",
"glob": "^7.1.6",
"glob-stream": "^6.1.0",
"google-closure-compiler": "^20230206.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-shared/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = api => {
}
}
const plugins = [
['babel-plugin-syntax-hermes-parser'],
['@babel/plugin-transform-flow-strip-types'],
['@babel/plugin-proposal-class-properties', {loose: false}],
];
Expand Down
7 changes: 5 additions & 2 deletions packages/react-devtools-timeline/src/utils/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
*
* @flow
*/
import type {SchedulingEvent} from '../types';
import type {ReactScheduleStateUpdateEvent, SchedulingEvent} from '../types';

export function isStateUpdateEvent(event: SchedulingEvent): boolean %checks {
export function isStateUpdateEvent(
event: SchedulingEvent,
// eslint-disable-next-line
): event is ReactScheduleStateUpdateEvent {
return event.type === 'schedule-state-update';
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ function accumulate<T>(
// Both are not empty. Warning: Never call x.concat(y) when you are not
// certain that x is an Array (x could be a string with concat method).
if (isArray(current)) {
/* $FlowFixMe[incompatible-return] if `current` is `T` and `T` an array,
* `isArray` might refine to the array element type of `T` */
// $FlowFixMe[incompatible-use] `isArray` does not ensure array is mutable
return current.concat(next);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ function accumulateInto<T>(
// certain that x is an Array (x could be a string with concat method).
if (isArray(current)) {
if (isArray(next)) {
// $FlowFixMe[prop-missing] `isArray` does not ensure array is mutable
// $FlowFixMe[incompatible-use] `isArray` does not ensure array is mutable
// $FlowFixMe[method-unbinding]
current.push.apply(current, next);
return current;
}
// $FlowFixMe[prop-missing] `isArray` does not ensure array is mutable
// $FlowFixMe[incompatible-use] `isArray` does not ensure array is mutable
current.push(next);
return current;
}
Expand Down
5 changes: 4 additions & 1 deletion packages/shared/isArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
* @flow
*/

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

const isArrayImpl = Array.isArray;

Expand Down
29 changes: 24 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5351,6 +5351,13 @@ babel-plugin-polyfill-regenerator@^0.6.1:
dependencies:
"@babel/helper-define-polyfill-provider" "^0.6.3"

babel-plugin-syntax-hermes-parser@^0.32.0:
version "0.32.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.32.0.tgz#06f7452bf91adf6cafd7c98e7467404d4eb65cec"
integrity sha512-m5HthL++AbyeEA2FcdwOLfVFvWYECOBObLHNqdR8ceY4TsEdn4LdX2oTvbB2QJSSElE2AWA/b2MXZ/PF/CqLZg==
dependencies:
hermes-parser "0.32.0"

babel-plugin-syntax-trailing-function-commas@^6.5.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
Expand Down Expand Up @@ -9101,12 +9108,12 @@ flatted@^3.2.9:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a"
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==

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

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

hermes-estree@0.32.0:
version "0.32.0"
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.32.0.tgz#bb7da6613ab8e67e334a1854ea1e209f487d307b"
integrity sha512-KWn3BqnlDOl97Xe1Yviur6NbgIZ+IP+UVSpshlZWkq+EtoHg6/cwiDj/osP9PCEgFE15KBm1O55JRwbMEm5ejQ==

hermes-parser@0.25.1, hermes-parser@^0.25.1:
version "0.25.1"
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.25.1.tgz#5be0e487b2090886c62bd8a11724cd766d5f54d1"
Expand All @@ -9999,6 +10011,13 @@ hermes-parser@0.29.1:
dependencies:
hermes-estree "0.29.1"

hermes-parser@0.32.0:
version "0.32.0"
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.32.0.tgz#7916984ef6fdce62e7415d354cf35392061cd303"
integrity sha512-g4nBOWFpuiTqjR3LZdRxKUkij9iyveWeuks7INEsMX741f3r9xxrOe8TeQfUxtda0eXmiIFiMQzoeSQEno33Hw==
dependencies:
hermes-estree "0.32.0"

homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"
Expand Down
Loading