Skip to content

Commit c835161

Browse files
committed
2023-01-03, 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 68cca1e commit c835161

16 files changed

+511
-41
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ release.
3333
</tr>
3434
<tr>
3535
<td valign="top">
36-
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.12.1">18.12.1</a></b><br/>
36+
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.13.0">18.13.0</a></b><br/>
37+
<a href="doc/changelogs/CHANGELOG_V18.md#18.12.1">18.12.1</a><br/>
3738
<a href="doc/changelogs/CHANGELOG_V18.md#18.12.0">18.12.0</a><br/>
3839
<a href="doc/changelogs/CHANGELOG_V18.md#18.11.0">18.11.0</a><br/>
3940
<a href="doc/changelogs/CHANGELOG_V18.md#18.10.0">18.10.0</a><br/>

doc/api/async_context.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ added:
123123
- v13.10.0
124124
- v12.17.0
125125
changes:
126-
- version: REPLACEME
126+
- version: v18.13.0
127127
pr-url: https://github.com/nodejs/node/pull/45386
128128
description: Add option onPropagate.
129129
-->

doc/api/buffer.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5025,7 +5025,7 @@ See [`Buffer.from(string[, encoding])`][`Buffer.from(string)`].
50255025
## Class: `File`
50265026

50275027
<!-- YAML
5028-
added: REPLACEME
5028+
added: v18.13.0
50295029
-->
50305030

50315031
> Stability: 1 - Experimental
@@ -5037,7 +5037,7 @@ A [`File`][] provides information about files.
50375037
### `new buffer.File(sources, fileName[, options])`
50385038

50395039
<!-- YAML
5040-
added: REPLACEME
5040+
added: v18.13.0
50415041
-->
50425042

50435043
* `sources` {string\[]|ArrayBuffer\[]|TypedArray\[]|DataView\[]|Blob\[]|File\[]}
@@ -5055,7 +5055,7 @@ added: REPLACEME
50555055
### `file.name`
50565056

50575057
<!-- YAML
5058-
added: REPLACEME
5058+
added: v18.13.0
50595059
-->
50605060

50615061
* Type: {string}
@@ -5065,7 +5065,7 @@ The name of the `File`.
50655065
### `file.lastModified`
50665066

50675067
<!-- YAML
5068-
added: REPLACEME
5068+
added: v18.13.0
50695069
-->
50705070

50715071
* Type: {number}

doc/api/cli.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Use this flag to disable top-level await in REPL.
418418
### `--experimental-shadow-realm`
419419

420420
<!-- YAML
421-
added: REPLACEME
421+
added: v18.13.0
422422
-->
423423

424424
Use this flag to enable [ShadowRealm][] support.
@@ -1199,7 +1199,7 @@ status code 1.
11991199
<!-- YAML
12001200
added: v18.1.0
12011201
changes:
1202-
- version: REPLACEME
1202+
- version: v18.13.0
12031203
pr-url: https://github.com/nodejs/node/pull/45214
12041204
description: Test runner now supports running in watch mode.
12051205
-->
@@ -1567,7 +1567,7 @@ amount of CPUs, but it may diverge in environments such as VMs or containers.
15671567
<!-- YAML
15681568
added: v18.11.0
15691569
changes:
1570-
- version: REPLACEME
1570+
- version: v18.13.0
15711571
pr-url: https://github.com/nodejs/node/pull/45214
15721572
description: Test runner now supports running in watch mode.
15731573
-->

doc/api/deprecations.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,7 @@ future release.
22882288

22892289
<!-- YAML
22902290
changes:
2291-
- version: REPLACEME
2291+
- version: v18.13.0
22922292
pr-url: https://github.com/nodejs/node/pull/44919
22932293
description: \`url.parse()` is deprecated again in DEP0169.
22942294
- version:
@@ -3272,7 +3272,7 @@ Node-API callbacks.
32723272
<!-- YAML
32733273
changes:
32743274
- version:
3275-
- REPLACEME
3275+
- v18.13.0
32763276
pr-url: https://github.com/nodejs/node/pull/44919
32773277
description: Documentation-only deprecation.
32783278
-->
@@ -3288,7 +3288,7 @@ issued for `url.parse()` vulnerabilities.
32883288
<!-- YAML
32893289
changes:
32903290
- version:
3291-
- REPLACEME
3291+
- v18.13.0
32923292
pr-url: https://github.com/nodejs/node/pull/45576
32933293
description: Documentation-only deprecation.
32943294
-->
@@ -3304,7 +3304,7 @@ an error in future versions of Node.js, as the [WHATWG URL API][] does already.
33043304
<!-- YAML
33053305
changes:
33063306
- version:
3307-
- REPLACEME
3307+
- v18.13.0
33083308
pr-url: https://github.com/nodejs/node/pull/45697
33093309
description: Documentation-only deprecation.
33103310
-->

doc/api/diagnostics_channel.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- YAML
44
added: v15.1.0
55
changes:
6-
- version: REPLACEME
6+
- version: v18.13.0
77
pr-url: https://github.com/nodejs/node/pull/45290
88
description: diagnostics_channel is now Stable.
99
-->

doc/api/n-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ handle and/or callback scope inside the function body is not necessary.
901901
#### `napi_cleanup_hook`
902902

903903
<!-- YAML
904-
added: REPLACEME
904+
added: v18.13.0
905905
napiVersion: 3
906906
-->
907907

doc/api/net.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ behavior.
854854
<!-- YAML
855855
added: v0.1.90
856856
changes:
857-
- version: REPLACEME
857+
- version: v18.13.0
858858
pr-url: https://github.com/nodejs/node/pull/44731
859859
description: Added the `autoSelectFamily` option.
860860
- version: v17.7.0

doc/api/stream.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ has less then 64 KiB of data because no `highWaterMark` option is provided to
16841684
##### `readable.compose(stream[, options])`
16851685

16861686
<!-- YAML
1687-
added: REPLACEME
1687+
added: v18.13.0
16881688
-->
16891689

16901690
> Stability: 1 - Experimental

doc/api/test.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ test('a test that creates asynchronous activity', (t) => {
294294
## Watch mode
295295

296296
<!-- YAML
297-
added: REPLACEME
297+
added: v18.13.0
298298
-->
299299

300300
> Stability: 1 - Experimental
@@ -735,7 +735,7 @@ describe('tests', async () => {
735735
## Class: `MockFunctionContext`
736736

737737
<!-- YAML
738-
added: REPLACEME
738+
added: v18.13.0
739739
-->
740740

741741
The `MockFunctionContext` class is used to inspect or manipulate the behavior of
@@ -744,7 +744,7 @@ mocks created via the [`MockTracker`][] APIs.
744744
### `ctx.calls`
745745

746746
<!-- YAML
747-
added: REPLACEME
747+
added: v18.13.0
748748
-->
749749

750750
* {Array}
@@ -766,7 +766,7 @@ mock. Each entry in the array is an object with the following properties.
766766
### `ctx.callCount()`
767767

768768
<!-- YAML
769-
added: REPLACEME
769+
added: v18.13.0
770770
-->
771771

772772
* Returns: {integer} The number of times that this mock has been invoked.
@@ -778,7 +778,7 @@ is a getter that creates a copy of the internal call tracking array.
778778
### `ctx.mockImplementation(implementation)`
779779

780780
<!-- YAML
781-
added: REPLACEME
781+
added: v18.13.0
782782
-->
783783

784784
* `implementation` {Function|AsyncFunction} The function to be used as the
@@ -815,7 +815,7 @@ test('changes a mock behavior', (t) => {
815815
### `ctx.mockImplementationOnce(implementation[, onCall])`
816816

817817
<!-- YAML
818-
added: REPLACEME
818+
added: v18.13.0
819819
-->
820820

821821
* `implementation` {Function|AsyncFunction} The function to be used as the
@@ -859,15 +859,15 @@ test('changes a mock behavior once', (t) => {
859859
### `ctx.resetCalls()`
860860

861861
<!-- YAML
862-
added: REPLACEME
862+
added: v18.13.0
863863
-->
864864

865865
Resets the call history of the mock function.
866866

867867
### `ctx.restore()`
868868

869869
<!-- YAML
870-
added: REPLACEME
870+
added: v18.13.0
871871
-->
872872

873873
Resets the implementation of the mock function to its original behavior. The
@@ -876,7 +876,7 @@ mock can still be used after calling this function.
876876
## Class: `MockTracker`
877877

878878
<!-- YAML
879-
added: REPLACEME
879+
added: v18.13.0
880880
-->
881881

882882
The `MockTracker` class is used to manage mocking functionality. The test runner
@@ -887,7 +887,7 @@ Each test also provides its own `MockTracker` instance via the test context's
887887
### `mock.fn([original[, implementation]][, options])`
888888

889889
<!-- YAML
890-
added: REPLACEME
890+
added: v18.13.0
891891
-->
892892

893893
* `original` {Function|AsyncFunction} An optional function to create a mock on.
@@ -938,7 +938,7 @@ test('mocks a counting function', (t) => {
938938
### `mock.getter(object, methodName[, implementation][, options])`
939939

940940
<!-- YAML
941-
added: REPLACEME
941+
added: v18.13.0
942942
-->
943943

944944
This function is syntax sugar for [`MockTracker.method`][] with `options.getter`
@@ -947,7 +947,7 @@ set to `true`.
947947
### `mock.method(object, methodName[, implementation][, options])`
948948

949949
<!-- YAML
950-
added: REPLACEME
950+
added: v18.13.0
951951
-->
952952

953953
* `object` {Object} The object whose method is being mocked.
@@ -1001,7 +1001,7 @@ test('spies on an object method', (t) => {
10011001
### `mock.reset()`
10021002

10031003
<!-- YAML
1004-
added: REPLACEME
1004+
added: v18.13.0
10051005
-->
10061006

10071007
This function restores the default behavior of all mocks that were previously
@@ -1017,7 +1017,7 @@ function manually is recommended.
10171017
### `mock.restoreAll()`
10181018

10191019
<!-- YAML
1020-
added: REPLACEME
1020+
added: v18.13.0
10211021
-->
10221022

10231023
This function restores the default behavior of all mocks that were previously
@@ -1027,7 +1027,7 @@ not disassociate the mocks from the `MockTracker` instance.
10271027
### `mock.setter(object, methodName[, implementation][, options])`
10281028

10291029
<!-- YAML
1030-
added: REPLACEME
1030+
added: v18.13.0
10311031
-->
10321032

10331033
This function is syntax sugar for [`MockTracker.method`][] with `options.setter`
@@ -1118,7 +1118,7 @@ test('top level test', async (t) => {
11181118
### `context.after([fn][, options])`
11191119

11201120
<!-- YAML
1121-
added: REPLACEME
1121+
added: v18.13.0
11221122
-->
11231123

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

doc/api/tls.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ certificate.
11731173

11741174
<!-- YAML
11751175
changes:
1176-
- version: REPLACEME
1176+
- version: v18.13.0
11771177
pr-url: https://github.com/nodejs/node/pull/44935
11781178
description: Add "ca" property.
11791179
- version:

doc/api/url.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ The formatting process operates as follows:
15211521
<!-- YAML
15221522
added: v0.1.25
15231523
changes:
1524-
- version: REPLACEME
1524+
- version: v18.13.0
15251525
pr-url: https://github.com/nodejs/node/pull/44919
15261526
description: Documentation-only deprecation.
15271527
- version:

doc/api/util.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ equality.
10231023
## Class: `util.MIMEType`
10241024

10251025
<!-- YAML
1026-
added: REPLACEME
1026+
added: v18.13.0
10271027
-->
10281028

10291029
> Stability: 1 - Experimental
@@ -1222,7 +1222,7 @@ console.log(JSON.stringify(myMIMES));
12221222
### Class: `util.MIMEParams`
12231223

12241224
<!-- YAML
1225-
added: REPLACEME
1225+
added: v18.13.0
12261226
-->
12271227

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

doc/api/vm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ console.log(globalVar);
347347
### `script.sourceMapURL`
348348

349349
<!-- YAML
350-
added: REPLACEME
350+
added: v18.13.0
351351
-->
352352

353353
* {string|undefined}

0 commit comments

Comments
 (0)