Skip to content

Commit 6c98a22

Browse files
committed
Add general documentation on weak-node-api
1 parent f880d62 commit 6c98a22

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/WEAK-NODE-API.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# The `weak-node-api` library
2+
3+
Android's dynamic linker impose restrictions on the access to global symbols (such as the Node-API free functions): A dynamic library must explicitly declare any dependency bringing symbols it needs as `DT_NEEDED`.
4+
5+
The implementation of Node-API is split between Hermes and our host package and to avoid addons having to explicitly link against either, we've introduced a `weak-node-api` library (published in `react-native-node-api` package). This library expose only Node-API and will have it's implementation injected by the host.
6+
7+
While technically not a requirement on non-Android platforms, we choose to make this the general approach across across React Native platforms. This keeps things aligned across platforms, while exposing just the Node-API without forcing libraries to build with suppression of errors for undefined symbols.

0 commit comments

Comments
 (0)