microsoft / appcenter-cli

Command-line Interface (CLI) for Visual Studio App Center
https://appcenter.ms/
MIT License
581 stars 234 forks source link

Allow users to specify a path to hermesc #2459

Closed abejfehr closed 11 months ago

abejfehr commented 12 months ago

Is your feature request related to a problem? Please describe.

When producing a codepush, it might work but fail to be transpiled into bytecode because the CLI fails to find hermesCommand.

This can result in poor performance for clients, since it's significantly cheaper for hermes to parse bytecode than it is to parse JS

Describe the solution you'd like

I'd like a flag for appcenter codepush release-react that lets us specify the location of hermesc

Describe alternatives you've considered

What we've been doing up until now was patching the app/build.gradle file using sed to make the path correct from the CLI's context:

sed -i "s+hermesCommand: \"../../../../../+hermesCommand: \"../../+g" ./apps/mobile/retail/android/app/build.gradle

(it was previously incorrect because we're in a monorepo)

Since upgrading to React Native 72, it's drifted again because the build.gradle actually looks like this:

...
react {
    ...
    hermesCommand = "$rootDir/../../../../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
}
...

so now we have to reverse engineer this CLI to see what format to modify hermesCommand into for it to work

abejfehr commented 11 months ago

It turns out that in our case, enableHermes is no longer a setting in build.gradle, so we needed to manually specify --use-hermes in the CLI, after which it correctly found the hermesc in the node_modules folder.

I'm leaving the issue open because the automatic check for whether hermes is enabled doesn't work with the new format of build.gradle

DmitriyKirakosyan commented 11 months ago

@abejfehr , thank you for reporting this feature request. It looks similar to https://github.com/microsoft/appcenter-cli/issues/2212. Can you please check if you have hermesEnabled in your gradle.properties?

abejfehr commented 11 months ago

@DmitriyKirakosyan hermesEnabled is true in gradle.properties in our project

DmitriyKirakosyan commented 11 months ago

@abejfehr thank you for confirming!

We have decided not to implement this feature in the foreseeable future. However, we truly appreciate and welcome your contribution!