Files
react-native/ReactCommon/hermes
Ryan Schoppmeyer 4a925c43c2 Support HermesAPILeanOrFull in react native apps (#36202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36202

This changes all of the in-built dependencies in react native app components upon hermes from HermesAPI to HermesAPIFullOrLean.

HermesAPI (full) includes the bytecode compiler and thus has support for eval().
HermesAPILean does not include the bytecode compiler. It throws at runtime if eval is called. The native dependencies are significantly smaller without the bytecode compiler.

The HermesAPIFullOrLean target toggles between full and lean modes based on the value of buckconfig field `hermes.lean_vm` (default is false). Therefore, without overriding this config option, this change is a no-op and should result in react native apps being built with exactly the same dependencies as before.

If you do specify it, you lose eval support at runtime and gain an apk size savings of a few hundred kB after compression.

This also removes the vestigial `hermes_api_dep()` build macro.

skip-frl-buck-targeting

Reviewed By: javache

Differential Revision: D43283200

fbshipit-source-id: 0157be4a9339f70e73d29d694c18b31805107000
2023-03-07 06:33:14 -08:00
..