Skip to content

Commit cd17456

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Remove isHermesV1 from Babel preset (#56754)
Summary: Pull Request resolved: #56754 Hermes V1 (Static Hermes) is now always enabled. Remove the isHermesV1 variable and inline its effects: - enableRegenerator is always based on dev mode (was isHermesV1 && dev) - preserveClasses is always true (was isHermesV1) Also update the comments to drop the 'V1' framing. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D104649639
1 parent 0a75d1e commit cd17456

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

  • packages/react-native-babel-preset/src/configs

packages/react-native-babel-preset/src/configs/main.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,25 @@ const getPreset = (src, options, babel) => {
5757

5858
const dev = options?.dev ?? babel?.env('development') ?? false;
5959

60-
// Hermes V1 (aka Static Hermes) uses more optimised profiles.
61-
// There is currently no difference between stable and canary, but canary
62-
// may in future be used to test features in pre-prod Hermes versions.
63-
const isHermesV1 =
60+
// Hermes V1 uses more optimised transform profiles. There is currently no
61+
// difference between stable and canary, but canary may in future be used to
62+
// test features in pre-prod Hermes V1 versions.
63+
const isHermesProfile =
6464
transformProfile === 'hermes-stable' ||
6565
transformProfile === 'hermes-canary';
6666

67-
// We enable regenerator in dev builds for the time being because
67+
// We enable regenerator in Hermes V1 dev builds for the time being because
6868
// Hermes V1 doesn't yet fully support debugging native generators.
6969
// (e.g. - it's not possible to inspect local variables when paused in a
7070
// generator).
7171
//
7272
// Use native generators in release mode because it has already yielded perf
73-
// wins. The next release of Hermes will close this gap, so this won't
73+
// wins. The next release of Hermes V1 will close this gap, so this won't
7474
// be permanent.
75-
const enableRegenerator = isHermesV1 && dev;
75+
const enableRegenerator = isHermesProfile && dev;
7676

77-
// Preserve class syntax and related if we're using Hermes V1.
78-
const preserveClasses = isHermesV1;
77+
// Preserve class syntax and related features for Hermes V1 profiles.
78+
const preserveClasses = isHermesProfile;
7979

8080
// Preserve private class fields and methods if the experiment is enabled.
8181
const preserveClassPrivate = TRUE_VALS.has(

0 commit comments

Comments
 (0)