mirror of
https://github.com/expo/expo-cli.git
synced 2026-11-15 21:31:03 -10:00
# Why
this pr addresses some missing parts of hermes support.
# How
1. add hermes bytecode bundle to `printBundleSizes`.
2. add hermes bytecode bundle support for `expo publish`.
3. support managed workflow by reading the `android.jsEngine` config in app.json.
4. `android.jsEngine` in app.json is now the single source of truth to determine if we need to generate hermes bytecode bundle.
5. introduce `maybeInconsistentEngineAsync()` to show an error prompt if there are inconsistencies between app config and native project.
# Test Plan
1. expo export + managed workflow app with `android.jsEngine=hermes` in app.json.
make sure exported assets has hermes bytecode bundle.
2. expo publish + managed workflow app with `android.jsEngine=hermes` in app.json.
download the asset and make sure it is a hermes bytecode bundle.
### Unit Test
```
packages/dev-server/src/__tests__/HermesBundler-test.ts
maybeInconsistentEngineAsync - android
should return false for managed project
should return false if "enableHermes: true" in app/build.gradle and "jsEngine: 'hermes'" in app.json (1 ms)
should return true if "enableHermes: false" in app/build.gradle and "jsEngine: 'hermes'" in app.json
should return false if "expo.jsEngine=hermes" in gradle.properties and "jsEngine: 'hermes'" in app.json (2 ms)
should return false for default sdk41 bare project
should return true for default sdk41 bare project but user enabled hermes manually
should handle the inconsistency between app/build.gradle and gradle.properties
```