Skip to content

Commit 0593b69

Browse files
committed
2023-01-05, Version 18.13.0 'Hydrogen' (LTS)
Notable changes: Add support for externally shared js builtins: By default Node.js is built so that all dependencies are bundled into the Node.js binary itself. Some Node.js distributions prefer to manage dependencies externally. There are existing build options that allow dependencies with native code to be externalized. This commit adds additional options so that dependencies with JavaScript code (including WASM) can also be externalized. This addition does not affect binaries shipped by the Node.js project but will allow other distributions to externalize additional dependencies when needed. Contributed by Michael Dawson in #44376 Introduce `File`: The File class is part of the [FileAPI](https://w3c.github.io/FileAPI/). It can be used anywhere a Blob can, for example in `URL.createObjectURL` and `FormData`. It contains two properties that Blobs do not have: `lastModified`, the last time the file was modified in ms, and `name`, the name of the file. Contributed by Khafra in #45139 Support function mocking on Node.js test runner: The `node:test` module supports mocking during testing via a top-level `mock` object. ```js test('spies on an object method', (t) => { const number = { value: 5, add(a) { return this.value + a; }, }; t.mock.method(number, 'add'); assert.strictEqual(number.add(3), 8); assert.strictEqual(number.add.mock.calls.length, 1); }); ``` Contributed by Colin Ihrig in #45326 Other notable changes: build: * disable v8 snapshot compression by default (Joyee Cheung) #45716 crypto: * update root certificates (Luigi Pinca) #45490 deps: * update ICU to 72.1 (Michaël Zasso) #45068 doc: * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697 * add Rafael to the tsc (Michael Dawson) #45691 * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576 * add lukekarrys to collaborators (Luke Karrys) #45180 * add anonrig to collaborators (Yagiz Nizipli) #45002 * deprecate url.parse() (Rich Trott) #44919 lib: * drop fetch experimental warning (Matteo Collina) #45287 net: * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731 * src: * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639 * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869 test_runner: * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792 * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792 tls: * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935 * remove trustcor root ca certificates (Ben Noordhuis) #45776 tools: * update certdata.txt (Luigi Pinca) #45490 util: * add fast path for utf8 encoding (Yagiz Nizipli) #45412 * improve textdecoder decode performance (Yagiz Nizipli) #45294 * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128 PR-URL: #46025
1 parent cd4f4b4 commit 0593b69

File tree

15 files changed

+576
-36
lines changed

15 files changed

+576
-36
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ release.
4242
<a href="doc/changelogs/CHANGELOG_V19.md#19.0.0">19.0.0</a><br/>
4343
</td>
4444
<td valign="top">
45-
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.12.1">18.12.1</a></b><br/>
45+
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.13.0">18.13.0</a></b><br/>
46+
<a href="doc/changelogs/CHANGELOG_V18.md#18.12.1">18.12.1</a><br/>
4647
<a href="doc/changelogs/CHANGELOG_V18.md#18.12.0">18.12.0</a><br/>
4748
<a href="doc/changelogs/CHANGELOG_V18.md#18.11.0">18.11.0</a><br/>
4849
<a href="doc/changelogs/CHANGELOG_V18.md#18.10.0">18.10.0</a><br/>

doc/api/async_context.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ added:
123123
- v13.10.0
124124
- v12.17.0
125125
changes:
126-
- version: v19.2.0
126+
- version:
127+
- v19.2.0
128+
- v18.13.0
127129
pr-url: https://github.com/nodejs/node/pull/45386
128130
description: Add option onPropagate.
129131
-->

doc/api/buffer.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5029,7 +5029,9 @@ See [`Buffer.from(string[, encoding])`][`Buffer.from(string)`].
50295029
## Class: `File`
50305030

50315031
<!-- YAML
5032-
added: v19.2.0
5032+
added:
5033+
- v19.2.0
5034+
- v18.13.0
50335035
-->
50345036

50355037
> Stability: 1 - Experimental
@@ -5041,7 +5043,9 @@ A [`File`][] provides information about files.
50415043
### `new buffer.File(sources, fileName[, options])`
50425044

50435045
<!-- YAML
5044-
added: v19.2.0
5046+
added:
5047+
- v19.2.0
5048+
- v18.13.0
50455049
-->
50465050

50475051
* `sources` {string\[]|ArrayBuffer\[]|TypedArray\[]|DataView\[]|Blob\[]|File\[]}
@@ -5059,7 +5063,9 @@ added: v19.2.0
50595063
### `file.name`
50605064

50615065
<!-- YAML
5062-
added: v19.2.0
5066+
added:
5067+
- v19.2.0
5068+
- v18.13.0
50635069
-->
50645070

50655071
* Type: {string}
@@ -5069,7 +5075,9 @@ The name of the `File`.
50695075
### `file.lastModified`
50705076

50715077
<!-- YAML
5072-
added: v19.2.0
5078+
added:
5079+
- v19.2.0
5080+
- v18.13.0
50735081
-->
50745082

50755083
* Type: {number}

doc/api/cli.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ Use this flag to disable top-level await in REPL.
429429
### `--experimental-shadow-realm`
430430

431431
<!-- YAML
432-
added: v19.0.0
432+
added:
433+
- v19.0.0
434+
- v18.13.0
433435
-->
434436

435437
Use this flag to enable [ShadowRealm][] support.
@@ -1219,7 +1221,9 @@ added:
12191221
- v18.1.0
12201222
- v16.17.0
12211223
changes:
1222-
- version: v19.2.0
1224+
- version:
1225+
- v19.2.0
1226+
- v18.13.0
12231227
pr-url: https://github.com/nodejs/node/pull/45214
12241228
description: Test runner now supports running in watch mode.
12251229
-->
@@ -1611,7 +1615,9 @@ added:
16111615
- v18.11.0
16121616
- v16.19.0
16131617
changes:
1614-
- version: v19.2.0
1618+
- version:
1619+
- v19.2.0
1620+
- v18.13.0
16151621
pr-url: https://github.com/nodejs/node/pull/45214
16161622
description: Test runner now supports running in watch mode.
16171623
-->

doc/api/deprecations.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,9 @@ future release.
22882288

22892289
<!-- YAML
22902290
changes:
2291-
- version: v19.0.0
2291+
- version:
2292+
- v19.0.0
2293+
- v18.13.0
22922294
pr-url: https://github.com/nodejs/node/pull/44919
22932295
description: \`url.parse()` is deprecated again in DEP0169.
22942296
- version:
@@ -3288,6 +3290,7 @@ Node-API callbacks.
32883290
changes:
32893291
- version:
32903292
- v19.0.0
3293+
- v18.13.0
32913294
pr-url: https://github.com/nodejs/node/pull/44919
32923295
description: Documentation-only deprecation.
32933296
-->
@@ -3307,7 +3310,8 @@ changes:
33073310
pr-url: https://github.com/nodejs/node/pull/45526
33083311
description: Runtime deprecation.
33093312
- version:
3310-
- v19.2.0
3313+
- v19.2.0
3314+
- v18.13.0
33113315
pr-url: https://github.com/nodejs/node/pull/45576
33123316
description: Documentation-only deprecation.
33133317
-->
@@ -3324,6 +3328,7 @@ an error in future versions of Node.js, as the [WHATWG URL API][] does already.
33243328
changes:
33253329
- version:
33263330
- v19.3.0
3331+
- v18.13.0
33273332
pr-url: https://github.com/nodejs/node/pull/45697
33283333
description: Documentation-only deprecation.
33293334
-->

doc/api/diagnostics_channel.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<!-- YAML
44
added: v15.1.0
55
changes:
6-
- version: v19.2.0
6+
- version:
7+
- v19.2.0
8+
- v18.13.0
79
pr-url: https://github.com/nodejs/node/pull/45290
810
description: diagnostics_channel is now Stable.
911
-->

doc/api/n-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,9 @@ handle and/or callback scope inside the function body is not necessary.
901901
#### `napi_cleanup_hook`
902902

903903
<!-- YAML
904-
added: v19.2.0
904+
added:
905+
- v19.2.0
906+
- v18.13.0
905907
napiVersion: 3
906908
-->
907909

doc/api/net.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,9 @@ changes:
875875
description: The default value for autoSelectFamily option can be changed
876876
at runtime using `setDefaultAutoSelectFamily` or via the
877877
command line option `--enable-network-family-autoselection`.
878-
- version: v19.3.0
878+
- version:
879+
- v19.3.0
880+
- v18.13.0
879881
pr-url: https://github.com/nodejs/node/pull/44731
880882
description: Added the `autoSelectFamily` option.
881883
- version:

doc/api/stream.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,9 @@ has less then 64 KiB of data because no `highWaterMark` option is provided to
19071907
##### `readable.compose(stream[, options])`
19081908

19091909
<!-- YAML
1910-
added: v19.1.0
1910+
added:
1911+
- v19.1.0
1912+
- v18.13.0
19111913
-->
19121914

19131915
> Stability: 1 - Experimental

doc/api/test.md

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ test('a test that creates asynchronous activity', (t) => {
291291
## Watch mode
292292

293293
<!-- YAML
294-
added: v19.2.0
294+
added:
295+
- v19.2.0
296+
- v18.13.0
295297
-->
296298

297299
> Stability: 1 - Experimental
@@ -907,7 +909,9 @@ describe('tests', async () => {
907909
## Class: `MockFunctionContext`
908910

909911
<!-- YAML
910-
added: v19.1.0
912+
added:
913+
- v19.1.0
914+
- v18.13.0
911915
-->
912916

913917
The `MockFunctionContext` class is used to inspect or manipulate the behavior of
@@ -916,7 +920,9 @@ mocks created via the [`MockTracker`][] APIs.
916920
### `ctx.calls`
917921

918922
<!-- YAML
919-
added: v19.1.0
923+
added:
924+
- v19.1.0
925+
- v18.13.0
920926
-->
921927

922928
* {Array}
@@ -938,7 +944,9 @@ mock. Each entry in the array is an object with the following properties.
938944
### `ctx.callCount()`
939945

940946
<!-- YAML
941-
added: v19.1.0
947+
added:
948+
- v19.1.0
949+
- v18.13.0
942950
-->
943951

944952
* Returns: {integer} The number of times that this mock has been invoked.
@@ -950,7 +958,9 @@ is a getter that creates a copy of the internal call tracking array.
950958
### `ctx.mockImplementation(implementation)`
951959

952960
<!-- YAML
953-
added: v19.1.0
961+
added:
962+
- v19.1.0
963+
- v18.13.0
954964
-->
955965

956966
* `implementation` {Function|AsyncFunction} The function to be used as the
@@ -987,7 +997,9 @@ test('changes a mock behavior', (t) => {
987997
### `ctx.mockImplementationOnce(implementation[, onCall])`
988998

989999
<!-- YAML
990-
added: v19.1.0
1000+
added:
1001+
- v19.1.0
1002+
- v18.13.0
9911003
-->
9921004

9931005
* `implementation` {Function|AsyncFunction} The function to be used as the
@@ -1031,15 +1043,19 @@ test('changes a mock behavior once', (t) => {
10311043
### `ctx.resetCalls()`
10321044

10331045
<!-- YAML
1034-
added: v19.3.0
1046+
added:
1047+
- v19.3.0
1048+
- v18.13.0
10351049
-->
10361050

10371051
Resets the call history of the mock function.
10381052

10391053
### `ctx.restore()`
10401054

10411055
<!-- YAML
1042-
added: v19.1.0
1056+
added:
1057+
- v19.1.0
1058+
- v18.13.0
10431059
-->
10441060

10451061
Resets the implementation of the mock function to its original behavior. The
@@ -1048,7 +1064,9 @@ mock can still be used after calling this function.
10481064
## Class: `MockTracker`
10491065

10501066
<!-- YAML
1051-
added: v19.1.0
1067+
added:
1068+
- v19.1.0
1069+
- v18.13.0
10521070
-->
10531071

10541072
The `MockTracker` class is used to manage mocking functionality. The test runner
@@ -1059,7 +1077,9 @@ Each test also provides its own `MockTracker` instance via the test context's
10591077
### `mock.fn([original[, implementation]][, options])`
10601078

10611079
<!-- YAML
1062-
added: v19.1.0
1080+
added:
1081+
- v19.1.0
1082+
- v18.13.0
10631083
-->
10641084

10651085
* `original` {Function|AsyncFunction} An optional function to create a mock on.
@@ -1110,7 +1130,9 @@ test('mocks a counting function', (t) => {
11101130
### `mock.getter(object, methodName[, implementation][, options])`
11111131

11121132
<!-- YAML
1113-
added: v19.3.0
1133+
added:
1134+
- v19.3.0
1135+
- v18.13.0
11141136
-->
11151137

11161138
This function is syntax sugar for [`MockTracker.method`][] with `options.getter`
@@ -1119,7 +1141,9 @@ set to `true`.
11191141
### `mock.method(object, methodName[, implementation][, options])`
11201142

11211143
<!-- YAML
1122-
added: v19.1.0
1144+
added:
1145+
- v19.1.0
1146+
- v18.13.0
11231147
-->
11241148

11251149
* `object` {Object} The object whose method is being mocked.
@@ -1173,7 +1197,9 @@ test('spies on an object method', (t) => {
11731197
### `mock.reset()`
11741198

11751199
<!-- YAML
1176-
added: v19.1.0
1200+
added:
1201+
- v19.1.0
1202+
- v18.13.0
11771203
-->
11781204

11791205
This function restores the default behavior of all mocks that were previously
@@ -1189,7 +1215,9 @@ function manually is recommended.
11891215
### `mock.restoreAll()`
11901216

11911217
<!-- YAML
1192-
added: v19.1.0
1218+
added:
1219+
- v19.1.0
1220+
- v18.13.0
11931221
-->
11941222

11951223
This function restores the default behavior of all mocks that were previously
@@ -1199,7 +1227,9 @@ not disassociate the mocks from the `MockTracker` instance.
11991227
### `mock.setter(object, methodName[, implementation][, options])`
12001228

12011229
<!-- YAML
1202-
added: v19.3.0
1230+
added:
1231+
- v19.3.0
1232+
- v18.13.0
12031233
-->
12041234

12051235
This function is syntax sugar for [`MockTracker.method`][] with `options.setter`
@@ -1329,7 +1359,9 @@ test('top level test', async (t) => {
13291359
### `context.after([fn][, options])`
13301360

13311361
<!-- YAML
1332-
added: v19.3.0
1362+
added:
1363+
- v19.3.0
1364+
- v18.13.0
13331365
-->
13341366

13351367
* `fn` {Function|AsyncFunction} The hook function. The first argument

doc/api/tls.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,9 @@ certificate.
11731173

11741174
<!-- YAML
11751175
changes:
1176-
- version: v19.1.0
1176+
- version:
1177+
- v19.1.0
1178+
- v18.13.0
11771179
pr-url: https://github.com/nodejs/node/pull/44935
11781180
description: Add "ca" property.
11791181
- version:

doc/api/url.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,9 @@ The formatting process operates as follows:
15211521
<!-- YAML
15221522
added: v0.1.25
15231523
changes:
1524-
- version: v19.0.0
1524+
- version:
1525+
- v19.0.0
1526+
- v18.13.0
15251527
pr-url: https://github.com/nodejs/node/pull/44919
15261528
description: Documentation-only deprecation.
15271529
- version:

doc/api/util.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,9 @@ equality.
10271027
## Class: `util.MIMEType`
10281028

10291029
<!-- YAML
1030-
added: v19.1.0
1030+
added:
1031+
- v19.1.0
1032+
- v18.13.0
10311033
-->
10321034

10331035
> Stability: 1 - Experimental
@@ -1226,7 +1228,9 @@ console.log(JSON.stringify(myMIMES));
12261228
### Class: `util.MIMEParams`
12271229

12281230
<!-- YAML
1229-
added: v19.1.0
1231+
added:
1232+
- v19.1.0
1233+
- v18.13.0
12301234
-->
12311235

12321236
The `MIMEParams` API provides read and write access to the parameters of a

0 commit comments

Comments
 (0)