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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@
"flow-eslint": "0.325.0",
"flow-parser": "0.325.0",
"flow-transform": "0.325.0",
"hermes-eslint": "0.37.0",
"hermes-transform": "0.37.0",
"ini": "^5.0.0",
"inquirer": "^7.1.0",
"jest": "^29.7.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-plugin-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"devDependencies": {
"babel-plugin-syntax-hermes-parser": "0.37.0",
"flow-parser": "0.325.0",
"flow-eslint": "0.325.0",
"hermes-eslint": "0.37.0"
"flow-eslint": "0.325.0"
},
"engines": {
"node": "^22.13.0 || ^24.3.0 || >= 26.0.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-plugin-specs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"source-map-support": "0.5.0"
},
"devDependencies": {
"flow-eslint": "0.325.0",
"hermes-eslint": "0.37.0"
"flow-eslint": "0.325.0"
},
"engines": {
"node": "^22.13.0 || ^24.3.0 || >= 26.0.0"
Expand Down
1 change: 0 additions & 1 deletion packages/react-native-babel-transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.87.0-main",
"flow-parser": "0.325.0",
"hermes-parser": "0.37.0",
"nullthrows": "^1.1.1"
},
"peerDependencies": {
Expand Down
2 changes: 0 additions & 2 deletions packages/react-native-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@babel/core": "^7.25.2",
"@babel/parser": "^7.29.0",
"flow-parser": "0.325.0",
"hermes-parser": "0.37.0",
"invariant": "^2.2.4",
"nullthrows": "^1.1.1",
"tinyglobby": "^0.2.15",
Expand All @@ -48,7 +47,6 @@
"@babel/preset-env": "^7.25.3",
"babel-plugin-syntax-hermes-parser": "0.37.0",
"flow-estree": "0.325.0",
"hermes-estree": "0.37.0",
"micromatch": "^4.0.4",
"prettier": "3.9.4",
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import FlatList, {type FlatListProps} from '../../Lists/FlatList';
import createAnimatedComponent from '../createAnimatedComponent';
import * as React from 'react';

export default createAnimatedComponent(FlatList) as $FlowFixMe as component<
const AnimatedFlatList: component<
// $FlowExpectedError[unclear-type]
ItemT = any,
>(
ref?: React.RefSetter<FlatList<ItemT>>,
...props: AnimatedProps<FlatListProps<ItemT>>
);
) = createAnimatedComponent(FlatList) as $FlowFixMe;

export default AnimatedFlatList;
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ import createAnimatedComponent from '../createAnimatedComponent';
import * as React from 'react';

// $FlowFixMe[incompatible-type]
export default createAnimatedComponent(SectionList) as $FlowFixMe as component<
const AnimatedSectionList: component<
// $FlowExpectedError[unclear-type]
ItemT = any,
// $FlowExpectedError[unclear-type]
SectionT = any,
>(
ref?: React.RefSetter<SectionList<ItemT, SectionT>>,
...props: AnimatedProps<SectionListProps<ItemT, SectionT>>
);
) = createAnimatedComponent(SectionList) as $FlowFixMe;

export default AnimatedSectionList;
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ function usePressState(forcePressed: boolean): [boolean, (boolean) => void] {
return [pressed || forcePressed, setPressed];
}

const MemoedPressable = memo(Pressable);
MemoedPressable.displayName = 'Pressable';

export default MemoedPressable as component(
const MemoedPressable: component(
ref?: React.RefSetter<PressableInstance>,
...props: PressableProps
);
) = memo(Pressable);
MemoedPressable.displayName = 'Pressable';

export default MemoedPressable;
39 changes: 21 additions & 18 deletions packages/react-native/ReactNativeApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<53280bff7703ea0e9e912e22543fd568>>
* @generated SignedSource<<e65e3e0b15c846ea55df406b6d49dc6c>>
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
Expand All @@ -22,11 +22,7 @@
/* eslint-disable redundant-undefined/redundant-undefined */

import * as React from "react"
declare const $$AnimatedFlatList: <ItemT = any>(
props: Omit<AnimatedProps<FlatListProps<ItemT>>, "ref"> & {
ref?: React.Ref<FlatList<ItemT>>
},
) => React.ReactNode
declare const $$AnimatedFlatList: typeof AnimatedFlatList_default
declare const $$AnimatedImage: AnimatedComponentType<
React.JSX.LibraryManagedAttributes<
typeof Image,
Expand Down Expand Up @@ -62,11 +58,7 @@ declare const $$AnimatedImplementation: {
ValueXY: typeof AnimatedValueXY_default
}
declare const $$AnimatedScrollView: typeof AnimatedScrollView_default
declare const $$AnimatedSectionList: <ItemT = any, SectionT = any>(
props: Omit<AnimatedProps<SectionListProps<ItemT, SectionT>>, "ref"> & {
ref?: React.Ref<SectionList<ItemT, SectionT>>
},
) => React.ReactNode
declare const $$AnimatedSectionList: typeof AnimatedSectionList_default
declare const $$AnimatedText: AnimatedComponentType<
TextProps,
React.ComponentRef<typeof Text>
Expand Down Expand Up @@ -145,10 +137,20 @@ declare const addImpl: (
a: AnimatedNode_default | number,
b: AnimatedNode_default | number,
) => AnimatedAddition_default
declare const AnimatedFlatList_default: <ItemT = any>(
props: Omit<AnimatedProps<FlatListProps<ItemT>>, "ref"> & {
ref?: React.Ref<FlatList<ItemT>>
},
) => React.ReactNode
declare const AnimatedScrollView_default: AnimatedComponentType<
ScrollViewProps,
AnimatedScrollViewInstance
>
declare const AnimatedSectionList_default: <ItemT = any, SectionT = any>(
props: Omit<AnimatedProps<SectionListProps<ItemT, SectionT>>, "ref"> & {
ref?: React.Ref<SectionList<ItemT, SectionT>>
},
) => React.ReactNode
declare const AppState: typeof AppState_default
declare const AppState_default: AppStateImpl
declare const AssetRegistry: {
Expand Down Expand Up @@ -269,6 +271,11 @@ declare const loopImpl: (
animation: CompositeAnimation,
$$PARAM_1$$?: LoopAnimationConfig,
) => CompositeAnimation
declare const MemoedPressable_default: (
props: PressableProps & {
ref?: React.Ref<PressableInstance>
},
) => React.ReactNode
declare const Modal: typeof Wrapper_default
declare const modulo: typeof $$AnimatedImplementation.modulo
declare const moduloImpl: (
Expand Down Expand Up @@ -311,11 +318,7 @@ declare const Presets: {
linear: LayoutAnimationConfig
spring: LayoutAnimationConfig
}
declare const Pressable: (
props: PressableProps & {
ref?: React.Ref<PressableInstance>
},
) => React.ReactNode
declare const Pressable: typeof MemoedPressable_default
declare const processColor: typeof processColor_default
declare const ProgressBarAndroid: typeof ProgressBarAndroid_default
declare let ProgressBarAndroid_default: (
Expand Down Expand Up @@ -5721,7 +5724,7 @@ export {
AlertOptions, // 8a116d2a
AlertType, // 5ab91217
AndroidKeyboardEvent, // e03becc8
Animated, // 50cbe576
Animated, // d505a1c9
AppConfig, // 35c0ca70
AppRegistry, // 1e8c5a00
AppState, // 12012be5
Expand Down Expand Up @@ -5880,7 +5883,7 @@ export {
PointerEvent, // ff599afe
PressabilityConfig, // fea539a5
PressabilityEventHandlers, // c222648b
Pressable, // 7008c06f
Pressable, // ed5391ac
PressableAndroidRippleConfig, // ee32eaca
PressableInstance, // eebfe911
PressableProps, // d6bfa55b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ component VirtualColumnLayout(
);
}

const VirtualColumn = createVirtualCollectionView(
VirtualColumnLayout,
VirtualColumnGenerator,
);

// TODO: Figure out component generic resolution.
// @see https://fb.workplace.com/groups/flow/posts/29355518614070041
// export default VirtualColumn as VirtualCollectionViewComponent<VirtualColumnLayoutProps>;
export default VirtualColumn as component<out TItem extends Item>(
// const VirtualColumn: VirtualCollectionViewComponent<VirtualColumnLayoutProps> = ...
const VirtualColumn: component<out TItem extends Item>(
children: (item: TItem, key: string) => React.Node,
items: VirtualCollection<TItem>,
itemToKey?: (TItem) => string,
removeClippedSubviews?: boolean,
testID?: ?string,
);
) = createVirtualCollectionView(VirtualColumnLayout, VirtualColumnGenerator);

export default VirtualColumn;
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ component VirtualRowLayout(
);
}

const VirtualRow = createVirtualCollectionView(
VirtualRowLayout,
VirtualRowGenerator,
);

// TODO: Figure out component generic resolution.
// @see https://fb.workplace.com/groups/flow/posts/29355518614070041
// export default VirtualRow as VirtualCollectionViewComponent<VirtualRowLayoutProps>;
export default VirtualRow as component<out TItem extends Item>(
// const VirtualRow: VirtualCollectionViewComponent<VirtualRowLayoutProps> = ...
const VirtualRow: component<out TItem extends Item>(
children: (item: TItem, key: string) => React.Node,
items: VirtualCollection<TItem>,
itemToKey?: (TItem) => string,
removeClippedSubviews?: boolean,
testID?: ?string,
);
) = createVirtualCollectionView(VirtualRowLayout, VirtualRowGenerator);

export default VirtualRow;
4 changes: 2 additions & 2 deletions scripts/js-api/build-types/resolution/getDependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
*/

import type {DependencyContext} from './simpleResolve';
import type {ParseResult} from 'hermes-transform/dist/transform/parse';
import type {ParseResult} from 'flow-transform/dist/transform/parse';

const resolveTypeInputFile = require('./resolveTypeInputFile');
const simpleResolve = require('./simpleResolve');
const debug = require('debug')('build-types:resolution');
const {traverse} = require('hermes-transform/dist/traverse/traverse');
const {traverse} = require('flow-transform/dist/traverse/traverse');

const reportedUnresolvedDeps = new Set<string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

const ensureNoUnprefixedProps = require('../ensureNoUnprefixedProps');
const {parse, print} = require('hermes-transform');
const {parse, print} = require('flow-transform');

const prettierOptions = {parser: 'babel'};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

const reattachDocComments = require('../reattachDocComments');
const {parse, print} = require('hermes-transform');
const {parse, print} = require('flow-transform');

const prettierOptions = {parser: 'babel'};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

const replaceEmptyWithNever = require('../replaceEmptyWithNever');
const {parse, print} = require('hermes-transform');
const {parse, print} = require('flow-transform');

const prettierOptions = {parser: 'babel'};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

const replaceNullablePropertiesWithUndefined = require('../replaceNullablePropertiesWithUndefined');
const {parse, print} = require('hermes-transform');
const {parse, print} = require('flow-transform');

const prettierOptions = {parser: 'babel'};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

const replaceRequiresWithImports = require('../replaceRequiresWithImports');
const {parse, print} = require('hermes-transform');
const {parse, print} = require('flow-transform');

const prettierOptions = {parser: 'babel'};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

const replaceStringishWithString = require('../replaceStringishWithString');
const {parse, print} = require('hermes-transform');
const {parse, print} = require('flow-transform');

const prettierOptions = {parser: 'babel'};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

const stripPrivateProperties = require('../stripPrivateProperties');
const {parse, print} = require('hermes-transform');
const {parse, print} = require('flow-transform');

const prettierOptions = {parser: 'babel'};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* @format
*/

import type {TransformVisitor} from 'hermes-transform';
import type {ParseResult} from 'hermes-transform/dist/transform/parse';
import type {TransformASTResult} from 'hermes-transform/dist/transform/transformAST';
import type {TransformVisitor} from 'flow-transform';
import type {ParseResult} from 'flow-transform/dist/transform/parse';
import type {TransformASTResult} from 'flow-transform/dist/transform/transformAST';

const {transformAST} = require('hermes-transform/dist/transform/transformAST');
const {transformAST} = require('flow-transform/dist/transform/transformAST');

const visitors: TransformVisitor = context => ({
TypeAlias(node): void {
Expand Down
20 changes: 8 additions & 12 deletions scripts/js-api/build-types/transforms/flow/reattachDocComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import type {
ModuleDeclaration,
Program,
Statement,
} from 'hermes-estree/dist';
import type {TransformVisitor} from 'hermes-transform';
import type {ParseResult} from 'hermes-transform/dist/transform/parse';
import type {TransformASTResult} from 'hermes-transform/dist/transform/transformAST';
} from 'flow-estree/dist';
import type {TransformVisitor} from 'flow-transform';
import type {ParseResult} from 'flow-transform/dist/transform/parse';
import type {TransformASTResult} from 'flow-transform/dist/transform/transformAST';

const {transformAST} = require('hermes-transform/dist/transform/transformAST');
const {transformAST} = require('flow-transform/dist/transform/transformAST');

type BodyNode = Statement | ModuleDeclaration;

Expand Down Expand Up @@ -177,15 +177,11 @@ function findDeclarationByName(
return {statement, kind: declaration.type};
}

// `declare const X` in `.js.flow` declaration files
// `DeclareVariable` is `declare const X` in `.js.flow` declaration files
if (
declaration.type === 'DeclareVariable' &&
declaration.id.name === name
declaration.type === 'VariableDeclaration' ||
declaration.type === 'DeclareVariable'
) {
return {statement, kind: declaration.type};
}

if (declaration.type === 'VariableDeclaration') {
for (const declarator of declaration.declarations) {
if (
declarator.id.type === 'Identifier' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* @format
*/

import type {TransformVisitor} from 'hermes-transform';
import type {ParseResult} from 'hermes-transform/dist/transform/parse';
import type {TransformASTResult} from 'hermes-transform/dist/transform/transformAST';
import type {TransformVisitor} from 'flow-transform';
import type {ParseResult} from 'flow-transform/dist/transform/parse';
import type {TransformASTResult} from 'flow-transform/dist/transform/transformAST';

const {transformAST} = require('hermes-transform/dist/transform/transformAST');
const {transformAST} = require('flow-transform/dist/transform/transformAST');

const visitors: TransformVisitor = context => ({
EmptyTypeAnnotation(node): void {
Expand Down
Loading