Skip to content

Commit 0d26703

Browse files
committed
Merge remote-tracking branch 'upstream/master' into contexted-tsfn-api-gcc-4
2 parents 692fbe1 + beccf21 commit 0d26703

19 files changed

+472
-100
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
matrix:
1515
- NODEJS_VERSION=node/10
1616
- NODEJS_VERSION=node/12
17-
- NODEJS_VERSION=node/13
17+
- NODEJS_VERSION=node/14
1818
- NODEJS_VERSION=nightly
1919
matrix:
2020
fast_finish: true

CHANGELOG.md

Lines changed: 100 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,99 @@
11
# node-addon-api Changelog
22

3+
## 2020-04-30 Version 3.0.0, @NickNaso
4+
5+
### Notable changes:
6+
7+
#### API
8+
9+
- `Napi::Object` added templated property descriptors.
10+
- `Napi::ObjectWrap` added templated methods.
11+
- `Napi::ObjectWrap` the wrap is removed only on failure.
12+
- `Napi::ObjectWrap` the constructor's exceptions are gracefully handled.
13+
- `Napi::Function` added templated factory functions.
14+
- Added `Env::RunScript` method to run JavaScript code contained in a string.
15+
- Added templated version of `Napi::Function`.
16+
- Added benchmarking framework.
17+
- Added support for natove addon instance data.
18+
- Added `Napi::AsyncProgressQueueWorker` api.
19+
- Changed the guards to `NAPI_VERSION > 5`.
20+
- Removed N-API implementation (v6.x and v8.x support).
21+
- `Napi::AsyncWorker::OnWorkComplete` and `Napi::AsyncWorker::OnExecute` methods
22+
are override-able.
23+
- Removed erroneous finalizer cleanup in `Napi::ThreadSafeFunction`.
24+
- Disabled cahcing in `Napi::ArrayBuffer`.
25+
- Explicitly disallow assign and copy operator.
26+
- Some minor corrections and improvements.
27+
28+
#### Documentation
29+
30+
- Updated documentation for `Napi::Object`.
31+
- Updated documentation for `Napi::Function`.
32+
- Updated documentation for `Napi::ObjectWrap`.
33+
- Added documentation on how to add benchmark.
34+
- Added documentation for `Napi::AsyncProgressQueueWorker`.
35+
- Added suggestion about tags to use on NPM.
36+
- Added reference to N-API badges.
37+
- Some minor corrections all over the documentation.
38+
39+
#### TEST
40+
41+
- Updated test cases for `Napi::Object`.
42+
- Updated test cases for `Napi::Function`.
43+
- Updated test cases for `Napi::ObjectWrap`.
44+
- Updated test cases for `Napi::Env`.
45+
- Added test cases for `Napi::AsyncProgressQueueWorker`.
46+
- Some minor corrections all over the test suite.
47+
48+
### Commits
49+
50+
* [[`187318e37f`](https://github.com/nodejs/node-addon-api/commit/187318e37f)] - **doc**: Removed references to Node.js lower than 10.x. (#709) (Nicola Del Gobbo)
51+
* [[`9c9accfbbe`](https://github.com/nodejs/node-addon-api/commit/9c9accfbbe)] - **src**: add support for addon instance data (Gabriel Schulhof) [#663](https://github.com/nodejs/node-addon-api/pull/663)
52+
* [[`82a96502a4`](https://github.com/nodejs/node-addon-api/commit/82a96502a4)] - **src**: change guards to NAPI\_VERSION \> 5 (Gabriel Schulhof) [#697](https://github.com/nodejs/node-addon-api/pull/697)
53+
* [[`a64e8a5641`](https://github.com/nodejs/node-addon-api/commit/a64e8a5641)] - **ci**: move travis from 13 to 14 (#707) (Gabriel Schulhof)
54+
* [[`4de23c9d6b`](https://github.com/nodejs/node-addon-api/commit/4de23c9d6b)] - **doc**: fix support bigint64/biguint64 guards (Yulong Wang) [#705](https://github.com/nodejs/node-addon-api/pull/705)
55+
* [[`fedc8195e3`](https://github.com/nodejs/node-addon-api/commit/fedc8195e3)] - **doc**: fix semicolon missing in async\_worker.md (Azlan Mukhtar) [#701](https://github.com/nodejs/node-addon-api/pull/701)
56+
* [[`cdb662506c`](https://github.com/nodejs/node-addon-api/commit/cdb662506c)] - **doc**: fix typo in bigint.md (#700) (Kelvin)
57+
* [[`e1a827ae29`](https://github.com/nodejs/node-addon-api/commit/e1a827ae29)] - **src**: fix AsyncProgressQueueWorker compilation (#696) (Gabriel Schulhof) [#696](https://github.com/nodejs/node-addon-api/pull/696)
58+
* [[`2c3d5df463`](https://github.com/nodejs/node-addon-api/commit/2c3d5df463)] - Merge pull request #692 from kelvinhammond/patch-1 (Nicola Del Gobbo)
59+
* [[`623e876949`](https://github.com/nodejs/node-addon-api/commit/623e876949)] - Merge pull request #688 from NickNaso/badges (Nicola Del Gobbo)
60+
* [[`6c97913d1f`](https://github.com/nodejs/node-addon-api/commit/6c97913d1f)] - Fix minor typo in object\_lifetime\_management.md (Kelvin)
61+
* [[`6b8dd47c55`](https://github.com/nodejs/node-addon-api/commit/6b8dd47c55)] - Added badge section to documentation. (NickNaso)
62+
* [[`89e62a9154`](https://github.com/nodejs/node-addon-api/commit/89e62a9154)] - **doc**: recommend tags of addon helpers (legendecas) [#683](https://github.com/nodejs/node-addon-api/pull/683)
63+
* [[`ab018444ae`](https://github.com/nodejs/node-addon-api/commit/ab018444ae)] - **src**: implement AsyncProgressQueueWorker (legendecas) [#585](https://github.com/nodejs/node-addon-api/pull/585)
64+
* [[`d43da6ac2b`](https://github.com/nodejs/node-addon-api/commit/d43da6ac2b)] - **doc**: add @legendecas to active member list (legendecas)
65+
* [[`cb498bbe7f`](https://github.com/nodejs/node-addon-api/commit/cb498bbe7f)] - **doc**: Add Napi::BigInt::New() overload for uint64\_t (ikokostya)
66+
* [[`baaaa8452c`](https://github.com/nodejs/node-addon-api/commit/baaaa8452c)] - **doc**: link threadsafe function from JS function (legendecas)
67+
* [[`7f56a78ff7`](https://github.com/nodejs/node-addon-api/commit/7f56a78ff7)] - **objectwrap**: remove wrap only on failure (Gabriel Schulhof)
68+
* [[`4d816183da`](https://github.com/nodejs/node-addon-api/commit/4d816183da)] - **doc**: fix example code (András Timár, Dr) [#657](https://github.com/nodejs/node-addon-api/pull/657)
69+
* [[`7ac6e21801`](https://github.com/nodejs/node-addon-api/commit/7ac6e21801)] - **gyp**: fix gypfile name in index.js (Anna Henningsen) [#658](https://github.com/nodejs/node-addon-api/pull/658)
70+
* [[`46484202ca`](https://github.com/nodejs/node-addon-api/commit/46484202ca)] - **test**: user data in function property descriptor (Kevin Eady) [#652](https://github.com/nodejs/node-addon-api/pull/652)
71+
* [[`0f8d730483`](https://github.com/nodejs/node-addon-api/commit/0f8d730483)] - **doc**: fix syntax error in example (András Timár, Dr) [#650](https://github.com/nodejs/node-addon-api/pull/650)
72+
* [[`4e885069f1`](https://github.com/nodejs/node-addon-api/commit/4e885069f1)] - **src**: call `napi\_remove\_wrap()` in `ObjectWrap` dtor (Anna Henningsen) [#475](https://github.com/nodejs/node-addon-api/pull/475)
73+
* [[`2fde5c3ca3`](https://github.com/nodejs/node-addon-api/commit/2fde5c3ca3)] - **test**: update BigInt test for recent change in core (Michael Dawson) [#649](https://github.com/nodejs/node-addon-api/pull/649)
74+
* [[`e8935bd8d9`](https://github.com/nodejs/node-addon-api/commit/e8935bd8d9)] - **test**: add test for own properties on ObjectWrap (Guenter Sandner) [#645](https://github.com/nodejs/node-addon-api/pull/645)
75+
* [[`23ff7f0b24`](https://github.com/nodejs/node-addon-api/commit/23ff7f0b24)] - **src**: make OnWorkComplete and OnExecute override-able (legendecas) [#589](https://github.com/nodejs/node-addon-api/pull/589)
76+
* [[`86384f94d3`](https://github.com/nodejs/node-addon-api/commit/86384f94d3)] - **objectwrap**: gracefully handle constructor exceptions (Gabriel Schulhof)
77+
* [[`9af69da01f`](https://github.com/nodejs/node-addon-api/commit/9af69da01f)] - remove N-API implementation, v6.x and v8.x support (Gabriel Schulhof) [#643](https://github.com/nodejs/node-addon-api/pull/643)
78+
* [[`920d544779`](https://github.com/nodejs/node-addon-api/commit/920d544779)] - **benchmark**: add templated version of Function (Gabriel Schulhof) [#637](https://github.com/nodejs/node-addon-api/pull/637)
79+
* [[`03759f7759`](https://github.com/nodejs/node-addon-api/commit/03759f7759)] - ignore benchmark built archives (legendecas) [#631](https://github.com/nodejs/node-addon-api/pull/631)
80+
* [[`5eeabb0214`](https://github.com/nodejs/node-addon-api/commit/5eeabb0214)] - **tsfn**: Remove erroneous finalizer cleanup (Kevin Eady) [#636](https://github.com/nodejs/node-addon-api/pull/636)
81+
* [[`9e0e0f31e4`](https://github.com/nodejs/node-addon-api/commit/9e0e0f31e4)] - **src**: remove unnecessary forward declarations (Gabriel Schulhof) [#633](https://github.com/nodejs/node-addon-api/pull/633)
82+
* [[`79deefb6f3`](https://github.com/nodejs/node-addon-api/commit/79deefb6f3)] - **src**: explicitly disallow assign and copy (legendecas) [#590](https://github.com/nodejs/node-addon-api/pull/590)
83+
* [[`af50ac281b`](https://github.com/nodejs/node-addon-api/commit/af50ac281b)] - **error**: do not replace pending exception (Gabriel Schulhof) [#629](https://github.com/nodejs/node-addon-api/pull/629)
84+
* [[`b72f1d6978`](https://github.com/nodejs/node-addon-api/commit/b72f1d6978)] - Disable caching in ArrayBuffer (Tobias Nießen) [#611](https://github.com/nodejs/node-addon-api/pull/611)
85+
* [[`0e7483eb7b`](https://github.com/nodejs/node-addon-api/commit/0e7483eb7b)] - Fix code format in tests (Tobias Nießen) [#617](https://github.com/nodejs/node-addon-api/pull/617)
86+
* [[`6a0646356d`](https://github.com/nodejs/node-addon-api/commit/6a0646356d)] - add benchmarking framework (Gabriel Schulhof) [#623](https://github.com/nodejs/node-addon-api/pull/623)
87+
* [[`ffc71edd54`](https://github.com/nodejs/node-addon-api/commit/ffc71edd54)] - Add Env::RunScript (Tobias Nießen) [#616](https://github.com/nodejs/node-addon-api/pull/616)
88+
* [[`a1b106066e`](https://github.com/nodejs/node-addon-api/commit/a1b106066e)] - **src**: add templated function factories (Gabriel Schulhof) [#608](https://github.com/nodejs/node-addon-api/pull/608)
89+
* [[`c584343217`](https://github.com/nodejs/node-addon-api/commit/c584343217)] - Add GetPropertyNames, HasOwnProperty, Delete (#615) (Tobias Nießen) [#615](https://github.com/nodejs/node-addon-api/pull/615)
90+
* [[`3acc4b32f5`](https://github.com/nodejs/node-addon-api/commit/3acc4b32f5)] - Fix std::string encoding (#619) (Tobias Nießen) [#619](https://github.com/nodejs/node-addon-api/pull/619)
91+
* [[`e71d0eadcc`](https://github.com/nodejs/node-addon-api/commit/e71d0eadcc)] - \[doc\] Fixed links to array documentation (#613) (Nicola Del Gobbo)
92+
* [[`3dfb1f0591`](https://github.com/nodejs/node-addon-api/commit/3dfb1f0591)] - Change "WG" to "team" (Tobias Nießen)
93+
* [[`ce91e14860`](https://github.com/nodejs/node-addon-api/commit/ce91e14860)] - **objectwrap**: add template methods (Dmitry Ashkadov) [#604](https://github.com/nodejs/node-addon-api/pull/604)
94+
* [[`cfa71b60f7`](https://github.com/nodejs/node-addon-api/commit/cfa71b60f7)] - **object**: add templated property descriptors (Gabriel Schulhof) [#610](https://github.com/nodejs/node-addon-api/pull/610)
95+
* [[`734725e971`](https://github.com/nodejs/node-addon-api/commit/734725e971)] - Correctly define copy assignment operators. (Rolf Timmermans)
96+
397
## 2019-11-21 Version 2.0.0, @NickNaso
498

599
### Notable changes:
@@ -30,7 +124,7 @@
30124
- Added test cases for `Napi::Date` api.
31125
- Added test cases for new features added to `Napi::ThreadSafeFunction`.
32126

33-
### Commmits
127+
### Commits
34128

35129
* [[`c881168d49`](https://github.com/nodejs/node-addon-api/commit/c881168d49)] - **tsfn**: add error checking on GetContext (#583) (Kevin Eady) [#583](https://github.com/nodejs/node-addon-api/pull/583)
36130
* [[`24d75dd82f`](https://github.com/nodejs/node-addon-api/commit/24d75dd82f)] - Merge pull request #588 from NickNaso/add-asyncprogress-worker-readme (Nicola Del Gobbo)
@@ -71,7 +165,7 @@
71165

72166
- Fixed compilation problems that happen on Node.js with N-API version less than 4.
73167

74-
### Commmits
168+
### Commits
75169

76170
* [[`c20bcbd069`](https://github.com/nodejs/node-addon-api/commit/c20bcbd069)] - Merge pull request #518 from NickNaso/master (Nicola Del Gobbo)
77171
* [[`6720d57253`](https://github.com/nodejs/node-addon-api/commit/6720d57253)] - Create the native threadsafe\_function for test only for N-API greater than 3. (NickNaso)
@@ -99,7 +193,7 @@
99193
- Added test case for bool operator.
100194
- Fixed test case for `Napi::ObjectWrap`.
101195

102-
### Commmits
196+
### Commits
103197

104198
* [[`717c9ab163`](https://github.com/nodejs/node-addon-api/commit/717c9ab163)] - **AsyncWorker**: add GetResult() method (Kevin Eady) [#512](https://github.com/nodejs/node-addon-api/pull/512)
105199
* [[`d9d991bbc9`](https://github.com/nodejs/node-addon-api/commit/d9d991bbc9)] - **doc**: add ThreadSafeFunction to main README (#513) (Kevin Eady) [#513](https://github.com/nodejs/node-addon-api/pull/513)
@@ -136,7 +230,7 @@
136230

137231
- Some minor corrections all over the documentation.
138232

139-
### Commmits
233+
### Commits
140234

141235
* [[`83b41c2fe4`](https://github.com/nodejs/node-addon-api/commit/83b41c2fe4)] - Document adding -fvisibility=hidden flag for macOS users (Nicola Del Gobbo) [#460](https://github.com/nodejs/node-addon-api/pull/460)
142236
* [[`1ed7ad8769`](https://github.com/nodejs/node-addon-api/commit/1ed7ad8769)] - **doc**: correct return type of Int32Value to int32\_t (Bill Gallafent) [#459](https://github.com/nodejs/node-addon-api/pull/459)
@@ -185,7 +279,7 @@
185279
- Removed unused member on `Napi::CallbackScope`.
186280
- Enabled `Napi::CallbackScope` only with N-API v3.
187281

188-
### Commmits
282+
### Commits
189283

190284
* [[`e7cd292a74`](https://github.com/nodejs/node-addon-api/commit/e7cd292a74)] - **src**: remove unused CallbackScope member (Gabriel Schulhof) [#391](https://github.com/nodejs/node-addon-api/pull/391)
191285
* [[`d47399fe25`](https://github.com/nodejs/node-addon-api/commit/d47399fe25)] - **src**: guard CallbackScope with N-API v3 (Michael Dawson) [#395](https://github.com/nodejs/node-addon-api/pull/395)
@@ -210,7 +304,7 @@ associated with a callback in place when making certain N-API calls
210304
- Added tests for `Napi::Array` class.
211305
- Added tests for `Napi::ArrayBuffer` class.
212306

213-
### Commmits
307+
### Commits
214308

215309
* [[`8ce605c657`](https://github.com/nodejs/node-addon-api/commit/8ce605c657)] - **build**: avoid using package-lock.json (Jaeseok Yoon) [#359](https://github.com/nodejs/node-addon-api/pull/359)
216310
* [[`fa3a6150b3`](https://github.com/nodejs/node-addon-api/commit/fa3a6150b3)] - **src**: use MakeCallback() -\> Call() in AsyncWorker (Jinho Bang) [#361](https://github.com/nodejs/node-addon-api/pull/361)

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ It is important to remember that *other* Node.js interfaces such as
2121
`libuv` (included in a project via `#include <uv.h>`) are not ABI-stable across
2222
Node.js major versions. Thus, an addon must use N-API and/or `node-addon-api`
2323
exclusively and build against a version of Node.js that includes an
24-
implementation of N-API (meaning a version of Node.js newer than 6.14.2) in
24+
implementation of N-API (meaning an active LTS version of Node.js) in
2525
order to benefit from ABI stability across Node.js major versions. Node.js
2626
provides an [ABI stability guide][] containing a detailed explanation of ABI
2727
stability in general, and the N-API ABI stability guarantee in particular.
@@ -47,14 +47,21 @@ to ideas specified in the **ECMA262 Language Specification**.
4747
- **[Contributors](#contributors)**
4848
- **[License](#license)**
4949

50-
## **Current version: 2.0.0**
50+
## **Current version: 3.0.0**
5151

5252
(See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)
5353

5454
[![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/)
5555

5656
<a name="setup"></a>
5757

58+
node-addon-api is based on [N-API](https://nodejs.org/api/n-api.html) and supports using different N-API versions.
59+
This allows addons built with it to run with Node.js versions which support the targeted N-API version.
60+
**However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that
61+
every year there will be a new major which drops support for the Node.js LTS version which has gone out of service.
62+
63+
The oldest Node.js version supported by the current version of node-addon-api is Node.js 10.x.
64+
5865
## Setup
5966
- [Installation and usage](doc/setup.md)
6067
- [node-gyp](doc/node-gyp.md)
@@ -108,7 +115,7 @@ The following is the documentation for node-addon-api.
108115
- [Async Operations](doc/async_operations.md)
109116
- [AsyncWorker](doc/async_worker.md)
110117
- [AsyncContext](doc/async_context.md)
111-
- [AsyncProgressWorker](doc/async_progress_worker.md)
118+
- [AsyncWorker Variants](doc/async_worker_variants.md)
112119
- [Thread-safe Functions](doc/threadsafe_function.md)
113120
- [Promises](doc/promises.md)
114121
- [Version management](doc/version_management.md)

common.gypi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
'variables': {
33
'NAPI_VERSION%': "<!(node -p \"process.versions.napi\")",
4-
'NODE_MAJOR_VERSION%': "<!(node -p \"process.versions.node.match(/\\d+/)[0]\")",
54
'disable_deprecated': "<!(node -p \"process.env['npm_config_disable_deprecated']\")"
65
},
76
'conditions': [
@@ -16,7 +15,6 @@
1615
}
1716
}]
1817
],
19-
'defines': ['NODE_MAJOR_VERSION=<@(NODE_MAJOR_VERSION)'],
2018
'include_dirs': ["<!@(node -p \"require('../').include\")"],
2119
'cflags': [ '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wunused-parameter' ],
2220
'cflags_cc': [ '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wunused-parameter' ]

doc/creating_a_release.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tools:
1313

1414
* [Changelog maker](https://www.npmjs.com/package/changelog-maker)
1515

16-
If not please follow the instruction reported in the tool's documentation to
16+
If not please follow the instruction reported in the tool's documentation to
1717
install it.
1818

1919
## Publish new release
@@ -27,13 +27,13 @@ new release. Give people some time to comment or suggest PRs that should land fi
2727

2828
* Update the version in **package.json** appropriately.
2929

30-
* Update the [README.md](https://github.com/nodejs/node-addon-api/blob/master/README.md)
30+
* Update the [README.md](https://github.com/nodejs/node-addon-api/blob/master/README.md)
3131
to show the new version as the latest.
3232

3333
* Generate the changelog for the new version using **changelog maker** tool. From
3434
the route folder of the repo launch the following command:
3535

36-
```bash
36+
```bash
3737
> changelog-maker
3838
```
3939
* Use the output generated by **changelog maker** to pdate the [CHANGELOG.md](https://github.com/nodejs/node-addon-api/blob/master/CHANGELOG.md)
@@ -43,8 +43,8 @@ following the style used in publishing the previous release.
4343

4444
* Validate all tests pass by running npm test on master.
4545

46-
* Use **[CI](https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api/)**
47-
to validate tests pass for latest 11, 10, 8, 6 releases (note there are still some issues on SmartOS and
46+
* Use **[CI](https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api-new/)**
47+
to validate tests pass (note there are still some issues on SmartOS and
4848
Windows in the testing).
4949

5050
* Do a clean checkout of node-addon-api.

0 commit comments

Comments
 (0)