0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools
Jason Ginchereau 56e881d0b0
n-api: add support for abi stable module API
Add support for abi stable module API (N-API) as "Experimental feature".
The goal of this API is to provide a stable Node API for native
module developers. N-API aims to provide ABI compatibility guarantees
across different Node versions and also across different
Node VMs - allowing N-API enabled native modules to just work
across different versions and flavors of Node.js without recompilation.

A more detailed introduction is provided in:
https://github.com/nodejs/node-eps/blob/master/005-ABI-Stable-Module-API.md
and https://github.com/nodejs/abi-stable-node/blob/doc/VM%20Summit.pdf.

The feature, during its experimental state, will be guarded by a runtime
flag "--napi-modules". Only when this flag is added to the command line
will N-API modules along with regular non N-API modules be supported.

The API is defined by the methods in "src/node_api.h" and
"src/node_api_types.h". This is the best
starting point to review the API surface. More documentation will follow.

In addition to the implementation of the API using V8, which is included
in this PR, the API has also been validated against chakracore and that
port is available in
https://github.com/nodejs/abi-stable-node/tree/api-prototype-chakracore-8.x.

The current plan is to provide N-API support in versions 8.X and 6.X
directly. For older versions, such as 4.X or pre N-API versions of 6.X,
we plan to create an external npm module to provide a migration path
that will allow modules targeting older Node.js versions to use the API,
albeit without getting the advantage of not having to recompile.

In addition, we also plan an external npm package with C++ sugar to
simplify the use of the API. The sugar will be in-line only and will
only use the exported N-API methods but is not part of the N-API
itself. The current version is in:
https://github.com/nodejs/node-api.

This PR is a result of work in the abi-stable-node repo:
https://github.com/nodejs/abi-stable-node/tree/doc,
with this PR being the cumulative work on the api-prototype-8.x
branch with the following contributors in alphabetical order:

Author: Arunesh Chandra <arunesh.chandra@microsoft.com>
Author: Gabriel Schulhof <gabriel.schulhof@intel.com>
Author: Hitesh Kanwathirtha <hiteshk@microsoft.com>
Author: Ian Halliday <ianhall@microsoft.com>
Author: Jason Ginchereau <jasongin@microsoft.com>
Author: Michael Dawson <michael_dawson@ca.ibm.com>
Author: Sampson Gao <sampsong@ca.ibm.com>
Author: Taylor Woll <taylor.woll@microsoft.com>
PR-URL: https://github.com/nodejs/node/pull/11975
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-03 10:31:25 +02:00
..
configure.d tools: remove unnecessary imports and assignments 2016-07-08 20:17:08 +05:30
doc meta: restore original copyright header 2017-03-10 11:23:48 -08:00
eslint eslint: remove dangling eslint symlink 2017-01-12 13:29:36 -08:00
eslint-rules tools: add unescaped regexp dot rule to linter 2017-03-29 10:53:28 +02:00
gyp build: enable cctest to use generated objects 2017-03-24 08:28:43 -07:00
icu tools: add missing #include "unicode/putil.h" 2017-03-30 14:20:52 -07:00
msvs win,msi: add required UIRef for localized strings 2016-12-20 14:41:23 +00:00
osx-pkg.pmdoc build: fix .pkg creation tooling 2015-09-06 21:38:09 +10:00
pkgsrc
rpm tools: add --prof-process flag to node binary 2015-12-08 02:00:46 +01:00
certdata.txt tools: update certdata.txt 2016-06-23 09:24:16 +02:00
check-imports.py tools: rewrite check-install.sh in python 2016-04-25 19:22:50 +05:30
compress_json.py src: add /json/protocol endpoint to inspector 2016-09-23 18:51:47 +02:00
cpplint.py build: add cpp linting to windows build 2017-03-17 09:22:46 -07:00
create_android_makefiles build: add script to create Android .mk files 2016-03-22 19:17:28 +01:00
create_expfile.sh build: fix dependencies on AIX 2016-08-29 16:20:18 -04:00
genv8constants.py
getmoduleversion.py build: configure --shared 2016-06-28 17:48:22 -04:00
getnodeversion.py build: configure --shared 2016-06-28 17:48:22 -04:00
gyp_node.py build: don't compile with -B, redux 2016-05-10 12:01:10 +02:00
install.py n-api: add support for abi stable module API 2017-04-03 10:31:25 +02:00
js2c.py src: support UTF-8 in compiled-in JS source files 2017-02-13 19:16:14 +01:00
jslint.js tools: add -F flag for fixing lint issues 2016-05-02 16:58:52 -07:00
license2rtf.js lib,tools: remove unneeded escaping of / 2016-11-23 22:06:24 -08:00
license-builder.sh deps: switch to v8_inspector in V8 2017-02-22 15:56:58 +01:00
lsan_suppressions.txt build: add --enable-asan with builtin leakcheck 2015-09-06 21:38:00 +10:00
macosx-firewall.sh tools: add macosx-firwall script to avoid popups 2016-12-09 08:31:08 +01:00
make-v8.sh v8: update make-v8.sh to use git 2016-11-09 17:34:22 -05:00
Makefile
mk-ca-bundle.pl tools: output include guards in mk-ca-bundle.pl 2016-06-23 09:25:30 +02:00
mkssldef.py build: export zlib symbols on Windows 2016-08-08 15:15:48 +02:00
osx-codesign.sh build: update build targets for io.js 2015-06-25 15:22:27 +10:00
osx-pkg-postinstall.sh
osx-productsign.sh build: update build targets for io.js 2015-06-25 15:22:27 +10:00
release.sh tools: use long format for gpg fingerprint 2016-11-07 10:34:10 -05:00
run-valgrind.py tools: make run-valgrind.py useful 2016-11-15 17:01:24 +01:00
sign.bat win,build: try multiple timeservers when signing 2016-10-19 00:11:02 +11:00
specialize_node_d.py tools: remove unnecessary imports and assignments 2016-07-08 20:17:08 +05:30
test-npm-package.js build: add node-inspect integration test 2017-02-13 14:50:29 +01:00
test-npm.sh tools: update npm test tooling for 3.3.10+ 2015-11-02 14:22:41 -05:00
test.py n-api: add support for abi stable module API 2017-04-03 10:31:25 +02:00
update-authors.sh doc: make tools/update-authors.sh cross-platform 2015-03-11 13:25:17 +01:00
utils.py build: enable compilation for linuxOne 2016-03-29 18:52:48 -04:00