Appcenter-cli: [Hermes] [iOS] `codepush release-react` fails to create Hermes bytecode for iOS

Created on 29 Apr 2021  路  3Comments  路  Source: microsoft/appcenter-cli

Description

With the advent of Hermes on iOS, it would make sense to distribute Hermes bundles via CodePush. Right now CodePush creates and distributes non-bytecode (plain source) update bundles on iOS. Thus, theoretically, app performance upon installing such an update can degrade.

Browsing the current code for the command, I can see that hermesc can only be invoked for Android projects.

Repro Steps

Please list the steps used to reproduce your issue.

  1. Have a Hermes-enabled iOS app (React Native 0.64+)
  2. Run appcenter release-react command for an iOS target. Wait until the bundle is created and uploaded.
  3. Access the Appcenter portal and navigate to the newly updated Code Push distribution's page.
  4. Click "Download bundle". Unzip the file.
  5. main.jsbundle contains minified JS source and not bytecode.

Expected behavior

If Hermes is enabled, the resulting update bundle is Hermes bytecode.

Details

  1. Is there a particular beacon/command that you are having trouble with?

    • codepush release-react

  2. Which version of the App Center CLI are you using?

    • latest

  3. Which OS version did you experience the issue on?

    • macOS BigSur 11.1

  4. What command line/shell are you using?

    • Shell 5.8 /bin/zsh

  5. What version of Node.js and NPM/Yarn are you using?

    • node v15

  6. Additionally, you can provide verbose logs of a CLI command by using DEBUG="appcenter-cli:*" before the command, for example, DEBUG="appcenter-cli:*" appcenter apps list. Include the logs here, don't forget to omit any personal/sensitive data.

All 3 comments

Good catch! Can't believe I didn't notice this before in my bundles.

I believe the best way to determine if Hermes is being used is by scanning the Podfile.lock for the string "hermes-engine", then just use hermesc as normal.

Even if the main focus should be iOS now (as a lot of people already switched to Hermes on iOS), this will also affect Windows and MacOS, as Hermes runs on those platforms too.

cc @eggli @azundo @andreidubov

Hey all,
Yes, we have it in the roadmap, but so far we can not give any ETA.

I'm thinking... Is it possible to at least highlight the fact that the aforementioned command will not build Hermes bytecode bundles? Users will then know that they have to manually build and upload the Hermes bundle.

I stumbled upon this quirk accidentally, and I guess not many people will find it on their own without a caveat.

It seems that with 0.65 even more people will be migrating to Hermes, especially with that sweet new GC implementation.

Was this page helpful?
0 / 5 - 0 ratings