Skip to content

Commit

Permalink
Remove plugin-transform-for-of from react-native-babel-preset (face…
Browse files Browse the repository at this point in the history
…book#792)

Summary:
## Summary

As a follow-up to facebook#789 , this PR removes `babel/plugin-transform-for-of` from the preset for JavaScriptCore users.

Pull Request resolved: facebook#792

Test Plan: All unit tests pass

Reviewed By: motiz88

Differential Revision: D34927434

Pulled By: rh389

fbshipit-source-id: d38cd529c371ca0e13071f26c00d3a322ff5fab6
  • Loading branch information
newyankeecodeshop authored and facebook-github-bot committed Mar 17, 2022
1 parent 5be7639 commit 381ae62
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/metro-react-native-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"@babel/plugin-transform-destructuring": "^7.0.0",
"@babel/plugin-transform-exponentiation-operator": "^7.0.0",
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@babel/plugin-transform-for-of": "^7.0.0",
"@babel/plugin-transform-function-name": "^7.0.0",
"@babel/plugin-transform-literals": "^7.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
Expand Down
8 changes: 0 additions & 8 deletions packages/metro-react-native-babel-preset/src/configs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ const getPreset = (src, options) => {

const isNull = src == null;
const hasClass = isNull || src.indexOf('class') !== -1;
const hasForOf =
isNull || (src.indexOf('for') !== -1 && src.indexOf('of') !== -1);

const extraPlugins = [];
if (!options.useTransformReactJSXExperimental) {
Expand Down Expand Up @@ -125,12 +123,6 @@ const getPreset = (src, options) => {
require('@babel/plugin-transform-exponentiation-operator'),
]);
}
if (!isHermes && hasForOf) {
extraPlugins.push([
require('@babel/plugin-transform-for-of'),
{loose: true},
]);
}
if (
isNull ||
src.indexOf('React.createClass') !== -1 ||
Expand Down

0 comments on commit 381ae62

Please sign in to comment.