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
Node.js Feature Request: Embedded Host API & NativeWrapperGen Solution with Decorator and Tool Support & Infrastructure Change #51824
Using JavaScript as a library and plugin extension for existing C/C++ programs requires a substantial amount of work, where writing glue code is particularly complex and error-prone.
What is the feature you are proposing to solve the problem?
Key Features:
Define a basic type table(reference ffi)and decorate functions (export2c in nativegen.js)
Auto-generate .h, .cc, and Makefile files from a library file (library.js/plugin.js) where functions are already decorated using export2c from nativegen.js
Nativegen.js implement the tools main function
Technical Challenges:
1. Is it necessary to run the libuv event loop on a separate thread? Merely pump out the event queue is insufficient as code with persistent logic (such as a server) will not function.
2. For sync api, communication with the event loop by async handle/async send? Implement send call with c++ promise from caller, activate c++ promise on finish call, and return values on the C/C++ side.
3. For async api(promise handling): set callback on V8 promise to activate c++ promise for valueb back to caller.
4. Exception propagation: from JavaScript to C++, including catch, wrapper, and rethrow mechanisms.
Infrastructure change Requirements:
Include with node-embedded.tar(like python)
• node.h, v8.h (and all related child.h), uv.h
• libnode.lib (win), libuv.lib (win)
• libnode.so/libnode.dll, libuv.dll(win)
There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the
never-staleIssues and PRs exempt from automated stale handling.
label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
Activity
congzhangzh commentedon Mar 9, 2024
Ref: https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-shared-library-support.md
github-actions commentedon Sep 6, 2024
There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-staleIssues and PRs exempt from automated stale handling.
label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
github-actions commentedon Oct 6, 2024
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
For more information on how the project manages feature requests, please consult the feature request management document.