-
Notifications
You must be signed in to change notification settings - Fork 4
Explicit weak-node-api
linkage
#249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
242ac2d
Expose includable WEAK_NODE_API_CONFIG to CMake projects
kraenhansen 23420f0
Use the `include(${WEAK_NODE_API_CONFIG})` syntax in our own tests
kraenhansen f880d62
Turn define arguments into arrays of objects with key-value-pair
kraenhansen 6c98a22
Add general documentation on weak-node-api
kraenhansen 38b9113
Make injection of CMAKE_JS_* variables opt-in and provide our own exp…
kraenhansen 1fcc776
Add --weak-node-api option to gyp-to-cmake
kraenhansen 772a64a
Use weak-node-api linkage in node-addon-examples
kraenhansen 63c8a27
Opt into cmake-js compatibility in node-tests
kraenhansen eabad31
Fixed bug passing type through defines
kraenhansen 759a530
Fixed bug when calling cmake-rn in node-tests
kraenhansen e002331
Fix missing set_target_properties of .node suffix
kraenhansen 0fd0c23
Apply suggestion from @Copilot to documentation
kraenhansen f043bb7
Use [] instead of Array
kraenhansen fc511c9
Push into an array instead of creating a new on every --define
kraenhansen a7f3d66
Update packages/gyp-to-cmake/src/transformer.ts
kraenhansen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"gyp-to-cmake": minor | ||
--- | ||
|
||
Add --weak-node-api option to emit CMake configuration for use with cmake-rn's default way of Node-API linkage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"cmake-rn": minor | ||
--- | ||
|
||
Breaking: `CMAKE_JS_*` defines are no longer injected by default (use --cmake-js to opt-in) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"cmake-rn": minor | ||
--- | ||
|
||
Expose includable WEAK_NODE_API_CONFIG to CMake projects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# The `weak-node-api` library | ||
|
||
Android's dynamic linker imposes 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`. | ||
|
||
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 exposes only Node-API and will have its implementation injected by the host. | ||
|
||
While technically not a requirement on non-Android platforms, we choose to make this the general approach 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.