Compare commits

...

6 Commits

Author SHA1 Message Date
Joe Savona
6616654253 [compiler] Show a ref name hint when assigning to non-ref in a callback
In #34125 I added a hint where if you assign to the .current property of a frozen object, we suggest naming the variable as `ref` or `-Ref`. However, the tracking for mutations that assign to .current specifically wasn't propagated past function expression boundaries, which meant that the hint only showed up if you mutated the ref in the main body of the component/hook. That's less likely to happen since most folks know not to access refs in render. What's more likely is that you'll (correctly) assign a ref in an effect or callback, but the compiler will throw an error. By showing a hint in this case we can help people understand the naming pattern.
2025-08-27 12:16:05 -07:00
Jan Kassens
d260b0d8b8 Update Flow to 0.265 (#34270)
Looks like this version removed `Object.prototype` although I didn't see
that in the changelog. This is fine for this code here.
2025-08-22 15:22:22 -04:00
Joseph Savona
425ba0ad6d [compiler] Script to produce markdown of lint rule docs (#34260)
The docs site is in a separate repo, but this gives us a semi-automated
way to update the docs about our lint rules. The script generates
markdown files from the rule definitions which we can then manually
copy/paste into the docs site somewhere. In the future we can automate
this fully.
2025-08-22 09:59:28 -07:00
Jan Kassens
6de32a5a07 Update Flow to 0.263 (#34269)
This update was a bit more involved.

- `React$Component` was removed, I replaced it with Flow component
types.
- Flow removed shipping the standard library. This adds the environment
libraries back from `flow-typed` which seemed to have changed slightly
(probably got more precise and less `any`s). Suppresses some new type
errors.
2025-08-22 12:10:13 -04:00
Abdulwahab Omira
698bb4deb7 Add support for ARIA 1.3 attributes (#34264)
Co-authored-by: Abdulwahab Omira <abdulwahabomira@gmail.com>
Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
2025-08-22 16:22:18 +02:00
Sebastian Markbåge
11d7bcf88c [DevTools] Use source maps to infer name asynchronously (#34212) 2025-08-22 00:38:09 +02:00
60 changed files with 14373 additions and 289 deletions

View File

@@ -28,3 +28,6 @@ packages/react-devtools-shared/src/hooks/__tests__/__source__/__untransformed__/
packages/react-devtools-shell/dist
packages/react-devtools-timeline/dist
packages/react-devtools-timeline/static
# Imported third-party Flow types
flow-typed/

View File

@@ -581,6 +581,7 @@ module.exports = {
IteratorResult: 'readonly',
JSONValue: 'readonly',
JSResourceReference: 'readonly',
mixin$Animatable: 'readonly',
MouseEventHandler: 'readonly',
NavigateEvent: 'readonly',
PropagationPhases: 'readonly',
@@ -619,7 +620,6 @@ module.exports = {
PropertyIndexedKeyframes: 'readonly',
KeyframeAnimationOptions: 'readonly',
GetAnimationsOptions: 'readonly',
Animatable: 'readonly',
ScrollTimeline: 'readonly',
EventListenerOptionsOrUseCapture: 'readonly',
FocusOptions: 'readonly',

View File

@@ -19,7 +19,8 @@
"test": "yarn workspaces run test",
"snap": "yarn workspace babel-plugin-react-compiler run snap",
"snap:build": "yarn workspace snap run build",
"npm:publish": "node scripts/release/publish"
"npm:publish": "node scripts/release/publish",
"eslint-docs": "yarn workspace babel-plugin-react-compiler build && node scripts/build-eslint-docs.js"
},
"dependencies": {
"fs-extra": "^4.0.2",

View File

@@ -7,9 +7,10 @@
import * as t from '@babel/types';
import {codeFrameColumns} from '@babel/code-frame';
import type {SourceLocation} from './HIR';
import {type SourceLocation} from './HIR';
import {Err, Ok, Result} from './Utils/Result';
import {assertExhaustive} from './Utils/utils';
import invariant from 'invariant';
export enum ErrorSeverity {
/**
@@ -628,7 +629,18 @@ export type LintRule = {
recommended: boolean;
};
const RULE_NAME_PATTERN = /^[a-z]+(-[a-z]+)*$/;
export function getRuleForCategory(category: ErrorCategory): LintRule {
const rule = getRuleForCategoryImpl(category);
invariant(
RULE_NAME_PATTERN.test(rule.name),
`Invalid rule name, got '${rule.name}' but rules must match ${RULE_NAME_PATTERN.toString()}`,
);
return rule;
}
function getRuleForCategoryImpl(category: ErrorCategory): LintRule {
switch (category) {
case ErrorCategory.AutomaticEffectDependencies: {
return {
@@ -636,7 +648,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
name: 'automatic-effect-dependencies',
description:
'Verifies that automatic effect dependencies are compiled if opted-in',
recommended: true,
recommended: false,
};
}
case ErrorCategory.CapitalizedCalls: {
@@ -652,7 +664,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
return {
category,
name: 'config',
description: 'Validates the configuration',
description: 'Validates the compiler configuration options',
recommended: true,
};
}
@@ -678,7 +690,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
category,
name: 'set-state-in-effect',
description:
'Validates against calling setState synchronously in an effect',
'Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance',
recommended: true,
};
}
@@ -687,7 +699,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
category,
name: 'error-boundaries',
description:
'Validates usage of error boundaries instead of try/catch for errors in JSX',
'Validates usage of error boundaries instead of try/catch for errors in child components',
recommended: true,
};
}
@@ -711,7 +723,8 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
return {
category,
name: 'gating',
description: 'Validates configuration of gating mode',
description:
'Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)',
recommended: true,
};
}
@@ -720,7 +733,8 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
category,
name: 'globals',
description:
'Validates against assignment/mutation of globals during render',
'Validates against assignment/mutation of globals during render, part of ensuring that ' +
'[side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)',
recommended: true,
};
}
@@ -742,7 +756,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
category,
name: 'immutability',
description:
'Validates that immutable values (props, state, etc) are not mutated',
'Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)',
recommended: true,
};
}
@@ -759,7 +773,9 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
category,
name: 'preserve-manual-memoization',
description:
'Validates that existing manual memoized is preserved by the compiler',
'Validates that existing manual memoized is preserved by the compiler. ' +
'React Compiler will only compile components and hooks if its inference ' +
'[matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)',
recommended: true,
};
}
@@ -768,7 +784,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
category,
name: 'purity',
description:
'Validates that the component/hook is pure, and does not call known-impure functions',
'Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions',
recommended: true,
};
}
@@ -777,7 +793,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
category,
name: 'refs',
description:
'Validates correct usage of refs, not reading/writing during render',
'Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)',
recommended: true,
};
}
@@ -785,7 +801,8 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
return {
category,
name: 'set-state-in-render',
description: 'Validates against setting state during render',
description:
'Validates against setting state during render, which can trigger additional renders and potential infinite render loops',
recommended: true,
};
}
@@ -794,7 +811,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
category,
name: 'static-components',
description:
'Validates that components are static, not recreated every render',
'Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering',
recommended: true,
};
}
@@ -826,7 +843,8 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
return {
category,
name: 'unsupported-syntax',
description: 'Validates against syntax that we do not plan to support',
description:
'Validates against syntax that we do not plan to support in React Compiler',
recommended: true,
};
}
@@ -834,7 +852,8 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
return {
category,
name: 'use-memo',
description: 'Validates usage of the useMemo() hook',
description:
'Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.',
recommended: true,
};
}

View File

@@ -983,7 +983,7 @@ export function printAliasingEffect(effect: AliasingEffect): string {
case 'MutateConditionally':
case 'MutateTransitive':
case 'MutateTransitiveConditionally': {
return `${effect.kind} ${printPlaceForAliasEffect(effect.value)}`;
return `${effect.kind} ${printPlaceForAliasEffect(effect.value)}${effect.kind === 'Mutate' && effect.reason?.kind === 'AssignCurrentProperty' ? ' (assign `.current`)' : ''}`;
}
case 'MutateFrozen': {
return `MutateFrozen ${printPlaceForAliasEffect(effect.place)} reason=${JSON.stringify(effect.error.reason)}`;

View File

@@ -27,7 +27,7 @@ import {
} from '../HIR/visitors';
import {assertExhaustive, getOrInsertWith} from '../Utils/utils';
import {Err, Ok, Result} from '../Utils/Result';
import {AliasingEffect} from './AliasingEffects';
import {AliasingEffect, MutationReason} from './AliasingEffects';
/**
* This pass builds an abstract model of the heap and interprets the effects of the
@@ -101,6 +101,7 @@ export function inferMutationAliasingRanges(
transitive: boolean;
kind: MutationKind;
place: Place;
reason: MutationReason | null;
}> = [];
const renders: Array<{index: number; place: Place}> = [];
@@ -176,6 +177,7 @@ export function inferMutationAliasingRanges(
effect.kind === 'MutateTransitive'
? MutationKind.Definite
: MutationKind.Conditional,
reason: null,
place: effect.value,
});
} else if (
@@ -190,6 +192,7 @@ export function inferMutationAliasingRanges(
effect.kind === 'Mutate'
? MutationKind.Definite
: MutationKind.Conditional,
reason: effect.kind === 'Mutate' ? (effect.reason ?? null) : null,
place: effect.value,
});
} else if (
@@ -241,6 +244,7 @@ export function inferMutationAliasingRanges(
mutation.transitive,
mutation.kind,
mutation.place.loc,
mutation.reason,
errors,
);
}
@@ -267,6 +271,7 @@ export function inferMutationAliasingRanges(
functionEffects.push({
kind: 'Mutate',
value: {...place, loc: node.local.loc},
reason: node.mutationReason,
});
}
}
@@ -507,6 +512,7 @@ export function inferMutationAliasingRanges(
true,
MutationKind.Conditional,
into.loc,
null,
ignoredErrors,
);
for (const from of tracked) {
@@ -580,6 +586,7 @@ type Node = {
transitive: {kind: MutationKind; loc: SourceLocation} | null;
local: {kind: MutationKind; loc: SourceLocation} | null;
lastMutated: number;
mutationReason: MutationReason | null;
value:
| {kind: 'Object'}
| {kind: 'Phi'}
@@ -599,6 +606,7 @@ class AliasingState {
transitive: null,
local: null,
lastMutated: 0,
mutationReason: null,
value,
});
}
@@ -697,6 +705,7 @@ class AliasingState {
transitive: boolean,
startKind: MutationKind,
loc: SourceLocation,
reason: MutationReason | null,
errors: CompilerError,
): void {
const seen = new Map<Identifier, MutationKind>();
@@ -717,6 +726,7 @@ class AliasingState {
if (node == null) {
continue;
}
node.mutationReason ??= reason;
node.lastMutated = Math.max(node.lastMutated, index);
if (end != null) {
node.id.mutableRange.end = makeInstructionId(

View File

@@ -0,0 +1,37 @@
## Input
```javascript
// Fixture to test that we show a hint to name as `ref` or `-Ref` when attempting
// to assign .current inside an effect
function Component({foo}) {
useEffect(() => {
foo.current = true;
}, [foo]);
}
```
## Error
```
Found 1 error:
Error: This value cannot be modified
Modifying component props or hook arguments is not allowed. Consider using a local variable instead.
error.assign-ref-in-effect-hint.ts:5:4
3 | function Component({foo}) {
4 | useEffect(() => {
> 5 | foo.current = true;
| ^^^ `foo` cannot be modified
6 | }, [foo]);
7 | }
8 |
Hint: If this value is a Ref (value returned by `useRef()`), rename the variable to end in "Ref".
```

View File

@@ -0,0 +1,7 @@
// Fixture to test that we show a hint to name as `ref` or `-Ref` when attempting
// to assign .current inside an effect
function Component({foo}) {
useEffect(() => {
foo.current = true;
}, [foo]);
}

View File

@@ -38,6 +38,8 @@ error.invalid-mutate-context-in-callback.ts:12:4
13 | };
14 | return <div onClick={onClick} />;
15 | }
Hint: If this value is a Ref (value returned by `useRef()`), rename the variable to end in "Ref".
```

View File

@@ -0,0 +1,32 @@
const ReactCompiler = require('../packages/babel-plugin-react-compiler/dist');
const combinedRules = [
{
name: 'rules-of-hooks',
recommended: true,
description:
'Validates that components and hooks follow the [Rules of Hooks](https://react.dev/reference/rules/rules-of-hooks)',
},
{
name: 'exhaustive-deps',
recommended: true,
description:
'Validates that hooks which accept dependency arrays (`useMemo()`, `useCallback()`, `useEffect()`, etc) ' +
'list all referenced variables in their dependency array. Referencing a value without including it in the ' +
'dependency array can lead to stale UI or callbacks.',
},
...ReactCompiler.LintRules,
];
const printed = combinedRules
.filter(rule => rule.recommended)
.map(rule => {
return `
## \`react-hooks/${rule.name}\`
${rule.description}
`.trim();
})
.join('\n\n');
console.log(printed);

20
flow-typed.config.json Normal file
View File

@@ -0,0 +1,20 @@
{
"env": [
"bom",
"cssom",
"dom",
"geometry",
"html",
"node",
"serviceworkers",
"streams",
"web-animations"
],
"ignore": [
"create-react-class",
"jest",
"regenerator-runtime",
"webpack",
"ws"
]
}

2719
flow-typed/environments/bom.js vendored Normal file

File diff suppressed because it is too large Load Diff

414
flow-typed/environments/cssom.js vendored Normal file
View File

@@ -0,0 +1,414 @@
// flow-typed signature: ad7b684aa8897ecb82bcc3e009b9fc30
// flow-typed version: 3e51657e95/cssom/flow_>=v0.261.x
declare class StyleSheet {
disabled: boolean;
+href: string;
+media: MediaList;
+ownerNode: Node;
+parentStyleSheet: ?StyleSheet;
+title: string;
+type: string;
}
declare class StyleSheetList {
@@iterator(): Iterator<StyleSheet>;
length: number;
[index: number]: StyleSheet;
}
declare class MediaList {
@@iterator(): Iterator<string>;
mediaText: string;
length: number;
item(index: number): ?string;
deleteMedium(oldMedium: string): void;
appendMedium(newMedium: string): void;
[index: number]: string;
}
declare class CSSStyleSheet extends StyleSheet {
+cssRules: CSSRuleList;
+ownerRule: ?CSSRule;
deleteRule(index: number): void;
insertRule(rule: string, index: number): number;
replace(text: string): Promise<CSSStyleSheet>;
replaceSync(text: string): void;
}
declare class CSSGroupingRule extends CSSRule {
+cssRules: CSSRuleList;
deleteRule(index: number): void;
insertRule(rule: string, index: number): number;
}
declare class CSSConditionRule extends CSSGroupingRule {
conditionText: string;
}
declare class CSSMediaRule extends CSSConditionRule {
+media: MediaList;
}
declare class CSSStyleRule extends CSSRule {
selectorText: string;
+style: CSSStyleDeclaration;
}
declare class CSSSupportsRule extends CSSConditionRule {}
declare class CSSRule {
cssText: string;
+parentRule: ?CSSRule;
+parentStyleSheet: ?CSSStyleSheet;
+type: number;
static STYLE_RULE: number;
static MEDIA_RULE: number;
static FONT_FACE_RULE: number;
static PAGE_RULE: number;
static IMPORT_RULE: number;
static CHARSET_RULE: number;
static UNKNOWN_RULE: number;
static KEYFRAMES_RULE: number;
static KEYFRAME_RULE: number;
static NAMESPACE_RULE: number;
static COUNTER_STYLE_RULE: number;
static SUPPORTS_RULE: number;
static DOCUMENT_RULE: number;
static FONT_FEATURE_VALUES_RULE: number;
static VIEWPORT_RULE: number;
static REGION_STYLE_RULE: number;
}
declare class CSSKeyframeRule extends CSSRule {
keyText: string;
+style: CSSStyleDeclaration;
}
declare class CSSKeyframesRule extends CSSRule {
name: string;
+cssRules: CSSRuleList;
appendRule(rule: string): void;
deleteRule(select: string): void;
findRule(select: string): CSSKeyframeRule | null;
}
declare class CSSRuleList {
@@iterator(): Iterator<CSSRule>;
length: number;
item(index: number): ?CSSRule;
[index: number]: CSSRule;
}
declare class CSSStyleDeclaration {
@@iterator(): Iterator<string>;
/* DOM CSS Properties */
alignContent: string;
alignItems: string;
alignSelf: string;
all: string;
animation: string;
animationDelay: string;
animationDirection: string;
animationDuration: string;
animationFillMode: string;
animationIterationCount: string;
animationName: string;
animationPlayState: string;
animationTimingFunction: string;
backdropFilter: string;
webkitBackdropFilter: string;
backfaceVisibility: string;
background: string;
backgroundAttachment: string;
backgroundBlendMode: string;
backgroundClip: string;
backgroundColor: string;
backgroundImage: string;
backgroundOrigin: string;
backgroundPosition: string;
backgroundPositionX: string;
backgroundPositionY: string;
backgroundRepeat: string;
backgroundSize: string;
blockSize: string;
border: string;
borderBlockEnd: string;
borderBlockEndColor: string;
borderBlockEndStyle: string;
borderBlockEndWidth: string;
borderBlockStart: string;
borderBlockStartColor: string;
borderBlockStartStyle: string;
borderBlockStartWidth: string;
borderBottom: string;
borderBottomColor: string;
borderBottomLeftRadius: string;
borderBottomRightRadius: string;
borderBottomStyle: string;
borderBottomWidth: string;
borderCollapse: string;
borderColor: string;
borderImage: string;
borderImageOutset: string;
borderImageRepeat: string;
borderImageSlice: string;
borderImageSource: string;
borderImageWidth: string;
borderInlineEnd: string;
borderInlineEndColor: string;
borderInlineEndStyle: string;
borderInlineEndWidth: string;
borderInlineStart: string;
borderInlineStartColor: string;
borderInlineStartStyle: string;
borderInlineStartWidth: string;
borderLeft: string;
borderLeftColor: string;
borderLeftStyle: string;
borderLeftWidth: string;
borderRadius: string;
borderRight: string;
borderRightColor: string;
borderRightStyle: string;
borderRightWidth: string;
borderSpacing: string;
borderStyle: string;
borderTop: string;
borderTopColor: string;
borderTopLeftRadius: string;
borderTopRightRadius: string;
borderTopStyle: string;
borderTopWidth: string;
borderWidth: string;
bottom: string;
boxDecorationBreak: string;
boxShadow: string;
boxSizing: string;
breakAfter: string;
breakBefore: string;
breakInside: string;
captionSide: string;
clear: string;
clip: string;
clipPath: string;
color: string;
columns: string;
columnCount: string;
columnFill: string;
columnGap: string;
columnRule: string;
columnRuleColor: string;
columnRuleStyle: string;
columnRuleWidth: string;
columnSpan: string;
columnWidth: string;
contain: string;
content: string;
counterIncrement: string;
counterReset: string;
cursor: string;
direction: string;
display: string;
emptyCells: string;
filter: string;
flex: string;
flexBasis: string;
flexDirection: string;
flexFlow: string;
flexGrow: string;
flexShrink: string;
flexWrap: string;
float: string;
font: string;
fontFamily: string;
fontFeatureSettings: string;
fontKerning: string;
fontLanguageOverride: string;
fontSize: string;
fontSizeAdjust: string;
fontStretch: string;
fontStyle: string;
fontSynthesis: string;
fontVariant: string;
fontVariantAlternates: string;
fontVariantCaps: string;
fontVariantEastAsian: string;
fontVariantLigatures: string;
fontVariantNumeric: string;
fontVariantPosition: string;
fontWeight: string;
grad: string;
grid: string;
gridArea: string;
gridAutoColumns: string;
gridAutoFlow: string;
gridAutoPosition: string;
gridAutoRows: string;
gridColumn: string;
gridColumnStart: string;
gridColumnEnd: string;
gridRow: string;
gridRowStart: string;
gridRowEnd: string;
gridTemplate: string;
gridTemplateAreas: string;
gridTemplateRows: string;
gridTemplateColumns: string;
height: string;
hyphens: string;
imageRendering: string;
imageResolution: string;
imageOrientation: string;
imeMode: string;
inherit: string;
initial: string;
inlineSize: string;
isolation: string;
justifyContent: string;
left: string;
letterSpacing: string;
lineBreak: string;
lineHeight: string;
listStyle: string;
listStyleImage: string;
listStylePosition: string;
listStyleType: string;
margin: string;
marginBlockEnd: string;
marginBlockStart: string;
marginBottom: string;
marginInlineEnd: string;
marginInlineStart: string;
marginLeft: string;
marginRight: string;
marginTop: string;
marks: string;
mask: string;
maskType: string;
maxBlockSize: string;
maxHeight: string;
maxInlineSize: string;
maxWidth: string;
minBlockSize: string;
minHeight: string;
minInlineSize: string;
minWidth: string;
mixBlendMode: string;
mozTransform: string;
mozTransformOrigin: string;
mozTransitionDelay: string;
mozTransitionDuration: string;
mozTransitionProperty: string;
mozTransitionTimingFunction: string;
objectFit: string;
objectPosition: string;
offsetBlockEnd: string;
offsetBlockStart: string;
offsetInlineEnd: string;
offsetInlineStart: string;
opacity: string;
order: string;
orphans: string;
outline: string;
outlineColor: string;
outlineOffset: string;
outlineStyle: string;
outlineWidth: string;
overflow: string;
overflowWrap: string;
overflowX: string;
overflowY: string;
padding: string;
paddingBlockEnd: string;
paddingBlockStart: string;
paddingBottom: string;
paddingInlineEnd: string;
paddingInlineStart: string;
paddingLeft: string;
paddingRight: string;
paddingTop: string;
pageBreakAfter: string;
pageBreakBefore: string;
pageBreakInside: string;
perspective: string;
perspectiveOrigin: string;
pointerEvents: string;
position: string;
quotes: string;
rad: string;
resize: string;
right: string;
rubyAlign: string;
rubyMerge: string;
rubyPosition: string;
scrollBehavior: string;
scrollSnapCoordinate: string;
scrollSnapDestination: string;
scrollSnapPointsX: string;
scrollSnapPointsY: string;
scrollSnapType: string;
shapeImageThreshold: string;
shapeMargin: string;
shapeOutside: string;
tableLayout: string;
tabSize: string;
textAlign: string;
textAlignLast: string;
textCombineUpright: string;
textDecoration: string;
textDecorationColor: string;
textDecorationLine: string;
textDecorationStyle: string;
textIndent: string;
textOrientation: string;
textOverflow: string;
textRendering: string;
textShadow: string;
textTransform: string;
textUnderlinePosition: string;
top: string;
touchAction: string;
transform: string;
transformOrigin: string;
transformStyle: string;
transition: string;
transitionDelay: string;
transitionDuration: string;
transitionProperty: string;
transitionTimingFunction: string;
turn: string;
unicodeBidi: string;
unicodeRange: string;
userSelect: string;
verticalAlign: string;
visibility: string;
webkitOverflowScrolling: string;
webkitTransform: string;
webkitTransformOrigin: string;
webkitTransitionDelay: string;
webkitTransitionDuration: string;
webkitTransitionProperty: string;
webkitTransitionTimingFunction: string;
whiteSpace: string;
widows: string;
width: string;
willChange: string;
wordBreak: string;
wordSpacing: string;
wordWrap: string;
writingMode: string;
zIndex: string;
cssFloat: string;
cssText: string;
getPropertyPriority(property: string): string;
getPropertyValue(property: string): string;
item(index: number): string;
[index: number]: string;
length: number;
parentRule: CSSRule;
removeProperty(property: string): string;
setProperty(property: string, value: ?string, priority: ?string): void;
setPropertyPriority(property: string, priority: string): void;
}

3676
flow-typed/environments/dom.js vendored Normal file

File diff suppressed because it is too large Load Diff

270
flow-typed/environments/geometry.js vendored Normal file
View File

@@ -0,0 +1,270 @@
// flow-typed signature: c29a716c1825927cdfc3ad29fe929754
// flow-typed version: 52ab99c6db/geometry/flow_>=v0.261.x
// https://www.w3.org/TR/geometry-1/
type DOMMatrix2DInit =
| {|
a: number,
b: number,
c: number,
d: number,
e: number,
f: number,
|}
| {|
m11: number,
m12: number,
m21: number,
m22: number,
m41: number,
m42: number,
|};
type DOMMatrixInit =
| {|
...DOMMatrix2DInit,
is2D: true,
|}
| {|
...DOMMatrix2DInit,
is2D: false,
m13: number,
m14: number,
m23: number,
m24: number,
m31: number,
m32: number,
m33: number,
m34: number,
m43: number,
m44: number,
|};
type DOMPointInit = {|
w: number,
x: number,
y: number,
z: number,
|};
type DOMQuadInit = {|
p1: DOMPointInit,
p2: DOMPointInit,
p3: DOMPointInit,
p4: DOMPointInit,
|};
type DOMRectInit = {|
height: number,
width: number,
x: number,
y: number,
|};
declare class DOMMatrix extends DOMMatrixReadOnly {
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
m11: number;
m12: number;
m13: number;
m14: number;
m21: number;
m22: number;
m23: number;
m24: number;
m31: number;
m32: number;
m33: number;
m34: number;
m41: number;
m42: number;
m43: number;
m44: number;
static fromFloat32Array(array32: Float32Array): DOMMatrix;
static fromFloat64Array(array64: Float64Array): DOMMatrix;
static fromMatrix(other?: DOMMatrixInit): DOMMatrix;
constructor(init?: string | Array<number>): void;
invertSelf(): DOMMatrix;
multiplySelf(other?: DOMMatrixInit): DOMMatrix;
preMultiplySelf(other?: DOMMatrixInit): DOMMatrix;
rotateAxisAngleSelf(
x?: number,
y?: number,
z?: number,
angle?: number
): DOMMatrix;
rotateFromVectorSelf(x?: number, y?: number): DOMMatrix;
rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
scale3dSelf(
scale?: number,
originX?: number,
originY?: number,
originZ?: number
): DOMMatrix;
scaleSelf(
scaleX?: number,
scaleY?: number,
scaleZ?: number,
originX?: number,
originY?: number,
originZ?: number
): DOMMatrix;
setMatrixValue(transformList: string): DOMMatrix;
skewXSelf(sx?: number): DOMMatrix;
skewYSelf(sy?: number): DOMMatrix;
translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix;
}
declare class DOMMatrixReadOnly {
+a: number;
+b: number;
+c: number;
+d: number;
+e: number;
+f: number;
+is2D: boolean;
+isIdentity: boolean;
+m11: number;
+m12: number;
+m13: number;
+m14: number;
+m21: number;
+m22: number;
+m23: number;
+m24: number;
+m31: number;
+m32: number;
+m33: number;
+m34: number;
+m41: number;
+m42: number;
+m43: number;
+m44: number;
static fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly;
static fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly;
static fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;
constructor(init?: string | Array<number>): void;
flipX(): DOMMatrix;
flipY(): DOMMatrix;
inverse(): DOMMatrix;
multiply(other?: DOMMatrixInit): DOMMatrix;
rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
rotateAxisAngle(
x?: number,
y?: number,
z?: number,
angle?: number
): DOMMatrix;
rotateFromVector(x?: number, y?: number): DOMMatrix;
scale(
scaleX?: number,
scaleY?: number,
scaleZ?: number,
originX?: number,
originY?: number,
originZ?: number
): DOMMatrix;
scale3d(
scale?: number,
originX?: number,
originY?: number,
originZ?: number
): DOMMatrix;
scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;
skewX(sx?: number): DOMMatrix;
skewY(sy?: number): DOMMatrix;
toFloat32Array(): Float32Array;
toFloat64Array(): Float64Array;
toJSON(): Object;
transformPoint(point?: DOMPointInit): DOMPoint;
translate(tx?: number, ty?: number, tz?: number): DOMMatrix;
toString(): string;
}
declare class DOMPoint extends DOMPointReadOnly {
w: number;
x: number;
y: number;
z: number;
static fromPoint(other?: DOMPointInit): DOMPoint;
constructor(x?: number, y?: number, z?: number, w?: number): void;
}
declare class DOMPointReadOnly {
+w: number;
+x: number;
+y: number;
+z: number;
static fromPoint(other?: DOMPointInit): DOMPointReadOnly;
constructor(x?: number, y?: number, z?: number, w?: number): void;
matrixTransform(matrix?: DOMMatrixInit): DOMPoint;
toJSON(): Object;
}
declare class DOMQuad {
+p1: DOMPoint;
+p2: DOMPoint;
+p3: DOMPoint;
+p4: DOMPoint;
static fromQuad(other?: DOMQuadInit): DOMQuad;
static fromRect(other?: DOMRectInit): DOMQuad;
constructor(
p1?: DOMPointInit,
p2?: DOMPointInit,
p3?: DOMPointInit,
p4?: DOMPointInit
): void;
getBounds(): DOMRect;
toJSON(): Object;
}
declare class DOMRect extends DOMRectReadOnly {
height: number;
width: number;
x: number;
y: number;
constructor(x?: number, y?: number, width?: number, height?: number): void;
static fromRect(other?: DOMRectInit): DOMRect;
}
declare class DOMRectList {
+length: number;
@@iterator(): Iterator<DOMRect>;
item(index: number): DOMRect;
[index: number]: DOMRect;
}
declare class DOMRectReadOnly {
+bottom: number;
+height: number;
+left: number;
+right: number;
+top: number;
+width: number;
+x: number;
+y: number;
constructor(x?: number, y?: number, width?: number, height?: number): void;
static fromRect(other?: DOMRectInit): DOMRectReadOnly;
toJSON(): Object;
}

1710
flow-typed/environments/html.js vendored Normal file

File diff suppressed because it is too large Load Diff

4286
flow-typed/environments/node.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,248 @@
// flow-typed signature: f6bda44505d6258bae702a65ee2878f2
// flow-typed version: 840509ea9d/serviceworkers/flow_>=v0.261.x
type FrameType = 'auxiliary' | 'top-level' | 'nested' | 'none';
type VisibilityState = 'hidden' | 'visible' | 'prerender' | 'unloaded';
declare class WindowClient extends Client {
visibilityState: VisibilityState;
focused: boolean;
focus(): Promise<WindowClient>;
navigate(url: string): Promise<WindowClient>;
}
declare class Client {
id: string;
reserved: boolean;
url: string;
frameType: FrameType;
postMessage(message: any, transfer?: Iterator<any> | Array<any>): void;
}
declare class ExtendableEvent extends Event {
waitUntil(f: Promise<mixed>): void;
}
type NotificationEvent$Init = {
...Event$Init,
notification: Notification,
action?: string,
...
};
declare class NotificationEvent extends ExtendableEvent {
constructor(type: string, eventInitDict?: NotificationEvent$Init): void;
+notification: Notification;
+action: string;
}
type ForeignFetchOptions = {
scopes: Iterator<string>,
origins: Iterator<string>,
...
};
declare class InstallEvent extends ExtendableEvent {
registerForeignFetch(options: ForeignFetchOptions): void;
}
declare class FetchEvent extends ExtendableEvent {
request: Request;
clientId: string;
isReload: boolean;
respondWith(response: Response | Promise<Response>): void;
preloadResponse: Promise<?Response>;
}
type ClientType = 'window' | 'worker' | 'sharedworker' | 'all';
type ClientQueryOptions = {
includeUncontrolled?: boolean,
includeReserved?: boolean,
type?: ClientType,
...
};
declare class Clients {
get(id: string): Promise<?Client>;
matchAll(options?: ClientQueryOptions): Promise<Array<Client>>;
openWindow(url: string): Promise<?WindowClient>;
claim(): Promise<void>;
}
type ServiceWorkerState =
| 'installing'
| 'installed'
| 'activating'
| 'activated'
| 'redundant';
declare class ServiceWorker extends EventTarget {
scriptURL: string;
state: ServiceWorkerState;
postMessage(message: any, transfer?: Iterator<any>): void;
onstatechange?: EventHandler;
}
declare class NavigationPreloadState {
enabled: boolean;
headerValue: string;
}
declare class NavigationPreloadManager {
enable: Promise<void>;
disable: Promise<void>;
setHeaderValue(value: string): Promise<void>;
getState: Promise<NavigationPreloadState>;
}
type PushSubscriptionOptions = {
userVisibleOnly?: boolean,
applicationServerKey?: string | ArrayBuffer | $ArrayBufferView,
...
};
declare class PushSubscriptionJSON {
endpoint: string;
expirationTime: number | null;
keys: {[string]: string, ...};
}
declare class PushSubscription {
+endpoint: string;
+expirationTime: number | null;
+options: PushSubscriptionOptions;
getKey(name: string): ArrayBuffer | null;
toJSON(): PushSubscriptionJSON;
unsubscribe(): Promise<boolean>;
}
declare class PushManager {
+supportedContentEncodings: Array<string>;
subscribe(options?: PushSubscriptionOptions): Promise<PushSubscription>;
getSubscription(): Promise<PushSubscription | null>;
permissionState(
options?: PushSubscriptionOptions
): Promise<'granted' | 'denied' | 'prompt'>;
}
type ServiceWorkerUpdateViaCache = 'imports' | 'all' | 'none';
type GetNotificationOptions = {
tag?: string,
...
};
declare class ServiceWorkerRegistration extends EventTarget {
+installing: ?ServiceWorker;
+waiting: ?ServiceWorker;
+active: ?ServiceWorker;
+navigationPreload: NavigationPreloadManager;
+scope: string;
+updateViaCache: ServiceWorkerUpdateViaCache;
+pushManager: PushManager;
getNotifications?: (
filter?: GetNotificationOptions
) => Promise<$ReadOnlyArray<Notification>>;
showNotification?: (
title: string,
options?: NotificationOptions
) => Promise<void>;
update(): Promise<void>;
unregister(): Promise<boolean>;
onupdatefound?: EventHandler;
}
type WorkerType = 'classic' | 'module';
type RegistrationOptions = {
scope?: string,
type?: WorkerType,
updateViaCache?: ServiceWorkerUpdateViaCache,
...
};
declare class ServiceWorkerContainer extends EventTarget {
+controller: ?ServiceWorker;
+ready: Promise<ServiceWorkerRegistration>;
getRegistration(
clientURL?: string
): Promise<ServiceWorkerRegistration | void>;
getRegistrations(): Promise<Iterator<ServiceWorkerRegistration>>;
register(
scriptURL: string | TrustedScriptURL,
options?: RegistrationOptions
): Promise<ServiceWorkerRegistration>;
startMessages(): void;
oncontrollerchange?: EventHandler;
onmessage?: EventHandler;
onmessageerror?: EventHandler;
}
/**
* This feature has been removed from the Web standards.
*/
declare class ServiceWorkerMessageEvent extends Event {
data: any;
lastEventId: string;
origin: string;
ports: Array<MessagePort>;
source: ?(ServiceWorker | MessagePort);
}
declare class ExtendableMessageEvent extends ExtendableEvent {
data: any;
lastEventId: string;
origin: string;
ports: Array<MessagePort>;
source: ?(ServiceWorker | MessagePort);
}
type CacheQueryOptions = {
ignoreSearch?: boolean,
ignoreMethod?: boolean,
ignoreVary?: boolean,
cacheName?: string,
...
};
declare class Cache {
match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response>;
matchAll(
request: RequestInfo,
options?: CacheQueryOptions
): Promise<Array<Response>>;
add(request: RequestInfo): Promise<void>;
addAll(requests: Array<RequestInfo>): Promise<void>;
put(request: RequestInfo, response: Response): Promise<void>;
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
keys(
request?: RequestInfo,
options?: CacheQueryOptions
): Promise<Array<Request>>;
}
declare class CacheStorage {
match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response>;
has(cacheName: string): Promise<true>;
open(cacheName: string): Promise<Cache>;
delete(cacheName: string): Promise<boolean>;
keys(): Promise<Array<string>>;
}
// Service worker global scope
// https://www.w3.org/TR/service-workers/#service-worker-global-scope
declare var clients: Clients;
declare var caches: CacheStorage;
declare var registration: ServiceWorkerRegistration;
declare function skipWaiting(): Promise<void>;
declare var onactivate: ?EventHandler;
declare var oninstall: ?EventHandler;
declare var onfetch: ?EventHandler;
declare var onforeignfetch: ?EventHandler;
declare var onmessage: ?EventHandler;

136
flow-typed/environments/streams.js vendored Normal file
View File

@@ -0,0 +1,136 @@
// flow-typed signature: e6e6768618776352dd676f63502aea4d
// flow-typed version: 40e7dfcbd5/streams/flow_>=v0.261.x
type TextEncodeOptions = {options?: boolean, ...};
declare class ReadableStreamController {
constructor(
stream: ReadableStream,
underlyingSource: UnderlyingSource,
size: number,
highWaterMark: number
): void;
desiredSize: number;
close(): void;
enqueue(chunk: any): void;
error(error: Error): void;
}
declare class ReadableStreamBYOBRequest {
constructor(controller: ReadableStreamController, view: $TypedArray): void;
view: $TypedArray;
respond(bytesWritten: number): ?any;
respondWithNewView(view: $TypedArray): ?any;
}
declare class ReadableByteStreamController extends ReadableStreamController {
constructor(
stream: ReadableStream,
underlyingSource: UnderlyingSource,
highWaterMark: number
): void;
byobRequest: ReadableStreamBYOBRequest;
}
declare class ReadableStreamReader {
constructor(stream: ReadableStream): void;
closed: boolean;
cancel(reason: string): void;
read(): Promise<{
value: ?any,
done: boolean,
...
}>;
releaseLock(): void;
}
declare interface UnderlyingSource {
autoAllocateChunkSize?: number;
type?: string;
start?: (controller: ReadableStreamController) => ?Promise<void>;
pull?: (controller: ReadableStreamController) => ?Promise<void>;
cancel?: (reason: string) => ?Promise<void>;
}
declare class TransformStream {
readable: ReadableStream;
writable: WritableStream;
}
interface PipeThroughTransformStream {
readable: ReadableStream;
writable: WritableStream;
}
type PipeToOptions = {
preventClose?: boolean,
preventAbort?: boolean,
preventCancel?: boolean,
...
};
type QueuingStrategy = {
highWaterMark: number,
size(chunk: ?any): number,
...
};
declare class ReadableStream {
constructor(
underlyingSource: ?UnderlyingSource,
queuingStrategy: ?QueuingStrategy
): void;
locked: boolean;
cancel(reason: string): void;
getReader(): ReadableStreamReader;
pipeThrough(transform: PipeThroughTransformStream, options: ?any): void;
pipeTo(dest: WritableStream, options: ?PipeToOptions): Promise<void>;
tee(): [ReadableStream, ReadableStream];
}
declare interface WritableStreamController {
error(error: Error): void;
}
declare interface UnderlyingSink {
autoAllocateChunkSize?: number;
type?: string;
abort?: (reason: string) => ?Promise<void>;
close?: (controller: WritableStreamController) => ?Promise<void>;
start?: (controller: WritableStreamController) => ?Promise<void>;
write?: (chunk: any, controller: WritableStreamController) => ?Promise<void>;
}
declare interface WritableStreamWriter {
closed: Promise<any>;
desiredSize?: number;
ready: Promise<any>;
abort(reason: string): ?Promise<any>;
close(): Promise<any>;
releaseLock(): void;
write(chunk: any): Promise<any>;
}
declare class WritableStream {
constructor(
underlyingSink: ?UnderlyingSink,
queuingStrategy: QueuingStrategy
): void;
locked: boolean;
abort(reason: string): void;
getWriter(): WritableStreamWriter;
}

View File

@@ -0,0 +1,193 @@
// flow-typed signature: 4631a74b6a0e6a1b4de2ba8c7bb141d6
// flow-typed version: 3e51657e95/web-animations/flow_>=v0.261.x
// https://www.w3.org/TR/web-animations-1/
type AnimationPlayState = 'idle' | 'running' | 'paused' | 'finished';
type AnimationReplaceState = 'active' | 'removed' | 'persisted';
type CompositeOperation = 'replace' | 'add' | 'accumulate';
type CompositeOperationOrAuto = 'replace' | 'add' | 'accumulate' | 'auto';
type FillMode = 'none' | 'forwards' | 'backwards' | 'both' | 'auto';
// This is actually web-animations-2
type IterationCompositeOperation = 'replace' | 'accumulate';
type PlaybackDirection =
| 'normal'
| 'reverse'
| 'alternate'
| 'alternate-reverse';
type AnimationPlaybackEvent$Init = Event$Init & {
currentTime?: number | null,
timelineTime?: number | null,
...
};
type BaseComputedKeyframe = {|
composite: CompositeOperationOrAuto,
computedOffset: number,
easing: string,
offset: number | null,
|};
type BaseKeyframe = {|
composite: CompositeOperationOrAuto,
easing: string,
offset: number | null,
|};
type BasePropertyIndexedKeyframe = {|
composite: CompositeOperationOrAuto | Array<CompositeOperationOrAuto>,
easing: string | Array<string>,
offset: number | null | Array<number | null>,
|};
type ComputedEffectTiming = {|
...EffectTiming,
currentIteration: number | null,
progress: number | null,
|};
type ComputedKeyframe = {
composite: CompositeOperationOrAuto,
computedOffset: number,
easing: string,
offset: number | null,
[property: string]: string | number | null | void,
...
};
type DocumentTimelineOptions = {|
originTime: number,
|};
type EffectTiming = {|
direction: PlaybackDirection,
easing: string,
fill: FillMode,
iterations: number,
iterationStart: number,
|};
type GetAnimationsOptions = {|
pseudoElement: string | null,
subtree: boolean,
|};
type KeyframeAnimationOptions = {|
...KeyframeEffectOptions,
id: string,
timeline: AnimationTimeline | null,
|};
type KeyframeEffectOptions = {|
...EffectTiming,
composite: CompositeOperation,
pseudoElement: string | null,
|};
type Keyframe = {
composite?: CompositeOperationOrAuto,
easing?: string,
offset?: number | null,
[property: string]: string | number | null | void,
...
};
type OptionalEffectTiming = Partial<EffectTiming>;
type PropertyIndexedKeyframes = {
composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[],
easing?: string | string[],
offset?: number | (number | null)[],
[property: string]:
| string
| string[]
| number
| null
| (number | null)[]
| void,
...
};
declare class Animation extends EventTarget {
constructor(
effect?: AnimationEffect | null,
timeline?: AnimationTimeline | null
): void;
id: string;
effect: AnimationEffect | null;
timeline: AnimationTimeline | null;
startTime: number | null;
currentTime: number | null;
playbackRate: number;
+playState: AnimationPlayState;
+replaceState: AnimationReplaceState;
+pending: boolean;
+ready: Promise<Animation>;
+finished: Promise<Animation>;
onfinish: ?(ev: AnimationPlaybackEvent) => mixed;
oncancel: ?(ev: AnimationPlaybackEvent) => mixed;
onremove: ?(ev: AnimationPlaybackEvent) => mixed;
cancel(): void;
finish(): void;
play(): void;
pause(): void;
updatePlaybackRate(playbackRate: number): void;
reverse(): void;
persist(): void;
commitStyles(): void;
}
declare class AnimationEffect {
getTiming(): EffectTiming;
getComputedTiming(): ComputedEffectTiming;
updateTiming(timing?: OptionalEffectTiming): void;
}
declare class AnimationPlaybackEvent extends Event {
constructor(
type: string,
animationEventInitDict?: AnimationPlaybackEvent$Init
): void;
+currentTime: number | null;
+timelineTime: number | null;
}
declare class AnimationTimeline {
+currentTime: number | null;
}
declare class DocumentTimeline extends AnimationTimeline {
constructor(options?: DocumentTimelineOptions): void;
}
declare class KeyframeEffect extends AnimationEffect {
constructor(
target: Element | null,
keyframes: Keyframe[] | PropertyIndexedKeyframes | null,
options?: number | KeyframeEffectOptions
): void;
constructor(source: KeyframeEffect): void;
target: Element | null;
composite: CompositeOperation;
// This is actually web-animations-2
iterationComposite: IterationCompositeOperation;
getKeyframes(): ComputedKeyframe[];
setKeyframes(keyframes: Keyframe[] | PropertyIndexedKeyframes | null): void;
}
declare class mixin$Animatable {
animate(
keyframes: Keyframe[] | PropertyIndexedKeyframes | null,
options?: number | KeyframeAnimationOptions
): Animation;
getAnimations(options?: GetAnimationsOptions): Array<Animation>;
}

View File

@@ -0,0 +1,60 @@
// flow-typed signature: 132e48034ef4756600e1d98681a166b5
// flow-typed version: c6154227d1/error-stack-parser_v2.x.x/flow_>=v0.104.x
declare module 'error-stack-parser' {
declare interface StackFrame {
constructor(object: StackFrame): StackFrame;
isConstructor?: boolean;
getIsConstructor(): boolean;
setIsConstructor(): void;
isEval?: boolean;
getIsEval(): boolean;
setIsEval(): void;
isNative?: boolean;
getIsNative(): boolean;
setIsNative(): void;
isTopLevel?: boolean;
getIsTopLevel(): boolean;
setIsTopLevel(): void;
columnNumber?: number;
getColumnNumber(): number;
setColumnNumber(): void;
lineNumber?: number;
getLineNumber(): number;
setLineNumber(): void;
fileName?: string;
getFileName(): string;
setFileName(): void;
functionName?: string;
getFunctionName(): string;
setFunctionName(): void;
source?: string;
getSource(): string;
setSource(): void;
args?: any[];
getArgs(): any[];
setArgs(): void;
evalOrigin?: StackFrame;
getEvalOrigin(): StackFrame;
setEvalOrigin(): void;
toString(): string;
}
declare class ErrorStackParser {
parse(error: Error): Array<StackFrame>;
}
declare module.exports: ErrorStackParser;
}

27
flow-typed/npm/minimist_v1.x.x.js vendored Normal file
View File

@@ -0,0 +1,27 @@
// flow-typed signature: d48da8db828529253fc20b80747846ea
// flow-typed version: c6154227d1/minimist_v1.x.x/flow_>=v0.104.x
declare module 'minimist' {
declare type minimistOptions = {
string?: string | Array<string>,
boolean?: boolean | string | Array<string>,
alias?: {[arg: string]: string | Array<string>, ...},
default?: {[arg: string]: any, ...},
stopEarly?: boolean,
// TODO: Strings as keys don't work...
// '--'? boolean,
unknown?: (param: string) => boolean,
...
};
declare type minimistOutput = {
[flag: string]: string | boolean,
_: Array<string>,
...
};
declare module.exports: (
argv: Array<string>,
opts?: minimistOptions
) => minimistOutput;
}

View File

@@ -74,8 +74,9 @@
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "^3.0.1",
"filesize": "^6.0.1",
"flow-bin": "^0.261",
"flow-remove-types": "^2.261",
"flow-bin": "^0.265",
"flow-remove-types": "^2.265",
"flow-typed": "^4.1.1",
"glob": "^7.1.6",
"glob-stream": "^6.1.0",
"google-closure-compiler": "^20230206.0.0",
@@ -126,6 +127,7 @@
"build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
"build-for-flight-dev": "cross-env RELEASE_CHANNEL=experimental node ./scripts/rollup/build.js react/index,react/jsx,react.react-server,react-dom/index,react-dom/client,react-dom/server,react-dom.react-server,react-dom-server.node,react-dom-server-legacy.node,scheduler,react-server-dom-webpack/ --type=NODE_DEV,ESM_PROD,NODE_ES2015 && mv ./build/node_modules ./build/oss-experimental",
"build-for-vt-dev": "cross-env RELEASE_CHANNEL=experimental node ./scripts/rollup/build.js react/index,react/jsx,react-dom/index,react-dom/client,react-dom/server,react-dom-server.node,react-dom-server-legacy.node,scheduler --type=NODE_DEV && mv ./build/node_modules ./build/oss-experimental",
"flow-typed-install": "yarn flow-typed install --skip --skipFlowRestart --ignore-deps=dev",
"linc": "node ./scripts/tasks/linc.js",
"lint": "node ./scripts/tasks/eslint.js",
"lint-build": "node ./scripts/rollup/validate/index.js",

View File

@@ -11,6 +11,7 @@ const {MessageChannel} = require('node:worker_threads');
export default function enqueueTask(task: () => void): void {
const channel = new MessageChannel();
// $FlowFixMe[prop-missing]
channel.port1.onmessage = () => {
channel.port1.close();
task();

View File

@@ -278,6 +278,7 @@ export function createProfilingHooks({
const top = currentReactMeasuresStack.pop();
// $FlowFixMe[incompatible-type]
// $FlowFixMe[incompatible-use]
if (top.type !== type) {
console.error(
'Unexpected type "%s" completed at %sms before "%s" completed.',

View File

@@ -40,6 +40,7 @@ export function getOwnerIframe(node: HTMLElement): HTMLElement | null {
// offset added to compensate for its border.
export function getBoundingClientRectWithBorderOffset(node: HTMLElement): Rect {
const dimensions = getElementDimensions(node);
// $FlowFixMe[incompatible-variance]
return mergeRectOffsets([
node.getBoundingClientRect(),
{
@@ -102,8 +103,10 @@ export function getNestedBoundingClientRect(
}
}
// $FlowFixMe[incompatible-variance]
return mergeRectOffsets(rects);
} else {
// $FlowFixMe[incompatible-variance]
return node.getBoundingClientRect();
}
}

View File

@@ -24,6 +24,7 @@ import SettingsModal from 'react-devtools-shared/src/devtools/views/Settings/Set
import {NativeStyleContextController} from './NativeStyleEditor/context';
import styles from './Components.css';
import typeof {SyntheticPointerEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
type Orientation = 'horizontal' | 'vertical';
@@ -79,17 +80,17 @@ function Components(_: {}) {
return () => clearTimeout(timeoutID);
}, [horizontalPercentage, verticalPercentage]);
const onResizeStart = (event: SyntheticPointerEvent<HTMLElement>) => {
const onResizeStart = (event: SyntheticPointerEvent) => {
const element = event.currentTarget;
element.setPointerCapture(event.pointerId);
};
const onResizeEnd = (event: SyntheticPointerEvent<HTMLElement>) => {
const onResizeEnd = (event: SyntheticPointerEvent) => {
const element = event.currentTarget;
element.releasePointerCapture(event.pointerId);
};
const onResize = (event: SyntheticPointerEvent<HTMLElement>) => {
const onResize = (event: SyntheticPointerEvent) => {
const element = event.currentTarget;
const isResizing = element.hasPointerCapture(event.pointerId);
if (!isResizing) {

View File

@@ -20,6 +20,7 @@ import {withPermissionsCheck} from 'react-devtools-shared/src/frontend/utils/wit
import StackTraceView from './StackTraceView';
import OwnerView from './OwnerView';
import {meta} from '../../../hydration';
import useInferredName from '../useInferredName';
import type {
InspectedElement,
@@ -101,21 +102,7 @@ function SuspendedByRow({
}: RowProps) {
const [isOpen, setIsOpen] = useState(false);
const ioInfo = asyncInfo.awaited;
let name = ioInfo.name;
if (name === '' || name === 'Promise') {
// If all we have is a generic name, we can try to infer a better name from
// the stack. We only do this if the stack has more than one frame since
// otherwise it's likely to just be the name of the component which isn't better.
const bestStack = ioInfo.stack || asyncInfo.stack;
if (bestStack !== null && bestStack.length > 1) {
// TODO: Ideally we'd get the name from the last ignore listed frame before the
// first visible frame since this is the same algorithm as the Flight server uses.
// Ideally, we'd also get the name from the source mapped entry instead of the
// original entry. However, that would require suspending the immediate display
// of these rows to first do source mapping before we can show the name.
name = bestStack[0][0];
}
}
const name = useInferredName(asyncInfo);
const description = ioInfo.description;
const longName = description === '' ? name : name + ' (' + description + ')';
const shortDescription = getShortDescription(name, description);

View File

@@ -10,16 +10,17 @@
import * as React from 'react';
import styles from './ChartNode.css';
import typeof {SyntheticMouseEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
type Props = {
color: string,
height: number,
isDimmed?: boolean,
label: string,
onClick: (event: SyntheticMouseEvent<any>) => mixed,
onDoubleClick?: (event: SyntheticMouseEvent<any>) => mixed,
onMouseEnter: (event: SyntheticMouseEvent<any>) => mixed,
onMouseLeave: (event: SyntheticMouseEvent<any>) => mixed,
onClick: (event: SyntheticMouseEvent) => mixed,
onDoubleClick?: (event: SyntheticMouseEvent) => mixed,
onMouseEnter: (event: SyntheticMouseEvent) => mixed,
onMouseLeave: (event: SyntheticMouseEvent) => mixed,
placeLabelAboveNode?: boolean,
textStyle?: Object,
width: number,

View File

@@ -17,6 +17,7 @@ import {SettingsContext} from '../Settings/SettingsContext';
import type {ChartNode as ChartNodeType} from './FlamegraphChartBuilder';
import type {ItemData} from './CommitFlamegraph';
import typeof {SyntheticMouseEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
type Props = {
data: ItemData,
@@ -41,7 +42,7 @@ function CommitFlamegraphListItem({data, index, style}: Props): React.Node {
const {lineHeight} = useContext(SettingsContext);
const handleClick = useCallback(
(event: SyntheticMouseEvent<EventTarget>, id: number, name: string) => {
(event: SyntheticMouseEvent, id: number, name: string) => {
event.stopPropagation();
selectFiber(id, name);
},

View File

@@ -4,6 +4,7 @@ import * as React from 'react';
import {useRef} from 'react';
import styles from './Tooltip.css';
import typeof {SyntheticMouseEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
const initialTooltipState = {height: 0, mouseX: 0, mouseY: 0, width: 0};
@@ -17,7 +18,7 @@ export default function Tooltip({
const tooltipRef = useRef(null);
// update the position of the tooltip based on current mouse position
const updateTooltipPosition = (event: SyntheticMouseEvent<EventTarget>) => {
const updateTooltipPosition = (event: SyntheticMouseEvent) => {
const element = tooltipRef.current;
if (element != null) {
// first find the mouse position
@@ -30,7 +31,7 @@ export default function Tooltip({
}
};
const onMouseMove = (event: SyntheticMouseEvent<EventTarget>) => {
const onMouseMove = (event: SyntheticMouseEvent) => {
updateTooltipPosition(event);
};
@@ -94,7 +95,7 @@ function getTooltipPosition(
// method used to find the current mouse position inside the container
function getMousePosition(
relativeContainer: null,
mouseEvent: SyntheticMouseEvent<EventTarget>,
mouseEvent: SyntheticMouseEvent,
) {
if (relativeContainer !== null) {
// Position within the nearest position:relative container.

View File

@@ -14,6 +14,7 @@ import {StoreContext} from '../context';
import {ProfilerContext} from 'react-devtools-shared/src/devtools/views/Profiler/ProfilerContext';
import styles from './SettingsShared.css';
import typeof {SyntheticEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
export default function ProfilerSettings(_: {}): React.Node {
const {
@@ -45,7 +46,7 @@ export default function ProfilerSettings(_: {}): React.Node {
[store],
);
const updateMinCommitDuration = useCallback(
(event: SyntheticEvent<HTMLInputElement>) => {
(event: SyntheticEvent) => {
const newValue = parseFloat(event.currentTarget.value);
setMinCommitDuration(
Number.isNaN(newValue) || newValue <= 0 ? 0 : newValue,
@@ -54,7 +55,7 @@ export default function ProfilerSettings(_: {}): React.Node {
[setMinCommitDuration],
);
const updateIsCommitFilterEnabled = useCallback(
(event: SyntheticEvent<HTMLInputElement>) => {
(event: SyntheticEvent) => {
const checked = event.currentTarget.checked;
setIsCommitFilterEnabled(checked);
if (checked) {

View File

@@ -23,6 +23,10 @@ import {StoreContext} from '../context';
import {useHighlightHostInstance} from '../hooks';
import styles from './SuspenseRects.css';
import {SuspenseTreeStateContext} from './SuspenseTreeContext';
import typeof {
SyntheticMouseEvent,
SyntheticPointerEvent,
} from 'react-dom-bindings/src/events/SyntheticEvent';
function SuspenseRect({rect}: {rect: Rect}): React$Node {
return (
@@ -55,7 +59,7 @@ function SuspenseRects({
return null;
}
function handleClick(event: SyntheticMouseEvent<>) {
function handleClick(event: SyntheticMouseEvent) {
if (event.defaultPrevented) {
// Already clicked on an inner rect
return;
@@ -64,7 +68,7 @@ function SuspenseRects({
dispatch({type: 'SELECT_ELEMENT_BY_ID', payload: suspenseID});
}
function handlePointerOver(event: SyntheticPointerEvent<>) {
function handlePointerOver(event: SyntheticPointerEvent) {
if (event.defaultPrevented) {
// Already hovered an inner rect
return;
@@ -73,7 +77,7 @@ function SuspenseRects({
highlightHostInstance(suspenseID);
}
function handlePointerLeave(event: SyntheticPointerEvent<>) {
function handlePointerLeave(event: SyntheticPointerEvent) {
if (event.defaultPrevented) {
// Already hovered an inner rect
return;

View File

@@ -22,6 +22,7 @@ import styles from './SuspenseTab.css';
import SuspenseRects from './SuspenseRects';
import SuspenseTreeList from './SuspenseTreeList';
import Button from '../Button';
import typeof {SyntheticPointerEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
type Orientation = 'horizontal' | 'vertical';
@@ -180,17 +181,17 @@ function SuspenseTab(_: {}) {
treeListHorizontalFraction,
]);
const onResizeStart = (event: SyntheticPointerEvent<HTMLElement>) => {
const onResizeStart = (event: SyntheticPointerEvent) => {
const element = event.currentTarget;
element.setPointerCapture(event.pointerId);
};
const onResizeEnd = (event: SyntheticPointerEvent<HTMLElement>) => {
const onResizeEnd = (event: SyntheticPointerEvent) => {
const element = event.currentTarget;
element.releasePointerCapture(event.pointerId);
};
const onResizeTree = (event: SyntheticPointerEvent<HTMLElement>) => {
const onResizeTree = (event: SyntheticPointerEvent) => {
const element = event.currentTarget;
const isResizing = element.hasPointerCapture(event.pointerId);
if (!isResizing) {
@@ -241,7 +242,7 @@ function SuspenseTab(_: {}) {
}
};
const onResizeTreeList = (event: SyntheticPointerEvent<HTMLElement>) => {
const onResizeTreeList = (event: SyntheticPointerEvent) => {
const element = event.currentTarget;
const isResizing = element.hasPointerCapture(event.pointerId);
if (!isResizing) {

View File

@@ -0,0 +1,78 @@
import {use, useContext, useDeferredValue} from 'react';
import type {ReactCallSite} from 'shared/ReactTypes';
import type {SourceMappedLocation} from 'react-devtools-shared/src/symbolicateSource';
import type {SerializedAsyncInfo} from 'react-devtools-shared/src/frontend/types';
import FetchFileWithCachingContext from './Components/FetchFileWithCachingContext';
import {symbolicateSourceWithCache} from 'react-devtools-shared/src/symbolicateSource';
export default function useInferredName(
asyncInfo: SerializedAsyncInfo,
): string {
const fetchFileWithCaching = useContext(FetchFileWithCachingContext);
const name = asyncInfo.awaited.name;
let inferNameFromStack = null;
if (!name || name === 'Promise') {
// If all we have is a generic name, we can try to infer a better name from
// the stack. We only do this if the stack has more than one frame since
// otherwise it's likely to just be the name of the component which isn't better.
const bestStack = asyncInfo.awaited.stack || asyncInfo.stack;
if (bestStack !== null && bestStack.length > 1) {
inferNameFromStack = bestStack;
}
}
// Start by not source mapping and just taking the first name and upgrade to
// the better name asynchronously if we find one. Most of the time it'll just be
// the top of the stack.
const shouldSourceMap = useDeferredValue(inferNameFromStack !== null, false);
if (inferNameFromStack !== null) {
if (shouldSourceMap) {
let bestMatch = '';
for (let i = 0; i < inferNameFromStack.length; i++) {
const callSite: ReactCallSite = inferNameFromStack[i];
const [virtualFunctionName, virtualURL, virtualLine, virtualColumn] =
callSite;
const symbolicatedCallSite: null | SourceMappedLocation =
fetchFileWithCaching !== null
? use(
symbolicateSourceWithCache(
fetchFileWithCaching,
virtualURL,
virtualLine,
virtualColumn,
),
)
: null;
if (symbolicatedCallSite === null) {
// If we can't source map, we treat it as first party code. We called whatever was
// the previous callsite.
if (bestMatch === '') {
return virtualFunctionName || name;
} else {
return bestMatch;
}
} else if (!symbolicatedCallSite.ignored) {
if (bestMatch === '') {
// If we had no good stack frames for internal calls, just use the last
// first party function name.
return symbolicatedCallSite[0] || virtualFunctionName || name;
} else {
return bestMatch;
}
} else {
// This line was ignore listed, it might be the one we called into from first party.
bestMatch = symbolicatedCallSite[0] || virtualFunctionName;
}
}
return name;
} else {
return inferNameFromStack[0][0];
}
} else {
return name;
}
}

View File

@@ -28,6 +28,7 @@ import {
enableScopeAPI,
enableCreateEventHandleAPI,
} from 'shared/ReactFeatureFlags';
import typeof {SyntheticEvent} from '../events/SyntheticEvent';
type EventHandleOptions = {
capture?: boolean,
@@ -44,7 +45,7 @@ function isReactScope(target: EventTarget | ReactScopeInstance): boolean {
function createEventHandleListener(
type: DOMEventName,
isCapturePhaseListener: boolean,
callback: (SyntheticEvent<EventTarget>) => void,
callback: SyntheticEvent => void,
): ReactDOMEventHandleListener {
return {
callback,
@@ -111,7 +112,7 @@ export function createEventHandle(
const eventHandle: ReactDOMEventHandle = (
target: EventTarget | ReactScopeInstance,
callback: (SyntheticEvent<EventTarget>) => void,
callback: SyntheticEvent => void,
) => {
if (typeof callback !== 'function') {
throw new Error(

View File

@@ -9,14 +9,15 @@
import type {ReactScopeInstance} from 'shared/ReactTypes';
import type {DOMEventName} from '../events/DOMEventNames';
import typeof {SyntheticEvent} from '../events/SyntheticEvent';
export type ReactDOMEventHandle = (
target: EventTarget | ReactScopeInstance,
callback: (SyntheticEvent<EventTarget>) => void,
callback: (SyntheticEvent) => void,
) => () => void;
export type ReactDOMEventHandleListener = {
callback: (SyntheticEvent<EventTarget>) => void,
callback: SyntheticEvent => void,
capture: boolean,
type: DOMEventName,
};

View File

@@ -242,10 +242,10 @@ export type TransitionStatus = FormStatus;
export type ViewTransitionInstance = {
name: string,
group: Animatable,
imagePair: Animatable,
old: Animatable,
new: Animatable,
group: mixin$Animatable,
imagePair: mixin$Animatable,
old: mixin$Animatable,
new: mixin$Animatable,
};
type SelectionInformation = {
@@ -1430,7 +1430,10 @@ export function applyViewTransitionName(
// simple case by converting it automatically to display: inline-block.
// https://bugs.webkit.org/show_bug.cgi?id=290923
const rects = instance.getClientRects();
if (countClientRects(rects) === 1) {
if (
// $FlowFixMe[incompatible-call]
countClientRects(rects) === 1
) {
// If the instance has a single client rect, that means that it can be
// expressed as a display: inline-block or block.
// This will cause layout thrash but we live with it since inline view transitions
@@ -1535,6 +1538,7 @@ export function cancelViewTransitionName(
if (documentElement !== null) {
documentElement.animate(
{opacity: [0, 0], pointerEvents: ['none', 'none']},
// $FlowFixMe[incompatible-call]
{
duration: 0,
fill: 'forwards',
@@ -1571,6 +1575,7 @@ export function cancelRootViewTransitionName(rootContainer: Container): void {
documentElement.style.viewTransitionName = 'none';
documentElement.animate(
{opacity: [0, 0], pointerEvents: ['none', 'none']},
// $FlowFixMe[incompatible-call]
{
duration: 0,
fill: 'forwards',
@@ -1586,6 +1591,7 @@ export function cancelRootViewTransitionName(rootContainer: Container): void {
// whatever is below the animation.
documentElement.animate(
{width: [0, 0], height: [0, 0]},
// $FlowFixMe[incompatible-call]
{
duration: 0,
fill: 'forwards',
@@ -1970,6 +1976,7 @@ export function hasInstanceAffectedParent(
function cancelAllViewTransitionAnimations(scope: Element) {
// In Safari, we need to manually cancel all manually start animations
// or it'll block or interfer with future transitions.
// $FlowFixMe[prop-missing]
const animations = scope.getAnimations({subtree: true});
for (let i = 0; i < animations.length; i++) {
const anim = animations[i];
@@ -2137,6 +2144,7 @@ export function startViewTransition(
const readyCallback = () => {
const documentElement: Element = (ownerDocument.documentElement: any);
// Loop through all View Transition Animations.
// $FlowFixMe[prop-missing]
const animations = documentElement.getAnimations({subtree: true});
for (let i = 0; i < animations.length; i++) {
const animation = animations[i];
@@ -2383,6 +2391,7 @@ function animateGesture(
const reverse = rangeStart > rangeEnd;
if (timeline instanceof AnimationTimeline) {
// Native Timeline
// $FlowFixMe[incompatible-call]
targetElement.animate(keyframes, {
pseudoElement: pseudoElement,
// Set the timeline to the current gesture timeline to drive the updates.
@@ -2403,6 +2412,7 @@ function animateGesture(
});
} else {
// Custom Timeline
// $FlowFixMe[incompatible-call]
const animation = targetElement.animate(keyframes, {
pseudoElement: pseudoElement,
// We reset all easing functions to linear so that it feels like you
@@ -2456,6 +2466,7 @@ export function startGestureTransition(
const readyCallback = () => {
const documentElement: Element = (ownerDocument.documentElement: any);
// Loop through all View Transition Animations.
// $FlowFixMe[prop-missing]
const animations = documentElement.getAnimations({subtree: true});
// First do a pass to collect all known group and new items so we can look
// up if they exist later.
@@ -2471,8 +2482,11 @@ export function startGestureTransition(
} else if (pseudoElement.startsWith('::view-transition')) {
const timing = effect.getTiming();
const duration =
// $FlowFixMe[prop-missing]
typeof timing.duration === 'number' ? timing.duration : 0;
// TODO: Consider interation count higher than 1.
// $FlowFixMe[prop-missing]
// $FlowFixMe[unsafe-addition]
const durationWithDelay = timing.delay + duration;
if (durationWithDelay > longestDuration) {
longestDuration = durationWithDelay;
@@ -2532,11 +2546,17 @@ export function startGestureTransition(
// therefore the timing is from the rangeEnd to the start.
const timing = effect.getTiming();
const duration =
// $FlowFixMe[prop-missing]
typeof timing.duration === 'number' ? timing.duration : 0;
let adjustedRangeStart =
// $FlowFixMe[unsafe-addition]
// $FlowFixMe[prop-missing]
rangeEnd - (duration + timing.delay) * durationToRangeMultipler;
let adjustedRangeEnd =
rangeEnd - timing.delay * durationToRangeMultipler;
rangeEnd -
// $FlowFixMe[prop-missing]
// $FlowFixMe[unsafe-arithmetic]
timing.delay * durationToRangeMultipler;
if (
timing.direction === 'reverse' ||
timing.direction === 'alternate-reverse'
@@ -2594,6 +2614,7 @@ export function startGestureTransition(
// you can swipe back again. We can prevent this by adding a paused Animation
// that never stops. This seems to keep all running Animations alive until
// we explicitly abort (or something forces the View Transition to cancel).
// $FlowFixMe[incompatible-call]
const blockingAnim = documentElement.animate([{}, {}], {
pseudoElement: '::view-transition',
duration: 1,
@@ -2658,7 +2679,7 @@ export function stopViewTransition(transition: RunningViewTransition) {
transition.skipTransition();
}
interface ViewTransitionPseudoElementType extends Animatable {
interface ViewTransitionPseudoElementType extends mixin$Animatable {
_scope: HTMLElement;
_selector: string;
getComputedStyle(): CSSStyleDeclaration;
@@ -2684,7 +2705,11 @@ ViewTransitionPseudoElement.prototype.animate = function (
? {
duration: options,
}
: Object.assign(({}: KeyframeAnimationOptions), options);
: Object.assign(
(// $FlowFixMe[prop-missing]
{}: KeyframeAnimationOptions),
options,
);
opts.pseudoElement = this._selector;
// TODO: Handle multiple child instances.
return this._scope.animate(keyframes, opts);
@@ -2696,7 +2721,10 @@ ViewTransitionPseudoElement.prototype.getAnimations = function (
): Animation[] {
const scope = this._scope;
const selector = this._selector;
const animations = scope.getAnimations({subtree: true});
const animations = scope.getAnimations(
// $FlowFixMe[prop-missing]
{subtree: true},
);
const result = [];
for (let i = 0; i < animations.length; i++) {
const effect: null | {
@@ -5335,6 +5363,7 @@ function insertStylesheet(
let prior = last;
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
// $FlowFixMe[prop-missing]
const nodePrecedence = node.dataset.precedence;
if (nodePrecedence === precedence) {
prior = node;
@@ -6110,7 +6139,11 @@ function insertStylesheetIntoRoot(
// and will be hoisted by the Fizz runtime imminently.
node.getAttribute('media') !== 'not all'
) {
precedences.set(node.dataset.precedence, node);
precedences.set(
// $FlowFixMe[prop-missing]
node.dataset.precedence,
node,
);
last = node;
}
}

View File

@@ -229,6 +229,7 @@ const MouseEventInterface: EventInterfaceType = {
return lastMovementY;
},
};
export const SyntheticMouseEvent: $FlowFixMe =
createSyntheticEvent(MouseEventInterface);

View File

@@ -59,6 +59,11 @@ const ariaProperties = {
'aria-rowindex': 0,
'aria-rowspan': 0,
'aria-setsize': 0,
// ARIA 1.3 Attributes
'aria-braillelabel': 0,
'aria-brailleroledescription': 0,
'aria-colindextext': 0,
'aria-rowindextext': 0,
};
export default ariaProperties;

View File

@@ -21,9 +21,7 @@ type ReactDOMInternals = {
p /* currentUpdatePriority */: EventPriority,
findDOMNode:
| null
| ((
componentOrElement: React$Component<any, any>,
) => null | Element | Text),
| ((componentOrElement: component(...props: any)) => null | Element | Text),
};
function requestFormReset(element: HTMLFormElement) {

View File

@@ -20,9 +20,7 @@ type ReactDOMInternals = {
p /* currentUpdatePriority */: EventPriority,
findDOMNode:
| null
| ((
componentOrElement: React$Component<any, any>,
) => null | Element | Text),
| ((componentOrElement: component(...props: any)) => null | Element | Text),
};
const DefaultDispatcher: HostDispatcher = {

View File

@@ -37,6 +37,27 @@ describe('ReactDOMInvalidARIAHook', () => {
it('should allow valid aria-* props', async () => {
await mountComponent({'aria-label': 'Bumble bees'});
});
it('should allow new ARIA 1.3 attributes', async () => {
// Test aria-braillelabel
await mountComponent({'aria-braillelabel': 'Braille label text'});
// Test aria-brailleroledescription
await mountComponent({'aria-brailleroledescription': 'Navigation menu'});
// Test aria-colindextext
await mountComponent({'aria-colindextext': 'Column A'});
// Test aria-rowindextext
await mountComponent({'aria-rowindextext': 'Row 1'});
// Test multiple ARIA 1.3 attributes together
await mountComponent({
'aria-braillelabel': 'Braille text',
'aria-colindextext': 'First column',
'aria-rowindextext': 'First row',
});
});
it('should warn for one invalid aria-* prop', async () => {
await mountComponent({'aria-badprop': 'maybe'});
assertConsoleErrorDev([

View File

@@ -41,7 +41,7 @@ if (__DEV__) {
}
function findDOMNode(
componentOrElement: React$Component<any, any>,
componentOrElement: component(...props: any),
): null | Element | Text {
return findHostInstance(componentOrElement);
}

View File

@@ -109,7 +109,7 @@ const flushSync: typeof flushSyncIsomorphic = disableLegacyMode
: flushSyncFromReconciler;
function findDOMNode(
componentOrElement: React$Component<any, any>,
componentOrElement: component(...props: any),
): null | Element | Text {
return findHostInstance(componentOrElement);
}

View File

@@ -39,7 +39,7 @@ export type CreateRootOptions = {
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
) => void,
onRecoverableError?: (
@@ -65,7 +65,7 @@ export type HydrateRootOptions = {
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
) => void,
onRecoverableError?: (

View File

@@ -106,7 +106,7 @@ function wwwOnCaughtError(
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(),
},
): void {
const errorBoundary = errorInfo.errorBoundary;
@@ -216,7 +216,7 @@ const noopOnDefaultTransitionIndicator = noop;
function legacyCreateRootFromDOMContainer(
container: Container,
initialChildren: ReactNodeList,
parentComponent: ?React$Component<any, any>,
parentComponent: ?component(...props: any),
callback: ?Function,
isHydrationContainer: boolean,
): FiberRoot {
@@ -314,12 +314,12 @@ function warnOnInvalidCallback(callback: mixed): void {
}
function legacyRenderSubtreeIntoContainer(
parentComponent: ?React$Component<any, any>,
parentComponent: ?component(...props: any),
children: ReactNodeList,
container: Container,
forceHydrate: boolean,
callback: ?Function,
): React$Component<any, any> | PublicInstance | null {
): component(...props: any) | PublicInstance | null {
if (__DEV__) {
topLevelUpdateWarnings(container);
warnOnInvalidCallback(callback === undefined ? null : callback);
@@ -352,7 +352,7 @@ function legacyRenderSubtreeIntoContainer(
}
export function findDOMNode(
componentOrElement: Element | ?React$Component<any, any>,
componentOrElement: Element | ?component(...props: any),
): null | Element | Text {
if (__DEV__) {
const owner = currentOwner;
@@ -387,7 +387,7 @@ export function render(
element: React$Element<any>,
container: Container,
callback: ?Function,
): React$Component<any, any> | PublicInstance | null {
): component(...props: any) | PublicInstance | null {
if (disableLegacyMode) {
if (__DEV__) {
console.error(

View File

@@ -78,7 +78,7 @@ function nativeOnCaughtError(
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
): void {
const errorBoundary = errorInfo.errorBoundary;

View File

@@ -93,7 +93,7 @@ function nativeOnCaughtError(
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
): void {
const errorBoundary = errorInfo.errorBoundary;

View File

@@ -1387,7 +1387,7 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
},
findInstance(
componentOrElement: Element | ?React$Component<any, any>,
componentOrElement: Element | ?component(...props: any),
): null | Instance | TextInstance {
if (componentOrElement == null) {
return null;

View File

@@ -61,7 +61,7 @@ export function defaultOnCaughtError(
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
): void {
// Overriding this can silence these warnings e.g. for tests.

View File

@@ -712,7 +712,6 @@ export function logTransitionStart(
const color = eventIsRepeat ? 'secondary-light' : 'warning';
if (__DEV__ && debugTask) {
debugTask.run(
// $FlowFixMe[method-unbinding]
console.timeStamp.bind(
console,
eventIsRepeat ? '' : 'Event: ' + eventType,

View File

@@ -138,7 +138,7 @@ if (__DEV__) {
}
function getContextForSubtree(
parentComponent: ?React$Component<any, any>,
parentComponent: ?component(...props: any),
): Object {
if (!parentComponent) {
return emptyContextObject;
@@ -248,7 +248,7 @@ export function createContainer(
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
) => void,
onRecoverableError: (
@@ -298,7 +298,7 @@ export function createHydrationContainer(
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
) => void,
onRecoverableError: (
@@ -355,7 +355,7 @@ export function createHydrationContainer(
export function updateContainer(
element: ReactNodeList,
container: OpaqueRoot,
parentComponent: ?React$Component<any, any>,
parentComponent: ?component(...props: any),
callback: ?Function,
): Lane {
const current = container.current;
@@ -374,7 +374,7 @@ export function updateContainer(
export function updateContainerSync(
element: ReactNodeList,
container: OpaqueRoot,
parentComponent: ?React$Component<any, any>,
parentComponent: ?component(...props: any),
callback: ?Function,
): Lane {
if (!disableLegacyMode && container.tag === LegacyRoot) {
@@ -397,7 +397,7 @@ function updateContainerImpl(
lane: Lane,
element: ReactNodeList,
container: OpaqueRoot,
parentComponent: ?React$Component<any, any>,
parentComponent: ?component(...props: any),
callback: ?Function,
): void {
if (__DEV__) {
@@ -471,7 +471,7 @@ export {
export function getPublicRootInstance(
container: OpaqueRoot,
): React$Component<any, any> | PublicInstance | null {
): component(...props: any) | PublicInstance | null {
const containerFiber = container.current;
if (!containerFiber.child) {
return null;

View File

@@ -176,7 +176,7 @@ export function createFiberRoot(
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
) => void,
onRecoverableError: (

View File

@@ -273,7 +273,7 @@ type BaseFiberRootProperties = {
error: mixed,
errorInfo: {
+componentStack?: ?string,
+errorBoundary?: ?React$Component<any, any>,
+errorBoundary?: ?component(...props: any),
},
) => void,
onRecoverableError: (

View File

@@ -671,8 +671,10 @@ export function isLikelyComponentType(type: any): boolean {
// This looks like a class.
return false;
}
// eslint-disable-next-line no-proto
if (type.prototype.__proto__ !== Object.prototype) {
if (
// $FlowFixMe[prop-missing]
type.prototype.__proto__ !== Object.prototype // eslint-disable-line no-proto
) {
// It has a superclass.
return false;
}

View File

@@ -79,7 +79,7 @@ function warnOnUndefinedDerivedState(type: any, partialState: any) {
}
function warnNoop(
publicInstance: React$Component<any, any>,
publicInstance: component(...props: any),
callerName: string,
) {
if (__DEV__) {

View File

@@ -473,7 +473,7 @@ function create(
toTree(): mixed,
update(newElement: React$Element<any>): any,
unmount(): void,
getInstance(): React$Component<any, any> | PublicInstance | null,
getInstance(): component(...props: any) | PublicInstance | null,
unstable_flushSync: typeof flushSyncFromReconciler,
} {
if (__DEV__) {

View File

@@ -17,83 +17,17 @@ declare const __REACT_DEVTOOLS_GLOBAL_HOOK__: any; /*?{
inject: ?((stuff: Object) => void)
};*/
declare const globalThis: Object;
declare const queueMicrotask: (fn: Function) => void;
declare const reportError: (error: mixed) => void;
declare const AggregateError: Class<Error>;
declare const FinalizationRegistry: any;
declare module 'create-react-class' {
declare const exports: $FlowFixMe;
}
declare module 'error-stack-parser' {
// flow-typed signature: 132e48034ef4756600e1d98681a166b5
// flow-typed version: c6154227d1/error-stack-parser_v2.x.x/flow_>=v0.104.x
declare interface StackFrame {
constructor(object: StackFrame): StackFrame;
isConstructor?: boolean;
getIsConstructor(): boolean;
setIsConstructor(): void;
isEval?: boolean;
getIsEval(): boolean;
setIsEval(): void;
isNative?: boolean;
getIsNative(): boolean;
setIsNative(): void;
isTopLevel?: boolean;
getIsTopLevel(): boolean;
setIsTopLevel(): void;
columnNumber?: number;
getColumnNumber(): number;
setColumnNumber(): void;
lineNumber?: number;
getLineNumber(): number;
setLineNumber(): void;
fileName?: string;
getFileName(): string;
setFileName(): void;
functionName?: string;
getFunctionName(): string;
setFunctionName(): void;
source?: string;
getSource(): string;
setSource(): void;
args?: any[];
getArgs(): any[];
setArgs(): void;
evalOrigin?: StackFrame;
getEvalOrigin(): StackFrame;
setEvalOrigin(): void;
toString(): string;
}
declare class ErrorStackParser {
parse(error: Error): Array<StackFrame>;
}
declare module.exports: ErrorStackParser;
}
declare interface ConsoleTask {
run<T>(f: () => T): T;
}
// $FlowFixMe[libdef-override]
declare var console: {
assert(condition: mixed, ...data: Array<any>): void,
clear(): void,
@@ -148,7 +82,7 @@ declare class ScrollTimeline extends AnimationTimeline {
// Flow hides the props of React$Element, this overrides it to unhide
// them for React internals.
// prettier-ignore
// $FlowFixMe[libdef-override]
declare opaque type React$Element<
+ElementType: React$ElementType,
+P = React$ElementProps<ElementType>,
@@ -227,100 +161,12 @@ declare var parcelRequire: {
},
};
declare module 'fs/promises' {
declare const access: (path: string, mode?: number) => Promise<void>;
declare const lstat: (
path: string,
options?: ?{bigint?: boolean},
) => Promise<mixed>;
declare const readdir: (
path: string,
options?:
| ?string
| {
encoding?: ?string,
withFileTypes?: ?boolean,
},
) => Promise<Buffer>;
declare const readFile: (
path: string,
options?:
| ?string
| {
encoding?: ?string,
},
) => Promise<Buffer>;
declare const readlink: (
path: string,
options?:
| ?string
| {
encoding?: ?string,
},
) => Promise<mixed>;
declare const realpath: (
path: string,
options?:
| ?string
| {
encoding?: ?string,
},
) => Promise<mixed>;
declare const stat: (
path: string,
options?: ?{bigint?: boolean},
) => Promise<mixed>;
}
declare module 'pg' {
declare const Pool: (options: mixed) => {
query: (query: string, values?: Array<mixed>) => void,
};
}
declare module 'util' {
declare function debuglog(section: string): (data: any, ...args: any) => void;
declare function format(format: string, ...placeholders: any): string;
declare function log(string: string): void;
declare function inspect(object: any, options?: util$InspectOptions): string;
declare function isArray(object: any): boolean;
declare function isRegExp(object: any): boolean;
declare function isDate(object: any): boolean;
declare function isError(object: any): boolean;
declare function inherits(
constructor: Function,
superConstructor: Function,
): void;
declare function deprecate(f: Function, string: string): Function;
declare function promisify(f: Function): Function;
declare function callbackify(f: Function): Function;
declare class TextDecoder {
constructor(
encoding?: string,
options?: {
fatal?: boolean,
ignoreBOM?: boolean,
...
},
): void;
decode(
input?: ArrayBuffer | DataView | $TypedArray,
options?: {stream?: boolean, ...},
): string;
encoding: string;
fatal: boolean;
ignoreBOM: boolean;
}
declare class TextEncoder {
constructor(encoding?: string): TextEncoder;
encode(buffer: string): Uint8Array;
encodeInto(
buffer: string,
dest: Uint8Array,
): {read: number, written: number};
encoding: string;
}
}
declare module 'busboy' {
import type {Writable, Readable} from 'stream';
@@ -456,13 +302,6 @@ declare const async_hooks: {
executionAsyncId(): number,
};
declare module 'node:worker_threads' {
declare class MessageChannel {
port1: MessagePort;
port2: MessagePort;
}
}
declare module 'jest-diff' {
declare type CompareKeys = ((a: string, b: string) => number) | void;
declare type DiffOptions = {

278
yarn.lock
View File

@@ -53,6 +53,15 @@
dependencies:
"@babel/highlight" "^7.12.13"
"@babel/code-frame@^7.16.7", "@babel/code-frame@^7.27.1":
version "7.27.1"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be"
integrity sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==
dependencies:
"@babel/helper-validator-identifier" "^7.27.1"
js-tokens "^4.0.0"
picocolors "^1.1.1"
"@babel/code-frame@^7.21.4":
version "7.24.7"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465"
@@ -70,15 +79,6 @@
js-tokens "^4.0.0"
picocolors "^1.0.0"
"@babel/code-frame@^7.27.1":
version "7.27.1"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be"
integrity sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==
dependencies:
"@babel/helper-validator-identifier" "^7.27.1"
js-tokens "^4.0.0"
picocolors "^1.1.1"
"@babel/code-frame@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e"
@@ -871,6 +871,16 @@
js-tokens "^4.0.0"
picocolors "^1.0.0"
"@babel/highlight@^7.16.7":
version "7.25.9"
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.9.tgz#8141ce68fc73757946f983b343f1231f4691acc6"
integrity sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==
dependencies:
"@babel/helper-validator-identifier" "^7.25.9"
chalk "^2.4.2"
js-tokens "^4.0.0"
picocolors "^1.0.0"
"@babel/highlight@^7.24.7":
version "7.24.7"
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d"
@@ -3272,6 +3282,18 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
"@kwsites/file-exists@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@kwsites/file-exists/-/file-exists-1.1.1.tgz#ad1efcac13e1987d8dbaf235ef3be5b0d96faa99"
integrity sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==
dependencies:
debug "^4.1.1"
"@kwsites/promise-deferred@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz#8ace5259254426ccef57f3175bc64ed7095ed919"
integrity sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==
"@leichtgewicht/ip-codec@^2.0.1":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b"
@@ -6335,6 +6357,11 @@ char-regex@^1.0.2:
resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf"
integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==
charenc@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==
cheerio-select@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4"
@@ -6641,7 +6668,7 @@ colors@1.0.3:
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=
colors@^1.1.2:
colors@1.4.0, colors@^1.1.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
@@ -6683,6 +6710,11 @@ commander@^4.0.0, commander@^4.0.1:
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
commander@^6.1.0:
version "6.2.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==
commander@^9.1.0:
version "9.5.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30"
@@ -7072,6 +7104,11 @@ crx@^5.0.0:
node-rsa "^1.0.5"
pbf "^3.2.0"
crypt@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==
crypto-browserify@~3.2.6:
version "3.2.8"
resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.2.8.tgz#b9b11dbe6d9651dd882a01e6cc467df718ecf189"
@@ -8253,7 +8290,7 @@ eslint-utils@^2.0.0, eslint-utils@^2.1.0:
dependencies:
eslint-visitor-keys "^1.1.0"
"eslint-v7@npm:eslint@^7.7.0", eslint@^7.7.0:
"eslint-v7@npm:eslint@^7.7.0":
version "7.32.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
@@ -8452,6 +8489,52 @@ eslint@8.57.0:
strip-ansi "^6.0.1"
text-table "^0.2.0"
eslint@^7.7.0:
version "7.32.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
dependencies:
"@babel/code-frame" "7.12.11"
"@eslint/eslintrc" "^0.4.3"
"@humanwhocodes/config-array" "^0.5.0"
ajv "^6.10.0"
chalk "^4.0.0"
cross-spawn "^7.0.2"
debug "^4.0.1"
doctrine "^3.0.0"
enquirer "^2.3.5"
escape-string-regexp "^4.0.0"
eslint-scope "^5.1.1"
eslint-utils "^2.1.0"
eslint-visitor-keys "^2.0.0"
espree "^7.3.1"
esquery "^1.4.0"
esutils "^2.0.2"
fast-deep-equal "^3.1.3"
file-entry-cache "^6.0.1"
functional-red-black-tree "^1.0.1"
glob-parent "^5.1.2"
globals "^13.6.0"
ignore "^4.0.6"
import-fresh "^3.0.0"
imurmurhash "^0.1.4"
is-glob "^4.0.0"
js-yaml "^3.13.1"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash.merge "^4.6.2"
minimatch "^3.0.4"
natural-compare "^1.4.0"
optionator "^0.9.1"
progress "^2.0.0"
regexpp "^3.1.0"
semver "^7.2.1"
strip-ansi "^6.0.0"
strip-json-comments "^3.1.0"
table "^6.0.9"
text-table "^0.2.0"
v8-compile-cache "^2.0.3"
espree@10.0.1, espree@^10.0.1:
version "10.0.1"
resolved "https://registry.yarnpkg.com/espree/-/espree-10.0.1.tgz#600e60404157412751ba4a6f3a2ee1a42433139f"
@@ -9215,12 +9298,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.261:
version "0.261.2"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.261.2.tgz#8558c965950f8e38872ea21f66bf04932da2380b"
integrity sha512-lTYA05K4obAjyrrX4in3sLZyAECSFCDwQiGpZHJLm8ldCk+qcW11Wcxq/CdvyQAOPR7Kpb5BPRSaj4hwEXIAUw==
flow-bin@^0.265:
version "0.265.3"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.265.3.tgz#cbaad2115f4622e34920981dc79949824c27f421"
integrity sha512-08PjO2kjuQxy8MxYJNCzmgRpAe1uqTf7kQ+U32QTavRzTD/7IJASYKFEEvCkVNHlhSy8CTJsN+AQdHsXVqChIw==
flow-remove-types@^2.261:
flow-remove-types@^2.265:
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==
@@ -9229,6 +9312,43 @@ flow-remove-types@^2.261:
pirates "^3.0.2"
vlq "^0.2.1"
flow-typed@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/flow-typed/-/flow-typed-4.1.1.tgz#e4ff8ea37edcb8fb463b72b70787147bf52a1e08"
integrity sha512-S1NSkTm81UkoSiuDp9vUAY+jYSB8r/Bec1RFqjK3o+XagFu+OQtm1nh3ZyoshHtg1oPKfrSnslXHlqWiP76BSw==
dependencies:
"@octokit/rest" "^18.12.0"
colors "1.4.0"
flowgen "^1.10.0"
fs-extra "^8.1.0"
glob "^7.1.6"
got "^11.8.5"
js-yaml "^4.1.0"
md5 "^2.2.1"
mkdirp "^1.0.3"
node-stream-zip "^1.15.0"
prettier "^1.19.1"
rimraf "^3.0.2"
semver "^7.6.3"
simple-git "^3.10.0"
table "^6.7.3"
which "^2.0.2"
yargs "^15.1.0"
flowgen@^1.10.0:
version "1.21.0"
resolved "https://registry.yarnpkg.com/flowgen/-/flowgen-1.21.0.tgz#f7ecb693892c4bd069492dbf77db561bbb451aa9"
integrity sha512-pFNFFyMLRmW6njhOIm5TrbGUDTv64aujmys2KrkRE2NYD8sXwJUyicQRwU5SPRBRJnFSD/FNlnHo2NnHI5eJSw==
dependencies:
"@babel/code-frame" "^7.16.7"
"@babel/highlight" "^7.16.7"
commander "^6.1.0"
lodash "^4.17.20"
prettier "^2.5.1"
shelljs "^0.8.4"
typescript "~4.4.4"
typescript-compiler "^1.4.1-2"
follow-redirects@^1.0.0:
version "1.15.6"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
@@ -10685,7 +10805,7 @@ is-boolean-object@^1.1.0:
dependencies:
call-bind "^1.0.2"
is-buffer@^1.1.5:
is-buffer@^1.1.5, is-buffer@~1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
@@ -12304,7 +12424,7 @@ lodash.union@^4.6.0:
resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88"
integrity sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=
lodash@^4.14.0, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.8.0, lodash@~4.17.2:
lodash@^4.14.0, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.8.0, lodash@~4.17.2:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@@ -12509,6 +12629,15 @@ matcher@^3.0.0:
dependencies:
escape-string-regexp "^4.0.0"
md5@^2.2.1:
version "2.3.0"
resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f"
integrity sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==
dependencies:
charenc "0.0.2"
crypt "0.0.2"
is-buffer "~1.1.6"
mdn-data@2.0.14:
version "2.0.14"
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50"
@@ -12794,6 +12923,11 @@ mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1:
dependencies:
minimist "^1.2.5"
mkdirp@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
moment@^2.19.3:
version "2.30.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
@@ -13058,6 +13192,11 @@ node-rsa@^1.0.5:
dependencies:
asn1 "^0.2.4"
node-stream-zip@^1.15.0:
version "1.15.0"
resolved "https://registry.yarnpkg.com/node-stream-zip/-/node-stream-zip-1.15.0.tgz#158adb88ed8004c6c49a396b50a6a5de3bca33ea"
integrity sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==
node-version@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/node-version/-/node-version-1.2.0.tgz#34fde3ffa8e1149bd323983479dda620e1b5060d"
@@ -14207,6 +14346,16 @@ prettier@*, prettier@^3.3.3:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==
prettier@^1.19.1:
version "1.19.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
prettier@^2.5.1:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
pretty-format@^29.4.1:
version "29.4.1"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.1.tgz#0da99b532559097b8254298da7c75a0785b1751c"
@@ -15520,6 +15669,11 @@ semver@^7.5.4:
dependencies:
lru-cache "^6.0.0"
semver@^7.6.3:
version "7.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58"
integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==
send@0.19.0:
version "0.19.0"
resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8"
@@ -15682,7 +15836,7 @@ shell-quote@^1.7.3:
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680"
integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==
shelljs@^0.8.5:
shelljs@^0.8.4, shelljs@^0.8.5:
version "0.8.5"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==
@@ -15726,6 +15880,15 @@ signedsource@^2.0.0:
resolved "https://registry.yarnpkg.com/signedsource/-/signedsource-2.0.0.tgz#f72dc0f98f5bca2763b464a555511a84a4da8eee"
integrity sha512-MscTxXbMij5JVgrW1xDiMIc+vFa0+H0+HP+rRrFjwa7ef2VAxIP/4L/E75I5H4xvyb4l1X+a9ch+6Zy5uFu7Fg==
simple-git@^3.10.0:
version "3.28.0"
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.28.0.tgz#c6345b2e387880f8450788a1e388573366ae48ac"
integrity sha512-Rs/vQRwsn1ILH1oBUy8NucJlXmnnLeLCfcvbSehkPzbv3wwoFWIdtfd6Ndo6ZPhlPsCZ60CPI4rxurnwAa+a2w==
dependencies:
"@kwsites/file-exists" "^1.1.1"
"@kwsites/promise-deferred" "^1.1.1"
debug "^4.4.0"
sisteransi@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
@@ -16067,7 +16230,7 @@ string-natural-compare@^3.0.1:
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -16102,6 +16265,15 @@ string-width@^4.0.0:
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
string-width@^5.0.1, string-width@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -16162,7 +16334,7 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -16190,6 +16362,13 @@ strip-ansi@^5.1.0:
dependencies:
ansi-regex "^4.1.0"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-ansi@^7.0.1:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -16424,6 +16603,17 @@ table@^6.0.9:
string-width "^4.2.3"
strip-ansi "^6.0.1"
table@^6.7.3:
version "6.9.0"
resolved "https://registry.yarnpkg.com/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5"
integrity sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==
dependencies:
ajv "^8.0.1"
lodash.truncate "^4.4.2"
slice-ansi "^4.0.0"
string-width "^4.2.3"
strip-ansi "^6.0.1"
tapable@^2.1.1, tapable@^2.2.0, tapable@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
@@ -16925,6 +17115,11 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
typescript-compiler@^1.4.1-2:
version "1.4.1-2"
resolved "https://registry.yarnpkg.com/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz#ba4f7db22d91534a1929d90009dce161eb72fd3f"
integrity sha512-EMopKmoAEJqA4XXRFGOb7eSBhmQMbBahW6P1Koayeatp0b4AW2q/bBqYWkpG7QVQc9HGQUiS4trx2ZHcnAaZUg==
typescript@3.9.3:
version "3.9.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.3.tgz#d3ac8883a97c26139e42df5e93eeece33d610b8a"
@@ -16935,6 +17130,11 @@ typescript@^5.4.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==
typescript@~4.4.4:
version "4.4.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c"
integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==
ua-parser-js@^0.7.18, ua-parser-js@^0.7.9:
version "0.7.20"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.20.tgz#7527178b82f6a62a0f243d1f94fd30e3e3c21098"
@@ -17772,7 +17972,7 @@ workerize-loader@^2.0.2:
dependencies:
loader-utils "^2.0.0"
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -17790,6 +17990,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
@@ -17945,6 +18154,14 @@ yargs-parser@^18.1.1:
camelcase "^5.0.0"
decamelize "^1.2.0"
yargs-parser@^18.1.2:
version "18.1.3"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"
integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"
yargs-parser@^21.1.1:
version "21.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
@@ -17963,6 +18180,23 @@ yargs@17.7.2, yargs@^17.3.1:
y18n "^5.0.5"
yargs-parser "^21.1.1"
yargs@^15.1.0:
version "15.4.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
dependencies:
cliui "^6.0.0"
decamelize "^1.2.0"
find-up "^4.1.0"
get-caller-file "^2.0.1"
require-directory "^2.1.1"
require-main-filename "^2.0.0"
set-blocking "^2.0.0"
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^18.1.2"
yargs@^15.3.1:
version "15.3.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b"