Skip to content

Commit

Permalink
Update xplat/js/tools/metro Babel config to use `babel-plugin-syntax-…
Browse files Browse the repository at this point in the history
…hermes-parser`

Summary:
`babel-plugin-syntax-hermes-parser` allows us to use the latest Flow syntax.

After changes to the plugin SamZ made for version 0.18.1, it only applies to Flow files (leaving TS files to be parsed by Babel): https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md#0181

Reviewed By: robhogan

Differential Revision: D53597388

fbshipit-source-id: 461627483a6726377fbdc7a452afb808d1479b75
  • Loading branch information
gkz authored and facebook-github-bot committed Feb 15, 2024
1 parent 451e2a1 commit c0e6d28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const fs = require('fs');
import type {BabelCoreOptions} from '@babel/core';
*/
const plugins = [
'babel-plugin-syntax-hermes-parser',
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-syntax-class-properties',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@typescript-eslint/parser": "^6.7.4",
"acorn": "^8.7.1",
"babel-jest": "^29.6.3",
"babel-plugin-syntax-hermes-parser": "0.19.1",
"chalk": "^4.0.0",
"debug": "^2.2.0",
"eslint": "^8.23.1",
Expand Down

0 comments on commit c0e6d28

Please sign in to comment.