Skip to content

Commit

Permalink
metro-config: Revert setting hermesParser: true in default Metro co…
Browse files Browse the repository at this point in the history
…nfig (#47670)

Summary:
Pull Request resolved: #47670

Now that we have `babel-plugin-syntax-hermes-parser` in `react-native/babel-preset` (since D63535216), it's no longer necessary to use `hermes-parser` directly in Metro in order to use newer Flow syntax.

Babel with `babel-plugin-syntax-hermes-parser` is generally preferable, because it intelligently falls back to parsing with Babel for any non-`flow` files.

See facebook/hermes#1549 for context.

Changelog:
[General][Fixed] metro-config: Don't use `hermes-parser` by default, prefer `babel-plugin-syntax-hermes-parser`, which supports other syntax plugins.

Reviewed By: huntie

Differential Revision: D66002056

fbshipit-source-id: cf48acec347e2c0791872f8ca4b53f5f8af1c783
  • Loading branch information
robhogan authored and blakef committed Dec 4, 2024
1 parent 73f6277 commit 304179d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/metro-config/src/index.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export function getDefaultConfig(projectRoot: string): ConfigT {
babelTransformerPath: require.resolve(
'@react-native/metro-babel-transformer',
),
hermesParser: true,
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
Expand Down

0 comments on commit 304179d

Please sign in to comment.