-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip plugin for non-Flow JS code #1556
Conversation
This pull request was exported from Phabricator. Differential Revision: D65272155 |
Summary: This is a mitigation for facebook#1549. Updates `babel-plugin-syntax-hermes-parser` 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: cipolleschi Differential Revision: D65272155
53ed266
to
9e3c666
Compare
This pull request was exported from Phabricator. Differential Revision: D65272155 |
Summary: This is a mitigation for facebook#1549. Updates `babel-plugin-syntax-hermes-parser` 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: robhogan, cipolleschi Differential Revision: D65272155
9e3c666
to
2768dc3
Compare
This pull request was exported from Phabricator. Differential Revision: D65272155 |
Summary: This is a mitigation for facebook#1549. Updates `babel-plugin-syntax-hermes-parser` 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 😅. Differential Revision: D65272155
2768dc3
to
04fcf39
Compare
This pull request was exported from Phabricator. Differential Revision: D65272155 |
Summary: This is a mitigation for facebook#1549. Updates `babel-plugin-syntax-hermes-parser` 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 😅. Differential Revision: D65272155
04fcf39
to
4c10248
Compare
This pull request was exported from Phabricator. Differential Revision: D65272155 |
Summary: This is a mitigation for facebook#1549. Updates `babel-plugin-syntax-hermes-parser` 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 😅. Differential Revision: D65272155
4c10248
to
62a3c4d
Compare
This pull request was exported from Phabricator. Differential Revision: D65272155 |
Summary: This is a mitigation for facebook#1549. Updates `babel-plugin-syntax-hermes-parser` 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: vzaidman Differential Revision: D65272155
62a3c4d
to
c1dcfcb
Compare
This pull request was exported from Phabricator. Differential Revision: D65272155 |
Doesn’t Reference:
|
@jbroma There's The test plan for this change requires |
thanks for clearing that up! makes sense 👍 |
Summary: This is a mitigation for facebook#1549. Updates `babel-plugin-syntax-hermes-parser` 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 😅. Differential Revision: D65272155
c1dcfcb
to
39eca9f
Compare
This pull request was exported from Phabricator. Differential Revision: D65272155 |
This pull request has been merged in f2970e7. |
Summary: Release version to 0.25.1 This release includes #1556, which will be configured in React Native to opt-out from `hermes-parser` under Babel for untyped JS — fixing compat with 3P plugins by users. (See facebook/react-native#46601, facebook/react-native#46696.) Reviewed By: cortinico Differential Revision: D65661003 fbshipit-source-id: faa0ea0a507b2b46ef7cf52fdabe3e3ff0a3851e
Summary: Original Author: huntie@meta.com Original Git: f2970e7 Original Reviewed By: pieterv Original Revision: D65272155 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: mattbfb Differential Revision: D65787624 fbshipit-source-id: b06f1499b2d02462777ac72f03d8bb5c713b0a19
Summary: Original Author: huntie@meta.com Original Git: 15e9b5c Original Reviewed By: cortinico Original Revision: D65661003 Release version to 0.25.1 This release includes #1556, which will be configured in React Native to opt-out from `hermes-parser` under Babel for untyped JS — fixing compat with 3P plugins by users. (See facebook/react-native#46601, facebook/react-native#46696.) Reviewed By: mattbfb Differential Revision: D65787623 fbshipit-source-id: f6b56d44cdb992ca01de75df384b4599bef8432b
Summary:
This is a mitigation for #1549.
Updates
babel-plugin-syntax-hermes-parser
to include a newparseLangTypes
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:
react-native
package, shipped as source — useshermes-parser
.babel/plugin-syntax-typescript
.babel/parser
(this change).I'd love to simplify this 😅.
Differential Revision: D65272155