WhoBuilt

Hermes + Node API: A Match Made in Heaven

Sep 8, 2025· 25 min· 571 views·Watch on YouTube

Speakers

Khalef Hosany and Vladimir Morozov, both from Microsoft in Seattle, explain how Node-API can bring stable native modules to React Native at React Universe Conf 2025.

What Node-API provides

Node-API is a C-based interface for native modules that works across JavaScript engines. Its stable ABI lets modules compiled against an earlier Node-API version keep working in newer runtimes without recompilation. The API covers more than 100 functions, and its current version is 10.

How modules use the API

Vladimir describes how Node-API functions work with an environment, JavaScript values, and status codes, with functions for errors and exceptions. Values live on a stack that is cleared after a native call, so modules use explicitly deleted global references to preserve them across calls. Modules can be written in C or languages that interoperate with C, including C++, Rust, and Go.

Bringing Node-API to Hermes

React Native for Windows adopted Node-API to support multiple JavaScript engines and native languages such as C and C++. The team began a JSI runtime implementation in 2021, added an implementation to its Hermes fork in 2022, and later began upstreaming it to Hermes. They ported Node.js tests and run them using a Node-like process with Hermes.

Keeping Hermes compatible across React Native versions

The Windows implementation currently wraps Node-API through JSI, with a goal of supporting both interfaces side by side. The team maps JSI versions to React Native versions because releases expose different JSI functions. This lets one Hermes DLL and JSI wrapper serve multiple React Native versions, including older apps.

Demos and current capabilities

The demos show a Node-API module running in Node.js and Hermes, with the same result, and demonstrate code in C and C++. Hosany says precompiled modules can work across React Native versions, and developers can use languages that bind to C. Reusing Node.js modules in React Native still needs more work, while using the latest Hermes is already supported in React Native for Windows.

Takeaways

  • A stable ABI can reduce the need to rebuild native modules for each runtime version.
  • Node-API offers a C-based interface that can be used from C, C++, Rust, Go, and other languages that interoperate with C.
  • React Native for Windows uses a JSI wrapper around Node-API to support multiple React Native versions with one Hermes DLL.
  • Node-API support is a step toward using Node.js modules in React Native, but that reuse is not yet complete.
  • Teams can consult the Node.js test suite and adapt it to validate Node-API behavior in another runtime.

Mentioned in this talk

Search inside this talk

What was claimed 12

Related talks

Hermes + Node API: A Match Made in Heaven, Khalef Hosany, Vladimir Morozov · WhoBuilt