-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Mention emnapi in documentation #17515
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,6 +17,7 @@ JavaScript and compiled C or C++: | |||||
created with: | ||||||
|
||||||
- :ref:`Embind or WebIDL-Binder<interacting-with-code-binding-cpp>` | ||||||
- :ref:`Emnapi (Node-API)<interacting-with-code-emnapi>` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the mention below is ok, but I would remove this one. The main part of this doc is for officially supported things in the emscripten repo. But adding a mention near the end is ok for unofficial stuff (while mentioning it is unofficial, as I see that you do). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||
|
||||||
- Call JavaScript functions from **C/C++**: | ||||||
|
||||||
|
@@ -798,6 +799,16 @@ for defining the binding: | |||||
of one tool over the other will usually be based on which is the most | ||||||
natural fit for the project and its build system. | ||||||
|
||||||
.. _interacting-with-code-emnapi: | ||||||
|
||||||
Binding C/C++ and JavaScript — Emnapi (Node-API for Emscripten) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It was copied from here emscripten/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst Lines 769 to 770 in fafcc86
I use |
||||||
=============================================================== | ||||||
|
||||||
`Emnapi`_ is an unofficial `Node-API`_ implementation for Emscripten. | ||||||
If you prefer Node-API, or you would like to port your Node.js addon | ||||||
written in Node-API to WebAssembly, you can give it a try. See | ||||||
`Emnapi documentation`_ for more details. | ||||||
|
||||||
.. _library.js: https://github.com/emscripten-core/emscripten/blob/main/src/library.js | ||||||
.. _test_js_libraries: https://github.com/emscripten-core/emscripten/blob/1.29.12/tests/test_core.py#L5043 | ||||||
.. _src/deps_info.json: https://github.com/emscripten-core/emscripten/blob/main/src/deps_info.json | ||||||
|
@@ -808,3 +819,6 @@ for defining the binding: | |||||
.. _tests/test_core.py: https://github.com/emscripten-core/emscripten/blob/1.29.12/tests/test_core.py#L4597 | ||||||
.. _Box2D: https://github.com/kripken/box2d.js/#box2djs | ||||||
.. _Bullet: https://github.com/kripken/ammo.js/#ammojs | ||||||
.. _Emnapi: https://github.com/toyobayashi/emnapi | ||||||
.. _Node-API: https://nodejs.org/dist/latest-v16.x/docs/api/n-api.html | ||||||
.. _Emnapi documentation: https://emnapi-docs.vercel.app/guide/getting-started.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it makes sense to list it here. Emnapi is specific set of bindings for node API, right? Not a method of writing new binding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my understanding, developers cannot use Node-API to write bindings in emscripten before emnapi exists, in a sense it is a new way to write bindings in emscripten, so it is listed here like embind.