You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spike: move the napi host and addon loading into React Native core #495
Prove the RFC in #447: an app with no react-native-node-api native host can load an addon linked against the Hermes stub from #494, with core providing the napi host and addon loading.
Steps
On a branch of a react/react-native fork, move the napi host and addon loading into core. Android first.
Build an app from that source, without our native host, with an addon linked against the stub.
Check that the addon loads, its calls land in Hermes, and the relevant tests pass.
Publish the branch as a draft PR on the fork, so the RFC has a concrete diff to point at.
What this should settle
What has to move. Something must load the addon as well as host it. Today that path is require("./addon.node") → Babel transform → requireNodeAddon(). Core needs one primitive for this, while the Babel plugin, link and the naming scheme may be able to stay here.
Whether hermes_napi.h can stay internal. It declares embedder API such as hermes_napi_create_env and hermes_run_script, so it should be a private dependency of core's napi host, not a public header. Addons use node-api-headers.
The library exporting it keeps a stable name, or React Native declares a supported one. 0.82 renamed libhermes.so to libhermesvm.so, and another rename would break published addons.
node-api-headers defines the interface, so a mismatch with it is a Hermes bug and needs no separate ask.
Activity