Commit 97bea46
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
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
| 101 | + | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments