Skip to content

Commit 97bea46

Browse files
retyuimeta-codesync[bot]
authored andcommitted
Change default transform profile to 'hermes-stable' #2 (#57911)
Summary: Issue: #57174 Initially, this PR was created to fix an issue above: #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: #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
1 parent 2b83552 commit 97bea46

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/community-cli-plugin/src/commands/bundle

packages/community-cli-plugin/src/commands/bundle/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ const bundleCommand: CommunityCommand = {
9898
{
9999
name: '--unstable-transform-profile <string>',
100100
description:
101-
'Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default',
102-
default: 'default',
101+
'Experimental, transform JS for a specific JS engine. Currently supported: hermes-stable, hermes-canary, default',
102+
default: 'hermes-stable',
103103
},
104104
{
105105
name: '--asset-catalog-dest [string]',

0 commit comments

Comments
 (0)