# 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
```
* Patch android status bar to match the color of the splash screen
* Update packages/config-plugins/src/android/StatusBar.ts
* Update StatusBar.ts
* Update StatusBar-test.ts
* Update withAndroidSplashScreen.ts
# Why
to support hermes for managed workflow
closes [ENG-1222](https://linear.app/expo/issue/ENG-1222)
# How
add config-plugins and prebuild-configs to read `android.jsEngine` from app.json and update `expo.jsEngine` in `gradle.properties`
# Test Plan
### Unit Test
```
packages/config-plugins/src/android/__tests__/JsEngine-test.ts
jsEngine
returns default engine if no engine is provided (2 ms)
return the engine if provided
set the property if no property is existed (2 ms)
overwrite the property if an old property is existed
```
# Why
If an app is running with hermes runtime, `expo export` for self hosting update should also generate hermes bytecode instead of plain javascript.
# How
Assuming project should setup with pre-defined shape which set the runtime in gradle.properties like expo/expo#13052.
If exporting project is running with hermes, right after calling metro to build js bundles, we should further call `hermesc` to compile hbc.
The sourcemap also needs to re-compose by metro-source-map.
The overall flow is reference from [react-native's react.gradle](https://github.com/facebook/react-native/blob/0.63-stable/react.gradle).
# Test Plan
### Unit Test
```
HermesBundler-test.ts
parseGradleProperties
should return array of key-value tuple (2 ms)
should keep "=" in value if there are multiple "="
should exclude comment (1 ms)
getHermesBytecodeBundleVersionAsync
should return hermes bytecode version 74 for plain.74.hbc (13 ms)
should throw exception for plain javascript file (5 ms)
should throw exception for nonexistent file
isHermesBytecodeBundleAsync
should return true for hermes bytecode bundle file
should return false for plain javascript file
should throw exception for nonexistent file
```
### E2E Test
```
export-test.ts
should export hbc bundle if running with hermes (31292 ms)
```
# Why
For dev-menu to launch Hermes inspector.
# How
Through from metro-inspector-proxy (http://localhost:8081/json/list), we could get the url to open inspector. This requires manual steps to open inspector.
In this PR, we will launch chromium to open the inspector automatically.
# Test Plan
### Unit Test
```
createJsInspectorMiddleware
should return specific app entity for GET request with given applicationId (5 ms)
should return 404 for GET request with nonexistent applicationId (1 ms)
should return 400 for GET request without parameters
should open browser for PUT request with given applicationId (14 ms)
```
* [config-plugins] rename getBuildConfigurationForId -> getBuildConfigurationsForListId
* [config-plugins] make getBundleIdentifierFromPbxproj return bundle id for a named target
* [config-plugins] make setProvisioningProfileForPbxprojAsync set provisioning profile only for a particular build configuration
* address PR feedback