-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip plugin for non-Flow JS code (#1556)
Summary: Pull Request resolved: #1556 This is a mitigation for #1549. Updates `babel-plugin-syntax-hermes-parser` to include a new `parseLangTypes` option, which we will configure in React Native's Babel preset to abort when the file contents do not include `flow`. **Context: React Native** Originally changed in facebook/react-native#46696, as our internal Flow support had diverged from `babel/plugin-syntax-flow` (facebook/react-native#46601). We effectively have three flavours of JavaScript in support: - Flow@latest for the `react-native` package, shipped as source — uses `hermes-parser`. - TypeScript for product code (community template, Expo) — uses `babel/plugin-syntax-typescript`. - Plain JavaScript/JSX in product code, *which may be extended with additional user Babel plugins and needs lenient parsing* — uses base `babel/parser` (**this change**). I'd love to simplify this 😅. Reviewed By: pieterv Differential Revision: D65272155 fbshipit-source-id: b3be10410962ffffd4e0d483d10fe88d865c0783
- Loading branch information
1 parent
54e428c
commit f2970e7
Showing
2 changed files
with
80 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters