Skip to content

Commit 29cb7d6

Browse files
committed
Merge branch 'main' into fix/watch-options-infinite-loop
2 parents 8ed076a + a57893b commit 29cb7d6

31 files changed

+365
-161
lines changed

.github/workflows/build-tarball.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ on:
1818
- tsconfig.json
1919
- test/internet/**
2020
- tools/actions/**
21-
- tools/bootstrap/**
2221
- tools/dep_updaters/**
2322
- tools/doc/**
2423
- tools/eslint-rules/**
@@ -48,7 +47,6 @@ on:
4847
- tsconfig.json
4948
- test/internet/**
5049
- tools/actions/**
51-
- tools/bootstrap/**
5250
- tools/dep_updaters/**
5351
- tools/doc/**
5452
- tools/eslint-rules/**

.github/workflows/test-macos.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ on:
1818
- tsconfig.json
1919
- test/internet/**
2020
- tools/actions/**
21-
- tools/bootstrap/**
2221
- tools/dep_updaters/**
2322
- tools/doc/**
2423
- tools/eslint-rules/**
@@ -49,7 +48,6 @@ on:
4948
- tsconfig.json
5049
- test/internet/**
5150
- tools/actions/**
52-
- tools/bootstrap/**
5351
- tools/dep_updaters/**
5452
- tools/doc/**
5553
- tools/eslint-rules/**

BUILDING.md

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ file a new issue.
3838
* [Windows Prerequisites](#windows-prerequisites)
3939
* [Option 1: Manual install](#option-1-manual-install)
4040
* [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget)
41-
* [Option 3: Automated install with Boxstarter](#option-3-automated-install-with-boxstarter)
4241
* [Building Node.js](#building-nodejs-2)
4342
* [Using ccache](#using-ccache)
4443
* [Android](#android)
@@ -58,6 +57,7 @@ file a new issue.
5857
* [Windows](#windows-4)
5958
* [Configuring OpenSSL config appname](#configure-openssl-appname)
6059
* [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl)
60+
* [Building Node.js with Temporal support](#building-nodejs-with-temporal-support)
6161
* [Building Node.js with external core modules](#building-nodejs-with-external-core-modules)
6262
* [Unix/macOS](#unixmacos-4)
6363
* [Windows](#windows-5)
@@ -811,39 +811,6 @@ winget configure .\.configurations\configuration.dsc.yaml
811811

812812
To add optional components for MSI or ARM64 builds, refer to [Option 1: Manual install](#option-1-manual-install).
813813

814-
##### Option 3: Automated install with Boxstarter
815-
816-
A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of
817-
Windows systems with all the required prerequisites for Node.js development.
818-
This script will install the following [Chocolatey](https://chocolatey.org/)
819-
packages:
820-
821-
* [Git for Windows](https://chocolatey.org/packages/git) with the `git` and
822-
Unix tools added to the `PATH`
823-
* [Python 3.x](https://chocolatey.org/packages/python)
824-
* [Visual Studio 2022 Build Tools](https://chocolatey.org/packages/visualstudio2022buildtools)
825-
with [Visual C++ workload](https://chocolatey.org/packages/visualstudio2022-workload-vctools)
826-
* [NetWide Assembler](https://chocolatey.org/packages/nasm)
827-
828-
To install Node.js prerequisites using
829-
[Boxstarter WebLauncher](https://boxstarter.org/weblauncher), visit
830-
<https://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter>
831-
with a supported browser.
832-
833-
Alternatively, you can use PowerShell. Run those commands from
834-
an elevated (Administrator) PowerShell terminal:
835-
836-
```powershell
837-
Set-ExecutionPolicy Unrestricted -Force
838-
iex ((New-Object System.Net.WebClient).DownloadString('https://boxstarter.org/bootstrapper.ps1'))
839-
get-boxstarter -Force
840-
Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter -DisableReboots
841-
refreshenv
842-
```
843-
844-
The entire installation using Boxstarter will take up approximately 10 GB of
845-
disk space.
846-
847814
#### Building Node.js
848815

849816
* Remember to first clone the Node.js repository with the Git command
@@ -1061,6 +1028,15 @@ configure option:
10611028
./configure --openssl-conf-name=<some_conf_name>
10621029
```
10631030

1031+
## Building Node.js with FIPS-compliant OpenSSL
1032+
1033+
Node.js supports FIPS when statically or dynamically linked with OpenSSL 3 via
1034+
[OpenSSL's provider model](https://docs.openssl.org/3.0/man7/crypto/#OPENSSL-PROVIDERS).
1035+
It is not necessary to rebuild Node.js to enable support for FIPS.
1036+
1037+
See [FIPS mode](doc/api/crypto.md#fips-mode) for more information on how to
1038+
enable FIPS support in Node.js.
1039+
10641040
## Building Node.js with Temporal support
10651041

10661042
Node.js supports the [Temporal](https://github.com/tc39/proposal-temporal) APIs, when
@@ -1071,15 +1047,6 @@ To build Node.js with Temporal support, a Rust toolchain is required:
10711047
* rustc >= 1.82 (with LLVM >= 19)
10721048
* cargo >= 1.82
10731049

1074-
## Building Node.js with FIPS-compliant OpenSSL
1075-
1076-
Node.js supports FIPS when statically or dynamically linked with OpenSSL 3 via
1077-
[OpenSSL's provider model](https://docs.openssl.org/3.0/man7/crypto/#OPENSSL-PROVIDERS).
1078-
It is not necessary to rebuild Node.js to enable support for FIPS.
1079-
1080-
See [FIPS mode](doc/api/crypto.md#fips-mode) for more information on how to
1081-
enable FIPS support in Node.js.
1082-
10831050
## Building Node.js with external core modules
10841051

10851052
It is possible to specify one or more JavaScript text files to be bundled in

doc/api/buffer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,13 +3534,13 @@ changes:
35343534
calculations with them.
35353535
-->
35363536

3537+
> Stability: 0 - Deprecated: Use [`buf.subarray`][] instead.
3538+
35373539
* `start` {integer} Where the new `Buffer` will start. **Default:** `0`.
35383540
* `end` {integer} Where the new `Buffer` will end (not inclusive).
35393541
**Default:** [`buf.length`][].
35403542
* Returns: {Buffer}
35413543

3542-
> Stability: 0 - Deprecated: Use [`buf.subarray`][] instead.
3543-
35443544
Returns a new `Buffer` that references the same memory as the original, but
35453545
offset and cropped by the `start` and `end` indexes.
35463546

doc/api/deprecations.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4430,6 +4430,42 @@ Passing the `type` option to [`Duplex.toWeb()`][] is deprecated. To specify the
44304430
type of the readable half of the constructed readable-writable pair, use the
44314431
`readableType` option instead.
44324432
4433+
### DEP0202: `Http1IncomingMessage` and `Http1ServerResponse` options of HTTP/2 servers
4434+
4435+
<!-- YAML
4436+
changes:
4437+
- version: REPLACEME
4438+
pr-url: https://github.com/nodejs/node/pull/61713
4439+
description: Documentation-only deprecation.
4440+
-->
4441+
4442+
Type: Documentation-only
4443+
4444+
The `Http1IncomingMessage` and `Http1ServerResponse` options of
4445+
[`http2.createServer()`][] and [`http2.createSecureServer()`][] are
4446+
deprecated. Use `http1Options.IncomingMessage` and
4447+
`http1Options.ServerResponse` instead.
4448+
4449+
```cjs
4450+
// Deprecated
4451+
const server = http2.createSecureServer({
4452+
allowHTTP1: true,
4453+
Http1IncomingMessage: MyIncomingMessage,
4454+
Http1ServerResponse: MyServerResponse,
4455+
});
4456+
```
4457+
4458+
```cjs
4459+
// Use this instead
4460+
const server = http2.createSecureServer({
4461+
allowHTTP1: true,
4462+
http1Options: {
4463+
IncomingMessage: MyIncomingMessage,
4464+
ServerResponse: MyServerResponse,
4465+
},
4466+
});
4467+
```
4468+
44334469
[DEP0142]: #dep0142-repl_builtinlibs
44344470
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
44354471
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4509,6 +4545,8 @@ type of the readable half of the constructed readable-writable pair, use the
45094545
[`http.ServerResponse`]: http.md#class-httpserverresponse
45104546
[`http.get()`]: http.md#httpgetoptions-callback
45114547
[`http.request()`]: http.md#httprequestoptions-callback
4548+
[`http2.createSecureServer()`]: http2.md#http2createsecureserveroptions-onrequesthandler
4549+
[`http2.createServer()`]: http2.md#http2createserveroptions-onrequesthandler
45124550
[`https.get()`]: https.md#httpsgetoptions-callback
45134551
[`https.request()`]: https.md#httpsrequestoptions-callback
45144552
[`message.connection`]: http.md#messageconnection

doc/api/environment_variables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ For more details refer to the [`process.env` documentation][].
1818

1919
## DotEnv
2020

21-
Set of utilities for dealing with additional environment variables defined in `.env` files.
22-
2321
> Stability: 2 - Stable
2422
23+
Set of utilities for dealing with additional environment variables defined in `.env` files.
24+
2525
### .env files
2626

2727
`.env` files (also known as dotenv files) are files that define environment variables,

doc/api/http2.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,6 +2796,10 @@ Throws `ERR_INVALID_ARG_TYPE` for invalid `settings` argument.
27962796
<!-- YAML
27972797
added: v8.4.0
27982798
changes:
2799+
- version: REPLACEME
2800+
pr-url: https://github.com/nodejs/node/pull/61713
2801+
description: Added `http1Options` option. The `Http1IncomingMessage`
2802+
and `Http1ServerResponse` options are now deprecated.
27992803
- version:
28002804
- v23.0.0
28012805
- v22.10.0
@@ -2914,9 +2918,27 @@ changes:
29142918
* `Http1IncomingMessage` {http.IncomingMessage} Specifies the
29152919
`IncomingMessage` class to used for HTTP/1 fallback. Useful for extending
29162920
the original `http.IncomingMessage`. **Default:** `http.IncomingMessage`.
2921+
**Deprecated.** Use `http1Options.IncomingMessage` instead. See
2922+
[DEP0202][].
29172923
* `Http1ServerResponse` {http.ServerResponse} Specifies the `ServerResponse`
29182924
class to used for HTTP/1 fallback. Useful for extending the original
29192925
`http.ServerResponse`. **Default:** `http.ServerResponse`.
2926+
**Deprecated.** Use `http1Options.ServerResponse` instead. See
2927+
[DEP0202][].
2928+
* `http1Options` {Object} An options object for configuring the HTTP/1
2929+
fallback when `allowHTTP1` is `true`. These options are passed to the
2930+
underlying HTTP/1 server. See [`http.createServer()`][] for available
2931+
options. Among others, the following are supported:
2932+
* `IncomingMessage` {http.IncomingMessage} Specifies the
2933+
`IncomingMessage` class to use for HTTP/1 fallback.
2934+
**Default:** `http.IncomingMessage`.
2935+
* `ServerResponse` {http.ServerResponse} Specifies the `ServerResponse`
2936+
class to use for HTTP/1 fallback.
2937+
**Default:** `http.ServerResponse`.
2938+
* `keepAliveTimeout` {number} The number of milliseconds of inactivity
2939+
a server needs to wait for additional incoming data, after it has
2940+
finished writing the last response, before a socket will be destroyed.
2941+
**Default:** `5000`.
29202942
* `Http2ServerRequest` {http2.Http2ServerRequest} Specifies the
29212943
`Http2ServerRequest` class to use.
29222944
Useful for extending the original `Http2ServerRequest`.
@@ -2990,6 +3012,9 @@ server.listen(8000);
29903012
<!-- YAML
29913013
added: v8.4.0
29923014
changes:
3015+
- version: REPLACEME
3016+
pr-url: https://github.com/nodejs/node/pull/61713
3017+
description: Added `http1Options` option.
29933018
- version:
29943019
- v15.10.0
29953020
- v14.16.0
@@ -3108,6 +3133,20 @@ changes:
31083133
and trailing whitespace validation for HTTP/2 header field names and values
31093134
as per [RFC-9113](https://www.rfc-editor.org/rfc/rfc9113.html#section-8.2.1).
31103135
**Default:** `true`.
3136+
* `http1Options` {Object} An options object for configuring the HTTP/1
3137+
fallback when `allowHTTP1` is `true`. These options are passed to the
3138+
underlying HTTP/1 server. See [`http.createServer()`][] for available
3139+
options. Among others, the following are supported:
3140+
* `IncomingMessage` {http.IncomingMessage} Specifies the
3141+
`IncomingMessage` class to use for HTTP/1 fallback.
3142+
**Default:** `http.IncomingMessage`.
3143+
* `ServerResponse` {http.ServerResponse} Specifies the `ServerResponse`
3144+
class to use for HTTP/1 fallback.
3145+
**Default:** `http.ServerResponse`.
3146+
* `keepAliveTimeout` {number} The number of milliseconds of inactivity
3147+
a server needs to wait for additional incoming data, after it has
3148+
finished writing the last response, before a socket will be destroyed.
3149+
**Default:** `5000`.
31113150
* `onRequestHandler` {Function} See [Compatibility API][]
31123151
* Returns: {Http2SecureServer}
31133152

@@ -4937,6 +4976,7 @@ you need to implement any fall-back behavior yourself.
49374976
[ALPN Protocol ID]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
49384977
[ALPN negotiation]: #alpn-negotiation
49394978
[Compatibility API]: #compatibility-api
4979+
[DEP0202]: deprecations.md#dep0202-http1incomingmessage-and-http1serverresponse-options-of-http2-servers
49404980
[HTTP/1]: http.md
49414981
[HTTP/2]: https://tools.ietf.org/html/rfc7540
49424982
[HTTP/2 Headers Object]: #headers-object
@@ -4963,6 +5003,7 @@ you need to implement any fall-back behavior yourself.
49635003
[`Http2Stream`]: #class-http2stream
49645004
[`ServerHttp2Stream`]: #class-serverhttp2stream
49655005
[`TypeError`]: errors.md#class-typeerror
5006+
[`http.createServer()`]: http.md#httpcreateserveroptions-requestlistener
49665007
[`http2.SecureServer`]: #class-http2secureserver
49675008
[`http2.Server`]: #class-http2server
49685009
[`http2.createSecureServer()`]: #http2createsecureserveroptions-onrequesthandler

doc/api/test.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3348,6 +3348,32 @@ This event is guaranteed to be emitted in the same order as the tests are
33483348
defined.
33493349
The corresponding execution ordered event is `'test:complete'`.
33503350

3351+
### Event: `'test:interrupted'`
3352+
3353+
<!-- YAML
3354+
added: REPLACEME
3355+
-->
3356+
3357+
* `data` {Object}
3358+
* `tests` {Array} An array of objects containing information about the
3359+
interrupted tests.
3360+
* `column` {number|undefined} The column number where the test is defined,
3361+
or `undefined` if the test was run through the REPL.
3362+
* `file` {string|undefined} The path of the test file,
3363+
`undefined` if test was run through the REPL.
3364+
* `line` {number|undefined} The line number where the test is defined, or
3365+
`undefined` if the test was run through the REPL.
3366+
* `name` {string} The test name.
3367+
* `nesting` {number} The nesting level of the test.
3368+
3369+
Emitted when the test runner is interrupted by a `SIGINT` signal (e.g., when
3370+
pressing <kbd>Ctrl</kbd>+<kbd>C</kbd>). The event contains information about
3371+
the tests that were running at the time of interruption.
3372+
3373+
When using process isolation (the default), the test name will be the file path
3374+
since the parent runner only knows about file-level tests. When using
3375+
`--test-isolation=none`, the actual test name is shown.
3376+
33513377
### Event: `'test:pass'`
33523378

33533379
* `data` {Object}

lib/internal/http2/core.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ const { Duplex } = require('stream');
4848
const tls = require('tls');
4949
const { setImmediate, setTimeout, clearTimeout } = require('timers');
5050

51-
const { kIncomingMessage } = require('_http_common');
52-
const { kServerResponse, Server: HttpServer, httpServerPreClose, setupConnectionsTracking } = require('_http_server');
51+
const {
52+
Server: HttpServer,
53+
httpServerPreClose,
54+
setupConnectionsTracking,
55+
storeHTTPOptions,
56+
} = require('_http_server');
5357
const JSStreamSocket = require('internal/js_stream_socket');
5458

5559
const {
@@ -3257,8 +3261,6 @@ function connectionListener(socket) {
32573261
if (socket.alpnProtocol === false || socket.alpnProtocol === 'http/1.1') {
32583262
// Fallback to HTTP/1.1
32593263
if (options.allowHTTP1 === true) {
3260-
socket.server[kIncomingMessage] = options.Http1IncomingMessage;
3261-
socket.server[kServerResponse] = options.Http1ServerResponse;
32623264
return httpConnectionListener.call(this, socket);
32633265
}
32643266
// Let event handler deal with the socket
@@ -3340,9 +3342,18 @@ function initializeOptions(options) {
33403342
options.unknownProtocolTimeout = 10000;
33413343

33423344

3343-
// Used only with allowHTTP1
3344-
options.Http1IncomingMessage ||= http.IncomingMessage;
3345-
options.Http1ServerResponse ||= http.ServerResponse;
3345+
// Initialize http1Options bag for HTTP/1 fallback when allowHTTP1 is true.
3346+
// This bag is passed to storeHTTPOptions() to configure HTTP/1 server
3347+
// behavior (timeouts, IncomingMessage/ServerResponse classes, etc.).
3348+
options.http1Options = { ...options.http1Options };
3349+
3350+
// Backward compat: migrate deprecated top-level Http1 options (DEP0201)
3351+
if (options.Http1IncomingMessage !== undefined) {
3352+
options.http1Options.IncomingMessage ??= options.Http1IncomingMessage;
3353+
}
3354+
if (options.Http1ServerResponse !== undefined) {
3355+
options.http1Options.ServerResponse ??= options.Http1ServerResponse;
3356+
}
33463357

33473358
options.Http2ServerRequest ||= Http2ServerRequest;
33483359
options.Http2ServerResponse ||= Http2ServerResponse;
@@ -3390,9 +3401,7 @@ class Http2SecureServer extends TLSServer {
33903401
this.timeout = 0;
33913402
this.on('newListener', setupCompat);
33923403
if (options.allowHTTP1 === true) {
3393-
this.headersTimeout = 60_000; // Minimum between 60 seconds or requestTimeout
3394-
this.requestTimeout = 300_000; // 5 minutes
3395-
this.connectionsCheckingInterval = 30_000; // 30 seconds
3404+
storeHTTPOptions.call(this, { ...options, ...options.http1Options });
33963405
this.shouldUpgradeCallback = function() {
33973406
return this.listenerCount('upgrade') > 0;
33983407
};

0 commit comments

Comments
 (0)