rnx-kit
rnx-kit copied to clipboard
Plan for supporting Hermes in rnx-bundle and rnx-start
Develop a plan for supporting Hermes bundle creation via "rnx-bundle" and "rnx-start". Result should be the same as "react-native bundle" and "react-native start". Bundle file, source map file, and assets.
Meta wants Hermes to become the only support RN VM. How will this impact our CLI and tools, and our larger plans? And will the community accept this change?
Output is an engineering plan.
Hermes byte-code isn't stable and doesn't change on the same schedule as React Native.
We have concerns around byte-code bundles, built with version X of Hermes, matching up with the version of Hermes on a native host. Meta has no plans to freeze or produce a long-term supported version yet, so we need to carefully match Hermes build version with Hermes runtime version.
Hermes bundling could run as an on-demand service, as part of app delivery rather than at build time. For example, we produce a JS bundle for a particular version of react-native, and we "JIT-transpile" it to Hermes byte-code as needed, based on the Hermes version on the client.
Does Hermes support Metro delivering byte-code updates to the app during dev-serving? Like fast refresh, but with byte-code bundles. Anandraj has details.
Can iOS run Hermes byte-code? Is it interpreted or JIT-compiled into native code? Not sure.
Microsoft Teams:
- Interested in bundle splitting with Hermes
- Bundle splitting and Hermes are at odds with each other. Hermes is meant to hold one big bundle for multiple apps.
Can iOS run Hermes byte-code? Is it interpreted or JIT-compiled into native code? Not sure.
FYI, Apple does not allow JIT on iOS. It has to be interpreted.
FYI: https://github.com/facebook/metro/pull/546 -> Add support for bytecode compilation & bytecode bundles
And it's gone: https://github.com/facebook/metro/commit/833f2ffc3624d53bea18d46797a24a034e9b264a