From 97bea4625dd7bb74c8d84a7b3140a00ebd516cb0 Mon Sep 17 00:00:00 2001 From: D N <4661784+retyui@users.noreply.github.com> Date: Wed, 9 Sep 2026 03:44:00 -0700 Subject: [PATCH] Change default transform profile to 'hermes-stable' #2 (#57911) Summary: Issue: https://github.com/react/react-native/issues/57174 Initially, this PR was created to fix an issue above: https://github.com/react/react-native/pull/57208 --- But after re-testing it on the latest React Native `0.87.x`. I found out that cli set `unstable_transformProfile` value to `default` (cli -> metro -> babel -> rn/babel-preset) ```tsx function getTransformProfile(caller) { return caller?.unstable_transformProfile ?? 'hermes-stable'; ^^^ has a 'default' value (from CLI) } ``` --- So, `isHermesProfile` is always `false` here: https://github.com/react/react-native/blob/22cfb5caec78cb21b4a66b0ab82b03cc5f99a4dd/packages/react-native-babel-preset/src/configs/main.js#L63 and unnecessary babel plugins has applied ## Changelog: [GENERAL] [CHANGED] - Change default transform profile to 'hermes-stable' Pull Request resolved: https://github.com/react/react-native/pull/57911 Test Plan: ```java npx react-native-community/cli init --pm yarn RN87 cd RN87 open node_modules/react-native/babel-preset/src/configs/main.js // add Logs to print (isHermesProfile, transformProfile) vars // Run build ./android/gradlew -p android assembleRelease // Check logs (have to be `isHermesProfile: false, transformProfile: 'default') // Apply fix open node_modules/react-native/community-cli-plugin/dist/commands/bundle/index.js // Find a `--unstable-transform-profile` option // And change `default: "default",` => `default: "hermes-stable",` // Run build again ``` Reviewed By: christophpurrer Differential Revision: D119189290 Pulled By: cortinico fbshipit-source-id: e21ce35044d474b778f1fa8efe777ca0d9e37c7a --- packages/community-cli-plugin/src/commands/bundle/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/community-cli-plugin/src/commands/bundle/index.js b/packages/community-cli-plugin/src/commands/bundle/index.js index 7f82ef81d67..ee393c20ada 100644 --- a/packages/community-cli-plugin/src/commands/bundle/index.js +++ b/packages/community-cli-plugin/src/commands/bundle/index.js @@ -98,8 +98,8 @@ const bundleCommand: CommunityCommand = { { name: '--unstable-transform-profile ', description: - 'Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default', - default: 'default', + 'Experimental, transform JS for a specific JS engine. Currently supported: hermes-stable, hermes-canary, default', + default: 'hermes-stable', }, { name: '--asset-catalog-dest [string]',