| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
|
@alshdavid , we had discussed this PR in our last Node-API meeting on 5/9/2025.
Overall, it is a great step towards the ABI-stable embedding API and thank you for doing it! |
Sorry, something went wrong.
🥳
I agree with your intuition here. node_embedding_main feels more appropriate.
I will update the PR to reflect these requirements and happy to write the documentation.
If I'm honest, outside of compsci 101 many years ago, I am very new to real-world C/C++ and would definitely require assistance with writing tests as I'm already treading water just trying to navigate the build system, templating and macros 😅. As for using node-api.h or js_native_api.h, I will give it a try but I'm a bit out of my depth and am concerned I will miss platform specific conditional templates or something (e.g. __cdecl was a surprise to me).
Likewise! Thank you for working with the team to get the ball rolling, obtaining consensus on the approach and helping out with the implementation specifics in comments to this PR. P.S. I wouldn't be offended if you added commits to this PR or rewrote it/raised a new PR that is idiomatic as I might need some time to get it right. |
Sorry, something went wrong.
@alshdavid , sure, I can do that to streamline the process. |
Sorry, something went wrong.
|
@alshdavid , I do not have permissions to update your PR branch directly. |
Sorry, something went wrong.
|
@vmoroz, thanks for the commit. I have applied those changes and amended the commit message to fit the Nodejs rules I have also added you as a co-author and given you write access to my fork if you'd like to make changes |
Sorry, something went wrong.
@alshdavid , it looks great! Let me also update the PR title. @nodejs/node-api and @nodejs/embedders , could you have a look at this PR? |
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #58207 +/- ##
=======================================
Coverage 89.65% 89.65%
=======================================
Files 676 677 +1
Lines 206342 206344 +2
Branches 39531 39523 -8
=======================================
+ Hits 184994 185005 +11
Misses 13475 13475
+ Partials 7873 7864 -9
... and 52 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
@vmoroz @mhdawson , updated the PR to fix the linting error and add some basic documentation. Feel free to modify the documentation to better suit. I tried to write an example but I'm better at Rust than I am C and I didn't want to write something misleading |
Sorry, something went wrong.
|
We discussed in the Node-api team meeting today and @vmoroz volunteered to pull the framework for testing from his PR into this one with a basic test. |
Sorry, something went wrong.
|
Hi @vmoroz, any chance you've had some time to look into this? |
Sorry, something went wrong.
|
Hey @vmoroz, I have merged your changes into this PR. I have also squashed the commits and rebased onto main. |
Sorry, something went wrong.
Thank you, @alshdavid! @joyeecheung , @addaleax , @legendecas , @KevinEady , could you have a look at this PR? |
Sorry, something went wrong.
|
On the Node-API team meeting, it was raised that the term rt (runtime) could be ambiguous and embedding is informative about the APIs' main use case, established in the current C++ APIs, e.g. https://github.com/nodejs/node/blob/main/doc/api/embedding.md. |
Sorry, something went wrong.
|
@legendecas, I've rebased the branch and renamed the init function to node_embedding_start |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for the change!
Sorry, something went wrong.
|
Hi @alshdavid , in the last Node-API meeting (2/20/2026) we had discussed the PR and the naming conventions. I had updated the code to follow the new naming conventions and updated the tests. Hopefully we will discuss it tomorrow (2/27/2026) in Node-API meeting and if it looks good, then you may consider to take the new code. @legendecas , could you please have a look? All changes on top of the main branch are in this commit: vmoroz@611d65c |
Sorry, something went wrong.
|
@vmoroz thanks for the diff. I've rebased the PR onto main and updated it with the changes to the function names 🙏 |
Sorry, something went wrong.
Co-authored-by: vmoroz <vmorozov@microsoft.com>
|
@vmoroz, I have sent you an invite (contributor with write permissions) to my fork if you want to maintain the branch directly. Feel free to raise PRs there or just push directly to the branch. I was just laid off (Atlassian) so I may not have the same time available to dedicate to keeping the PR up to date 🙏 |
Sorry, something went wrong.
|
This pull request has been marked as stale due to 90 days of inactivity. |
Sorry, something went wrong.
|
@avivkeller has this been abandoned or is there hope for something like this to land in the near future? |
Sorry, something went wrong.
|
This PR went stale. You are welcome to continue the work, should it need to be continued. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Currently, this PR is raised to aid in the discussion of #54660, which implements the complete API.
This PR only adds a single "unstable" C compatible function for embedders. node_embedding_start which forwards to node::Start.
While this function does not offer a complete embedder API like the aforementioned PR, when combined with some glue code on the JavaScript side and existing n-api functionality, it is sufficient to enable a large portion of use cases for embedders.
Example use cases; Calling into JavaScript plugins that feature Node.js compatibility from a language that can consume a C library (Rust, Go, Zig, C#, etc)
While a rich C API would be amazing, my hope is that in the interim, a smaller change is more likely to be included into Nodejs and unblocks consumers that want to embed it.
Reference consumer embedder implementations: