Skip to content

Commit

Permalink
Move generator to Hermes stable
Browse files Browse the repository at this point in the history
Summary:
This diff moved generator to the Hermes stable channel after experiments that
proved its correctness and performance.

Reviewed By: motiz88

Differential Revision: D26964593

fbshipit-source-id: 3e6f56b04c575ccf067d4f07d8ad90b626966f27
  • Loading branch information
Huxpro authored and facebook-github-bot committed Mar 24, 2021
1 parent e81a2cd commit b280477
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/metro-react-native-babel-preset/src/configs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const getPreset = (src, options) => {
{loose: true}, // dont 'a'.concat('b'), just use 'a'+'b'
]);
}
if (isHermesCanary && (isNull || src.indexOf('async') !== -1)) {
if (isHermes && (isNull || src.indexOf('async') !== -1)) {
extraPlugins.push([require('@babel/plugin-transform-async-to-generator')]);
}
if (!isHermes && (isNull || src.indexOf('**') !== -1)) {
Expand Down Expand Up @@ -157,7 +157,7 @@ const getPreset = (src, options) => {
require('@babel/plugin-transform-runtime'),
{
helpers: true,
regenerator: !isHermesCanary,
regenerator: !isHermes,
},
]);
}
Expand All @@ -174,9 +174,7 @@ const getPreset = (src, options) => {
{
plugins: [
...defaultPluginsBeforeRegenerator,
isHermesCanary
? null
: require('@babel/plugin-transform-regenerator'),
isHermes ? null : require('@babel/plugin-transform-regenerator'),
...defaultPluginsAfterRegenerator,
].filter(Boolean),
},
Expand Down

0 comments on commit b280477

Please sign in to comment.