mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove isHermesV1 from Babel preset (#56754)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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 fbshipit-source-id: 70d4cbc0ad365df551b744e3cc16e880ce41c90c
This commit is contained in:
1 parent
84b22ed791
commit
26040d8d54
1 file changed
+9
-9
+9
-9
@@ -57,25 +57,25 @@ const getPreset = (src, options, babel) => {
|
||||
|
||||
const dev = options?.dev ?? babel?.env('development') ?? false;
|
||||
|
||||
// Hermes V1 (aka Static Hermes) uses more optimised profiles.
|
||||
// There is currently no difference between stable and canary, but canary
|
||||
// may in future be used to test features in pre-prod Hermes versions.
|
||||
const isHermesV1 =
|
||||
// Hermes V1 uses more optimised transform profiles. There is currently no
|
||||
// difference between stable and canary, but canary may in future be used to
|
||||
// test features in pre-prod Hermes V1 versions.
|
||||
const isHermesProfile =
|
||||
transformProfile === 'hermes-stable' ||
|
||||
transformProfile === 'hermes-canary';
|
||||
|
||||
// We enable regenerator in dev builds for the time being because
|
||||
// We enable regenerator in Hermes V1 dev builds for the time being because
|
||||
// Hermes V1 doesn't yet fully support debugging native generators.
|
||||
// (e.g. - it's not possible to inspect local variables when paused in a
|
||||
// generator).
|
||||
//
|
||||
// Use native generators in release mode because it has already yielded perf
|
||||
// wins. The next release of Hermes will close this gap, so this won't
|
||||
// wins. The next release of Hermes V1 will close this gap, so this won't
|
||||
// be permanent.
|
||||
const enableRegenerator = isHermesV1 && dev;
|
||||
const enableRegenerator = isHermesProfile && dev;
|
||||
|
||||
// Preserve class syntax and related if we're using Hermes V1.
|
||||
const preserveClasses = isHermesV1;
|
||||
// Preserve class syntax and related features for Hermes V1 profiles.
|
||||
const preserveClasses = isHermesProfile;
|
||||
|
||||
// Preserve private class fields and methods if the experiment is enabled.
|
||||
const preserveClassPrivate = TRUE_VALS.has(
|
||||
|
||||
Reference in new issue
Block a user