From 884d103ff087861f76467c091619ae6c281ffffd Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Thu, 6 Aug 2026 12:49:33 -0700 Subject: [PATCH] Fully replace hermes-(estree|parser|eslint|transform) packages with flow-* counterparts in react-native Summary: The flow-* packages have support for all latest syntax and is better maintained. Changelog: [Internal] Differential Revision: D115064040 --- package.json | 2 - .../eslint-plugin-react-native/package.json | 3 +- packages/eslint-plugin-specs/package.json | 3 +- .../package.json | 1 - packages/react-native-codegen/package.json | 2 - .../Animated/components/AnimatedFlatList.js | 6 ++- .../components/AnimatedSectionList.js | 6 ++- .../Components/Pressable/Pressable.js | 10 ++--- packages/react-native/ReactNativeApi.d.ts | 39 ++++++++++--------- .../virtualcollection/column/VirtualColumn.js | 13 +++---- .../virtualcollection/row/VirtualRow.js | 13 +++---- .../build-types/resolution/getDependencies.js | 4 +- .../__tests__/ensureNoUnprefixedProps-test.js | 2 +- .../__tests__/reattachDocComments-test.js | 2 +- .../__tests__/replaceEmptyWithNever-test.js | 2 +- ...aceNullablePropertiesWithUndefined-test.js | 2 +- .../replaceRequiresWithImports-test.js | 2 +- .../replaceStringishWithString-test.js | 2 +- .../__tests__/stripPrivateProperties-test.js | 2 +- .../flow/ensureNoUnprefixedProps.js | 8 ++-- .../transforms/flow/reattachDocComments.js | 20 ++++------ .../transforms/flow/replaceEmptyWithNever.js | 8 ++-- .../replaceNullablePropertiesWithUndefined.js | 10 ++--- .../flow/replaceRequiresWithImports.js | 8 ++-- .../flow/replaceStringishWithString.js | 8 ++-- .../transforms/flow/stripPrivateProperties.js | 8 ++-- .../js-api/build-types/translateSourceFile.js | 6 +-- 27 files changed, 91 insertions(+), 101 deletions(-) diff --git a/package.json b/package.json index 35913457a1f6..918a44260065 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/eslint-plugin-react-native/package.json b/packages/eslint-plugin-react-native/package.json index f9b6e0aad473..a4ef12b6a2a6 100644 --- a/packages/eslint-plugin-react-native/package.json +++ b/packages/eslint-plugin-react-native/package.json @@ -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" diff --git a/packages/eslint-plugin-specs/package.json b/packages/eslint-plugin-specs/package.json index 98a27281cab7..aaaaececf5e5 100644 --- a/packages/eslint-plugin-specs/package.json +++ b/packages/eslint-plugin-specs/package.json @@ -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" diff --git a/packages/react-native-babel-transformer/package.json b/packages/react-native-babel-transformer/package.json index cf2c0d4de8b4..14a18b0ae860 100644 --- a/packages/react-native-babel-transformer/package.json +++ b/packages/react-native-babel-transformer/package.json @@ -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": { diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index ae6be439aa06..d0900f470d4e 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -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", @@ -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" diff --git a/packages/react-native/Libraries/Animated/components/AnimatedFlatList.js b/packages/react-native/Libraries/Animated/components/AnimatedFlatList.js index c6fa0365504f..877d5bf68bc4 100644 --- a/packages/react-native/Libraries/Animated/components/AnimatedFlatList.js +++ b/packages/react-native/Libraries/Animated/components/AnimatedFlatList.js @@ -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>, ...props: AnimatedProps> -); +) = createAnimatedComponent(FlatList) as $FlowFixMe; + +export default AnimatedFlatList; diff --git a/packages/react-native/Libraries/Animated/components/AnimatedSectionList.js b/packages/react-native/Libraries/Animated/components/AnimatedSectionList.js index 2c187836b206..65d8accefe40 100644 --- a/packages/react-native/Libraries/Animated/components/AnimatedSectionList.js +++ b/packages/react-native/Libraries/Animated/components/AnimatedSectionList.js @@ -15,7 +15,7 @@ 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] @@ -23,4 +23,6 @@ export default createAnimatedComponent(SectionList) as $FlowFixMe as component< >( ref?: React.RefSetter>, ...props: AnimatedProps> -); +) = createAnimatedComponent(SectionList) as $FlowFixMe; + +export default AnimatedSectionList; diff --git a/packages/react-native/Libraries/Components/Pressable/Pressable.js b/packages/react-native/Libraries/Components/Pressable/Pressable.js index c0d1a6d62ab3..01cebeb0c287 100644 --- a/packages/react-native/Libraries/Components/Pressable/Pressable.js +++ b/packages/react-native/Libraries/Components/Pressable/Pressable.js @@ -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, ...props: PressableProps -); +) = memo(Pressable); +MemoedPressable.displayName = 'Pressable'; + +export default MemoedPressable; diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 556c8117198d..2dc01e0f3cf2 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -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<> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -22,11 +22,7 @@ /* eslint-disable redundant-undefined/redundant-undefined */ import * as React from "react" -declare const $$AnimatedFlatList: ( - props: Omit>, "ref"> & { - ref?: React.Ref> - }, -) => React.ReactNode +declare const $$AnimatedFlatList: typeof AnimatedFlatList_default declare const $$AnimatedImage: AnimatedComponentType< React.JSX.LibraryManagedAttributes< typeof Image, @@ -62,11 +58,7 @@ declare const $$AnimatedImplementation: { ValueXY: typeof AnimatedValueXY_default } declare const $$AnimatedScrollView: typeof AnimatedScrollView_default -declare const $$AnimatedSectionList: ( - props: Omit>, "ref"> & { - ref?: React.Ref> - }, -) => React.ReactNode +declare const $$AnimatedSectionList: typeof AnimatedSectionList_default declare const $$AnimatedText: AnimatedComponentType< TextProps, React.ComponentRef @@ -145,10 +137,20 @@ declare const addImpl: ( a: AnimatedNode_default | number, b: AnimatedNode_default | number, ) => AnimatedAddition_default +declare const AnimatedFlatList_default: ( + props: Omit>, "ref"> & { + ref?: React.Ref> + }, +) => React.ReactNode declare const AnimatedScrollView_default: AnimatedComponentType< ScrollViewProps, AnimatedScrollViewInstance > +declare const AnimatedSectionList_default: ( + props: Omit>, "ref"> & { + ref?: React.Ref> + }, +) => React.ReactNode declare const AppState: typeof AppState_default declare const AppState_default: AppStateImpl declare const AssetRegistry: { @@ -269,6 +271,11 @@ declare const loopImpl: ( animation: CompositeAnimation, $$PARAM_1$$?: LoopAnimationConfig, ) => CompositeAnimation +declare const MemoedPressable_default: ( + props: PressableProps & { + ref?: React.Ref + }, +) => React.ReactNode declare const Modal: typeof Wrapper_default declare const modulo: typeof $$AnimatedImplementation.modulo declare const moduloImpl: ( @@ -311,11 +318,7 @@ declare const Presets: { linear: LayoutAnimationConfig spring: LayoutAnimationConfig } -declare const Pressable: ( - props: PressableProps & { - ref?: React.Ref - }, -) => React.ReactNode +declare const Pressable: typeof MemoedPressable_default declare const processColor: typeof processColor_default declare const ProgressBarAndroid: typeof ProgressBarAndroid_default declare let ProgressBarAndroid_default: ( @@ -5721,7 +5724,7 @@ export { AlertOptions, // 8a116d2a AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // 50cbe576 + Animated, // d505a1c9 AppConfig, // 35c0ca70 AppRegistry, // 1e8c5a00 AppState, // 12012be5 @@ -5880,7 +5883,7 @@ export { PointerEvent, // ff599afe PressabilityConfig, // fea539a5 PressabilityEventHandlers, // c222648b - Pressable, // 7008c06f + Pressable, // ed5391ac PressableAndroidRippleConfig, // ee32eaca PressableInstance, // eebfe911 PressableProps, // d6bfa55b diff --git a/packages/react-native/src/private/components/virtualcollection/column/VirtualColumn.js b/packages/react-native/src/private/components/virtualcollection/column/VirtualColumn.js index aed3aef0b006..4ef31a318ddd 100644 --- a/packages/react-native/src/private/components/virtualcollection/column/VirtualColumn.js +++ b/packages/react-native/src/private/components/virtualcollection/column/VirtualColumn.js @@ -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; -export default VirtualColumn as component( +// const VirtualColumn: VirtualCollectionViewComponent = ... +const VirtualColumn: component( children: (item: TItem, key: string) => React.Node, items: VirtualCollection, itemToKey?: (TItem) => string, removeClippedSubviews?: boolean, testID?: ?string, -); +) = createVirtualCollectionView(VirtualColumnLayout, VirtualColumnGenerator); + +export default VirtualColumn; diff --git a/packages/react-native/src/private/components/virtualcollection/row/VirtualRow.js b/packages/react-native/src/private/components/virtualcollection/row/VirtualRow.js index 9c7922b9dc18..5394795bdb8d 100644 --- a/packages/react-native/src/private/components/virtualcollection/row/VirtualRow.js +++ b/packages/react-native/src/private/components/virtualcollection/row/VirtualRow.js @@ -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; -export default VirtualRow as component( +// const VirtualRow: VirtualCollectionViewComponent = ... +const VirtualRow: component( children: (item: TItem, key: string) => React.Node, items: VirtualCollection, itemToKey?: (TItem) => string, removeClippedSubviews?: boolean, testID?: ?string, -); +) = createVirtualCollectionView(VirtualRowLayout, VirtualRowGenerator); + +export default VirtualRow; diff --git a/scripts/js-api/build-types/resolution/getDependencies.js b/scripts/js-api/build-types/resolution/getDependencies.js index 08238030b33f..42fb16ecf177 100644 --- a/scripts/js-api/build-types/resolution/getDependencies.js +++ b/scripts/js-api/build-types/resolution/getDependencies.js @@ -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(); diff --git a/scripts/js-api/build-types/transforms/flow/__tests__/ensureNoUnprefixedProps-test.js b/scripts/js-api/build-types/transforms/flow/__tests__/ensureNoUnprefixedProps-test.js index 25b71c633d29..4c8d0168706a 100644 --- a/scripts/js-api/build-types/transforms/flow/__tests__/ensureNoUnprefixedProps-test.js +++ b/scripts/js-api/build-types/transforms/flow/__tests__/ensureNoUnprefixedProps-test.js @@ -9,7 +9,7 @@ */ const ensureNoUnprefixedProps = require('../ensureNoUnprefixedProps'); -const {parse, print} = require('hermes-transform'); +const {parse, print} = require('flow-transform'); const prettierOptions = {parser: 'babel'}; diff --git a/scripts/js-api/build-types/transforms/flow/__tests__/reattachDocComments-test.js b/scripts/js-api/build-types/transforms/flow/__tests__/reattachDocComments-test.js index 05876628bbdb..65f439d8f906 100644 --- a/scripts/js-api/build-types/transforms/flow/__tests__/reattachDocComments-test.js +++ b/scripts/js-api/build-types/transforms/flow/__tests__/reattachDocComments-test.js @@ -9,7 +9,7 @@ */ const reattachDocComments = require('../reattachDocComments'); -const {parse, print} = require('hermes-transform'); +const {parse, print} = require('flow-transform'); const prettierOptions = {parser: 'babel'}; diff --git a/scripts/js-api/build-types/transforms/flow/__tests__/replaceEmptyWithNever-test.js b/scripts/js-api/build-types/transforms/flow/__tests__/replaceEmptyWithNever-test.js index 95649fa3b944..55f527a81841 100644 --- a/scripts/js-api/build-types/transforms/flow/__tests__/replaceEmptyWithNever-test.js +++ b/scripts/js-api/build-types/transforms/flow/__tests__/replaceEmptyWithNever-test.js @@ -9,7 +9,7 @@ */ const replaceEmptyWithNever = require('../replaceEmptyWithNever'); -const {parse, print} = require('hermes-transform'); +const {parse, print} = require('flow-transform'); const prettierOptions = {parser: 'babel'}; diff --git a/scripts/js-api/build-types/transforms/flow/__tests__/replaceNullablePropertiesWithUndefined-test.js b/scripts/js-api/build-types/transforms/flow/__tests__/replaceNullablePropertiesWithUndefined-test.js index 7cc1f113ebf9..c0c595ae75a8 100644 --- a/scripts/js-api/build-types/transforms/flow/__tests__/replaceNullablePropertiesWithUndefined-test.js +++ b/scripts/js-api/build-types/transforms/flow/__tests__/replaceNullablePropertiesWithUndefined-test.js @@ -9,7 +9,7 @@ */ const replaceNullablePropertiesWithUndefined = require('../replaceNullablePropertiesWithUndefined'); -const {parse, print} = require('hermes-transform'); +const {parse, print} = require('flow-transform'); const prettierOptions = {parser: 'babel'}; diff --git a/scripts/js-api/build-types/transforms/flow/__tests__/replaceRequiresWithImports-test.js b/scripts/js-api/build-types/transforms/flow/__tests__/replaceRequiresWithImports-test.js index 87951c324f0e..70488efa38ab 100644 --- a/scripts/js-api/build-types/transforms/flow/__tests__/replaceRequiresWithImports-test.js +++ b/scripts/js-api/build-types/transforms/flow/__tests__/replaceRequiresWithImports-test.js @@ -9,7 +9,7 @@ */ const replaceRequiresWithImports = require('../replaceRequiresWithImports'); -const {parse, print} = require('hermes-transform'); +const {parse, print} = require('flow-transform'); const prettierOptions = {parser: 'babel'}; diff --git a/scripts/js-api/build-types/transforms/flow/__tests__/replaceStringishWithString-test.js b/scripts/js-api/build-types/transforms/flow/__tests__/replaceStringishWithString-test.js index fbd9e31a33e3..3e456f7b69bc 100644 --- a/scripts/js-api/build-types/transforms/flow/__tests__/replaceStringishWithString-test.js +++ b/scripts/js-api/build-types/transforms/flow/__tests__/replaceStringishWithString-test.js @@ -9,7 +9,7 @@ */ const replaceStringishWithString = require('../replaceStringishWithString'); -const {parse, print} = require('hermes-transform'); +const {parse, print} = require('flow-transform'); const prettierOptions = {parser: 'babel'}; diff --git a/scripts/js-api/build-types/transforms/flow/__tests__/stripPrivateProperties-test.js b/scripts/js-api/build-types/transforms/flow/__tests__/stripPrivateProperties-test.js index 70945fa8abdc..12af13718ea5 100644 --- a/scripts/js-api/build-types/transforms/flow/__tests__/stripPrivateProperties-test.js +++ b/scripts/js-api/build-types/transforms/flow/__tests__/stripPrivateProperties-test.js @@ -9,7 +9,7 @@ */ const stripPrivateProperties = require('../stripPrivateProperties'); -const {parse, print} = require('hermes-transform'); +const {parse, print} = require('flow-transform'); const prettierOptions = {parser: 'babel'}; diff --git a/scripts/js-api/build-types/transforms/flow/ensureNoUnprefixedProps.js b/scripts/js-api/build-types/transforms/flow/ensureNoUnprefixedProps.js index 01455ee987c4..5560ee75976f 100644 --- a/scripts/js-api/build-types/transforms/flow/ensureNoUnprefixedProps.js +++ b/scripts/js-api/build-types/transforms/flow/ensureNoUnprefixedProps.js @@ -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 { diff --git a/scripts/js-api/build-types/transforms/flow/reattachDocComments.js b/scripts/js-api/build-types/transforms/flow/reattachDocComments.js index 10cb040194ce..e2dbd77ad264 100644 --- a/scripts/js-api/build-types/transforms/flow/reattachDocComments.js +++ b/scripts/js-api/build-types/transforms/flow/reattachDocComments.js @@ -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; @@ -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' && diff --git a/scripts/js-api/build-types/transforms/flow/replaceEmptyWithNever.js b/scripts/js-api/build-types/transforms/flow/replaceEmptyWithNever.js index 4e8358df3cc2..4dafb3906390 100644 --- a/scripts/js-api/build-types/transforms/flow/replaceEmptyWithNever.js +++ b/scripts/js-api/build-types/transforms/flow/replaceEmptyWithNever.js @@ -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 { diff --git a/scripts/js-api/build-types/transforms/flow/replaceNullablePropertiesWithUndefined.js b/scripts/js-api/build-types/transforms/flow/replaceNullablePropertiesWithUndefined.js index b7ac98749a3e..85382d9f23c9 100644 --- a/scripts/js-api/build-types/transforms/flow/replaceNullablePropertiesWithUndefined.js +++ b/scripts/js-api/build-types/transforms/flow/replaceNullablePropertiesWithUndefined.js @@ -8,12 +8,12 @@ * @format */ -import type {ESNode, TypeAnnotationType} from 'hermes-estree'; -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 {ESNode, TypeAnnotationType} from 'flow-estree'; +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'); function isInsideObjectTypeProperty(node: TypeAnnotationType) { let current: ESNode = node; diff --git a/scripts/js-api/build-types/transforms/flow/replaceRequiresWithImports.js b/scripts/js-api/build-types/transforms/flow/replaceRequiresWithImports.js index 7e7026bb4eec..d91ec76d2bed 100644 --- a/scripts/js-api/build-types/transforms/flow/replaceRequiresWithImports.js +++ b/scripts/js-api/build-types/transforms/flow/replaceRequiresWithImports.js @@ -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 => ({ VariableDeclaration(node): void { diff --git a/scripts/js-api/build-types/transforms/flow/replaceStringishWithString.js b/scripts/js-api/build-types/transforms/flow/replaceStringishWithString.js index 619d93629078..77b70c18cf94 100644 --- a/scripts/js-api/build-types/transforms/flow/replaceStringishWithString.js +++ b/scripts/js-api/build-types/transforms/flow/replaceStringishWithString.js @@ -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 => ({ GenericTypeAnnotation(node): void { diff --git a/scripts/js-api/build-types/transforms/flow/stripPrivateProperties.js b/scripts/js-api/build-types/transforms/flow/stripPrivateProperties.js index 656291410105..7be59cfb437c 100644 --- a/scripts/js-api/build-types/transforms/flow/stripPrivateProperties.js +++ b/scripts/js-api/build-types/transforms/flow/stripPrivateProperties.js @@ -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 => ({ ObjectTypeProperty(node): void { diff --git a/scripts/js-api/build-types/translateSourceFile.js b/scripts/js-api/build-types/translateSourceFile.js index 952310db9062..842d89bc7430 100644 --- a/scripts/js-api/build-types/translateSourceFile.js +++ b/scripts/js-api/build-types/translateSourceFile.js @@ -9,13 +9,13 @@ */ import type {PluginObj} from '@babel/core'; -import type {ParseResult} from 'hermes-transform/dist/transform/parse'; -import type {TransformASTResult} from 'hermes-transform/dist/transform/transformAST'; +import type {ParseResult} from 'flow-transform/dist/transform/parse'; +import type {TransformASTResult} from 'flow-transform/dist/transform/transformAST'; const getDependencies = require('./resolution/getDependencies'); const applyBabelTransformsSeq = require('./utils/applyBabelTransformsSeq'); const translate = require('flow-api-translator'); -const {parse, print} = require('hermes-transform'); +const {parse, print} = require('flow-transform'); type PreTransformFn = ParseResult => Promise;