Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from nodejs:main #17

Open
wants to merge 737 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
737 commits
Select commit Hold shift + click to select a range
e849e74
doc: make MDN links to global classes more consistent in `assert.md`
aduh95 Feb 5, 2025
7dbc29e
doc: make MDN links to global classes more consistent
aduh95 Feb 7, 2025
c0953d9
crypto: support --use-system-ca on Windows
joyeecheung Feb 7, 2025
756a242
build: remove explicit linker call to libm on macOS
deepak1556 Feb 3, 2025
b7ce941
build: gyp exclude libm linking on macOS
deepak1556 Feb 3, 2025
1b2d2f7
doc: update history of stream.Readable.toWeb()
hkleungai Feb 7, 2025
0782c91
meta: bump `actions/setup-node` from 4.1.0 to 4.2.0
dependabot[bot] Feb 8, 2025
f535310
deps,tools: add zstd 1.5.6
jkrems Mar 15, 2024
bf12d72
zlib: add zstd support
jkrems Mar 15, 2024
297a4dd
src: add a hard dependency v8_inspector_headers
legendecas Jan 27, 2025
b181535
inspector: add Network.Initiator in inspector protocol
legendecas Feb 5, 2025
bfa1765
deps: update sqlite to 3.49.0
nodejs-github-bot Feb 9, 2025
51ded6e
test: improve test description
jakecastelli Feb 9, 2025
a017307
build,win: enable ccache
StefanStojanovic Feb 9, 2025
5e6092b
deps: update zlib to 1.3.0.1-motley-788cb3c
nodejs-github-bot Feb 9, 2025
6088183
test: automatically sync wpt urlpattern tests
JonasBa Feb 9, 2025
d1f8ccb
url: expose urlpattern as global
JonasBa Feb 9, 2025
a2aa6ca
test_runner: print formatted errors on summary
pmarchini Feb 9, 2025
1781f63
fs: make `FileHandle.readableWebStream` always create byte streams
isker Feb 10, 2025
6ba36b4
src: disallow copy/move fns/constructors
anonrig Feb 10, 2025
3844e7e
2025-02-10, Version 20.18.3 'Iron' (LTS)
marco-ippolito Jan 22, 2025
03e9adf
test: execute shell directly for refresh()
anonrig Feb 10, 2025
c5c71b2
src: add nullptr handling for `NativeKeyObject`
wooffie Feb 10, 2025
29bc969
meta: bump `actions/upload-artifact` from 4.4.3 to 4.6.0
dependabot[bot] Feb 10, 2025
b0c6e10
src: replace `SplitString` with built-in
anonrig Sep 18, 2024
72e1a8f
sqlite: fix coverity warnings related to backup()
cjihrig Feb 10, 2025
2a61c29
test: update webstorage wpt
anonrig Feb 10, 2025
92dae7d
zlib: make all zstd functions experimental
anonrig Feb 10, 2025
3ea97d5
zlib: use modern class syntax for zstd classes
anonrig Feb 10, 2025
5d7091f
timers: set several methods EOL
anonrig Feb 10, 2025
f9ea8d6
test: remove unnecessary syscall to cpuinfo
anonrig Feb 10, 2025
de1b345
test: improve timeout duration for debugger events
anonrig Feb 10, 2025
3186468
src: use `args.This()` in zlib
targos Feb 11, 2025
e7626dc
2025-02-11, Version 22.14.0 'Jod' (LTS)
aduh95 Feb 6, 2025
211171f
tools: bump eslint version
dependabot[bot] Feb 11, 2025
5dafb48
module: fix require.resolve() crash on non-string paths
Aditi-1400 Feb 11, 2025
20b01b7
test: remove flakiness on macOS test
anonrig Feb 9, 2025
66549b4
test: reduce flakiness on test-net-write-fully-async-buffer
anonrig Feb 9, 2025
888e5eb
src: improve error handling in process_wrap
jasnell Feb 11, 2025
cbedcd1
src: improve error handling in string_bytes/decoder
jasnell Feb 11, 2025
43ffcf1
src: improve node::Dotenv trimming
dario-piotrowicz Feb 11, 2025
b7ca23f
test: update WPT for urlpattern to ef6d83d789
nodejs-github-bot Feb 12, 2025
83ff1ae
doc: run license-builder
github-actions[bot] Feb 12, 2025
b07ff55
build: fix GN build of uv
zcbenz Feb 12, 2025
9ce1fff
doc: add `signal` to `filehandle.writeFile()` options
y-hsgw Feb 12, 2025
85f5a6c
src: add self-assigment memcpy checks
wooffie Feb 12, 2025
25b4a5d
doc: move stability index after history section for consistency
aduh95 Feb 12, 2025
a7f648c
tools: add support for `import source` syntax in linter
aduh95 Feb 12, 2025
5c83957
doc: update cleanup to trust on vuln db automation
RafaelGSS Feb 13, 2025
79f96b6
crypto: cleanup root certificates and skip PEM deserialization
joyeecheung Feb 13, 2025
128ec44
meta: update last name for jkrems
jkrems Feb 13, 2025
69d32d1
2025-02-13, Version 23.8.0 (Current)
nodejs-github-bot Feb 11, 2025
fc7682c
crypto: fix missing OPENSSL_NO_ENGINE guard
codebytere Feb 14, 2025
1e6a656
tools: fix release URL computation in update-root-certs.mjs
joyeecheung Feb 14, 2025
e4f2c25
doc: buffer: fix typo on `Buffer.copyBytesFrom(` `offset` option
tpoisseau Feb 14, 2025
f208027
doc: improve documentation on argument validation
Aditi-1400 Feb 14, 2025
cc7018e
test: remove unnecessary assert requiring from tests
dario-piotrowicz Feb 14, 2025
59cdd4f
test,crypto: make tests work for BoringSSL
codebytere Feb 15, 2025
44e2671
build: fix GN build failure
zcbenz Feb 15, 2025
ff51d83
doc: recommend writing tests in new files and including comments
joyeecheung Feb 15, 2025
47ae886
tools: do not run major-release workflow on forks
Trott Feb 15, 2025
a613f2f
test: fix test-without-async-context-frame.mjs in debug mode
joyeecheung Feb 15, 2025
61a57f7
test: add case for unrecognised fields within pjson "exports"
JakobJingleheimer Feb 13, 2025
409e28d
fs: handle UV_ENOTDIR in `fs.statSync` with `throwIfNoEntry` provided
juanarbol Feb 10, 2025
794f35f
doc: add a note about `require('../common')` in testing documentation
Aditi-1400 Feb 15, 2025
579fc67
crypto: support --use-system-ca on non-Windows and non-macOS
joyeecheung Feb 15, 2025
d384151
src: lock the isolate properly in IsolateData destructor
joyeecheung Feb 15, 2025
1d8593e
src: fix accessing empty string
zcbenz Feb 16, 2025
e892e79
doc: fix transpiler loader hooks documentation
joyeecheung Feb 16, 2025
69fdce2
doc: fix wrong verb form
dario-piotrowicz Feb 16, 2025
b6cd6b7
doc: `modules.md`: fix `distance` definition
alexweej Feb 16, 2025
610e474
benchmark: add a warmup on bench-openSync
elvessilvavieira Feb 16, 2025
f1b951f
doc: update `module.builtinModules` sentence
dario-piotrowicz Feb 16, 2025
666e773
doc: fix wrong articles used to address modules
dario-piotrowicz Feb 17, 2025
714ced1
doc: update Xcode version used for arm64 and pkg
targos Feb 17, 2025
11e7535
src: improve error handling in multiple files
jasnell Feb 8, 2025
4afc136
src: improve error handling in node_blob
jasnell Feb 15, 2025
b755ae1
doc: update clang-cl on Windows building guide
joyeecheung Feb 18, 2025
0a4572d
build: add skip_apidoc_files and include QUIC
RafaelGSS Feb 6, 2025
6fe0723
sea: suppress builtin warning with disableExperimentalSEAWarning option
koooge Feb 16, 2025
ecf803d
doc: disambiguate pseudo-code statement
dario-piotrowicz Feb 18, 2025
ea2004a
module: allow omitting context in synchronous next hooks
joyeecheung Feb 18, 2025
ef91595
dns: add TLSA record query and parsing
rithvikvibhu May 14, 2024
0192a7d
doc: add `module namespace object` links
dario-piotrowicz Feb 16, 2025
7a6b128
doc: fix link and history of `SourceMap` sections
aduh95 Feb 18, 2025
2086877
src: port `defineLazyProperties` to native code
aduh95 Feb 18, 2025
a724a9e
src: replace NewFromUtf8 with OneByteString where appropriate
jasnell Feb 18, 2025
baa60ce
test_runner: allow special characters in snapshot keys
Ceres6 Feb 19, 2025
f6ce486
build: print 'Formatting Markdown...' for long task markdown formatting
1ilsang Feb 19, 2025
8b40221
build: bump supported macOS version to 13.5
targos Feb 20, 2025
1dc882d
2025-02-20, Version 18.20.7 'Hydrogen' (LTS)
nodejs-github-bot Feb 18, 2025
15fec13
cli: allow --cpu-prof* in NODE_OPTIONS
Ceres6 Feb 20, 2025
03fdde5
tools: consolidate 'introduced_in' check for docs
1ilsang Feb 20, 2025
867a754
doc: fix 'introduced_in' version in typescript module
1ilsang Feb 20, 2025
06d5701
src: move instead of copy shared pointer in node_blob
targos Feb 20, 2025
3b0fce1
src: gate all quic behind disabled-by-default compile flag
jasnell Feb 19, 2025
305d15a
meta: add CODEOWNERS for SQLite
cjihrig Feb 20, 2025
d601c7d
src: do not format single string argument for THROW_ERR_*
joyeecheung Feb 18, 2025
8d10bc7
module: improve error message from asynchronicity in require(esm)
joyeecheung Feb 17, 2025
5ab7c4c
deps: update ada to 3.1.0
nodejs-github-bot Feb 20, 2025
f0e653d
src: add config file support
marco-ippolito Aug 27, 2024
772c609
src: create THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING
marco-ippolito Feb 18, 2025
8fc919d
test: improve error output of test-http2-client-promisify-connect-error
aduh95 Feb 21, 2025
e027791
process: add threadCpuUsage
ShogunPanda Feb 21, 2025
9e6a62f
url: improve urlpattern regexp performance
anonrig Feb 21, 2025
90ab559
typings: fix `ImportModuleDynamicallyCallback` return type
legendecas Feb 21, 2025
ba8fbf3
test: simplify test-http2-client-promisify-connect-error
lpinca Feb 22, 2025
bc8c6f8
doc: remove buffered flag from performance hooks examples
pavel-romanov8 Feb 23, 2025
62c5860
meta: bump `github/codeql-action` from 3.27.5 to 3.28.8
dependabot[bot] Feb 23, 2025
95e5399
meta: bump `actions/stale` from 9.0.0 to 9.1.0
dependabot[bot] Feb 23, 2025
d3c005b
meta: bump `actions/cache` from 4.1.2 to 4.2.0
dependabot[bot] Feb 23, 2025
3d43fb1
meta: bump `step-security/harden-runner` from 2.10.2 to 2.10.4
dependabot[bot] Feb 23, 2025
327955e
meta: bump `codecov/codecov-action` from 5.0.7 to 5.3.1
dependabot[bot] Feb 23, 2025
47d64d0
meta: bump `mozilla-actions/sccache-action` from 0.0.6 to 0.0.7
dependabot[bot] Feb 23, 2025
2dfdea2
meta: bump `peter-evans/create-pull-request` from 7.0.5 to 7.0.6
dependabot[bot] Feb 23, 2025
7f768f6
meta: bump `actions/setup-python` from 5.3.0 to 5.4.0
dependabot[bot] Feb 23, 2025
e2bc395
inspector: skip promise hook in the inspector async hook
joyeecheung Feb 23, 2025
25dd206
fs: remove `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK`
LiviaMedeiros Feb 23, 2025
7174ec9
tools: run Linux tests on GitHub arm64 runners as well
dennisameling Feb 23, 2025
4e1f0cc
src: fix crash when lazy getter is invoked in a vm context
legendecas Feb 23, 2025
4466e07
doc: fix web.libera.chat link in pull-requests.md
SamB Feb 23, 2025
ee8939c
test: make eval snapshot comparison more flexible
codebytere Feb 23, 2025
8c2df73
test_runner: refactor testPlan counter increse
pmarchini Feb 23, 2025
992036e
doc: fix typo in Windows building instructions
timja Feb 24, 2025
56773ba
src: namespace config file flags
marco-ippolito Feb 21, 2025
044d69a
test: add more coverage to node_config_file
marco-ippolito Feb 21, 2025
b7beb33
inspector: convert event params to protocol without json
legendecas Feb 24, 2025
8a9c3c2
src: do not expose simdjson.h in node_config_file.h
zcbenz Feb 24, 2025
9b6672a
doc: add additional caveat for fs.watch
mhdawson Feb 24, 2025
47cd034
doc: reserve NMV 135 for Electron 36
dsanders11 Feb 24, 2025
8f4d306
Revert "src: do not expose simdjson.h in node_config_file.h"
jasnell Feb 24, 2025
685f00c
test: add doAppendAndCancel test
y-hsgw Feb 24, 2025
22ac597
doc: update options to filehandle.appendFile()
y-hsgw Feb 24, 2025
e287009
lib: fixup incorrect argument order in assertEncoding
jasnell Feb 22, 2025
85c0f7a
lib: fixup more incorrect ERR_INVALID_ARG_VALUE uses
jasnell Feb 23, 2025
9a97b72
deps: update sqlite to 3.49.1
nodejs-github-bot Feb 25, 2025
9e103b0
deps: update ngtcp2 to 1.11.0
nodejs-github-bot Feb 25, 2025
9fd90d9
deps: update cjs-module-lexer to 2.1.0
nodejs-github-bot Feb 25, 2025
6cb0690
src: detect whether the string is one byte representation or not
theweipeng Dec 21, 2024
c864dea
lib: unexpose six process bindings
targos Feb 25, 2025
f52a358
fs: fix rmSync error code
koplas Feb 25, 2025
d62d7ca
src: improve error handling in spawn_sync
jasnell Feb 23, 2025
9840ca3
test: resolve race condition in test-net-write-fully-async-*
mcollina Feb 25, 2025
c05f4ba
doc: add esm examples to node:util
mfdebian Feb 25, 2025
6a19fde
src: improve error handling in module_wrap
jasnell Feb 23, 2025
e03af77
src: improve error handling in buffer and dotenv
jasnell Feb 24, 2025
34ded4d
test: allow embedder running async context frame test
codebytere Feb 26, 2025
fd45383
src: fix ThrowInvalidURL call in PathToFileURL
danielmbrasil Feb 26, 2025
3047436
doc: add streamResetBurst and streamResetRate
Sujal-Raj Feb 26, 2025
269c851
2025-02-26, Version 23.9.0 (Current)
nodejs-github-bot Feb 25, 2025
c7cf677
sqlite,test,doc: allow Buffer and URL as database location
geeksilva97 Feb 27, 2025
4edc6db
build,win: disable node pch with ccache
StefanStojanovic Feb 27, 2025
1a6bef2
src: set default config as node.config.json
marco-ippolito Feb 27, 2025
4ec9d42
test: assert write return values in buffer-bigint64
nektro Feb 28, 2025
0d92ce4
test: swap assert.strictEqual() parameters
lpinca Feb 28, 2025
48f381d
fs: only show deprecation warning when error code matches
aduh95 Feb 28, 2025
aafc14b
doc: add missing assert return types
cjihrig Feb 28, 2025
52ecb96
lib: optimize priority queue
gurgunday Feb 28, 2025
b4c7ea0
src: improve error handling in `tcp_wrap.cc`
jasnell Feb 26, 2025
72cfa4b
src: improve error handling in `tty_wrap.cc`
jasnell Feb 26, 2025
40deed2
src: improve error handling in `node_messaging.cc`
jasnell Feb 26, 2025
ac5afbc
doc: add @geeksilva97 to collaborators
geeksilva97 Feb 28, 2025
db4dcc0
esm: support source phase imports for WebAssembly
guybedford Feb 4, 2025
ed22a68
deps: update ada to 3.1.3
nodejs-github-bot Mar 1, 2025
5ae1224
deps: update gyp file for ngtcp2 1.11.0
richardlau Feb 27, 2025
60dff42
test: skip `test-config-json-schema` with quic
richardlau Feb 27, 2025
71196c4
net: emit an error when custom lookup resolves to a non-string address
geeksilva97 Mar 1, 2025
f4dd4bb
src: reduce string allocations on sqlite
anonrig Mar 1, 2025
e8df4f2
tools: update doc to new version
nodejs-github-bot Mar 1, 2025
a6181b4
doc: add 1ilsang to triage team
1ilsang Mar 1, 2025
d1ec948
doc: fix rendering of DEP0174 description
dsanders11 Mar 1, 2025
6b0af17
timers: check for immediate instance in clearImmediate
gurgunday Mar 1, 2025
a3657da
meta: set nodejs/config as codeowner
marco-ippolito Mar 2, 2025
4644853
tools: remove deps/zlib/GN-scraper.py
legendecas Mar 2, 2025
97cbefa
doc: clarify `path.isAbsolute` is not path traversal mitigation
ericfortis Mar 2, 2025
208f07a
test: more common.mustNotCall in net, tls
nektro Mar 3, 2025
7c910d0
module: add dynamic file-specific ESM warnings
mertcanaltin Mar 3, 2025
47a59bd
src: fix node_config_file.h compilation error in GN build
zcbenz Mar 3, 2025
f9916e9
meta: bump actions/upload-artifact from 4.6.0 to 4.6.1
dependabot[bot] Mar 3, 2025
fb8b728
meta: bump actions/cache from 4.2.0 to 4.2.2
dependabot[bot] Mar 3, 2025
ee8c38a
meta: bump step-security/harden-runner from 2.10.4 to 2.11.0
dependabot[bot] Mar 3, 2025
948557e
meta: bump peter-evans/create-pull-request from 7.0.6 to 7.0.7
dependabot[bot] Mar 3, 2025
3463aa2
meta: bump actions/download-artifact from 4.1.8 to 4.1.9
dependabot[bot] Mar 3, 2025
5b7ebbc
deps: update amaro to 0.4.1
marco-ippolito Feb 28, 2025
1347d42
test: module syntax should throw
marco-ippolito Feb 28, 2025
187ddb1
tools: bump the eslint group in /tools/eslint with 5 updates
dependabot[bot] Mar 3, 2025
5ac9551
deps: update undici to 7.4.0
nodejs-github-bot Mar 3, 2025
635aed9
deps: update corepack to 0.32.0
nodejs-github-bot Mar 4, 2025
0aa3ddd
module: handle cached linked async jobs in require(esm)
joyeecheung Mar 4, 2025
a914f17
doc: recommend `erasableSyntaxOnly` in ts docs
robpalme Mar 4, 2025
d3064e8
v8: add v8.getCppHeapStatistics() method
Aditi-1400 Mar 4, 2025
f37d2a5
tools: add more details about rolling inspector_protocol
legendecas Mar 4, 2025
559d481
src: fix typo in comment
aduh95 Mar 3, 2025
da90664
lib: remove obsolete Cipher export
jasnell Mar 2, 2025
2cff256
Revert "test: temporary remove resource check from fs read-write"
RafaelGSS Mar 4, 2025
52ac448
src: make more error handling improvements
jasnell Mar 1, 2025
6fdd4e6
src: refactor SubtleCrypto algorithm and length validations
panva Mar 4, 2025
db00f94
readline: add support for `Symbol.dispose`
aduh95 Mar 4, 2025
e05756f
tools: revert to use @stylistic/eslint-plugin-js v3
joyeecheung Mar 4, 2025
345aa1f
src: use cached `emit` v8::String
daeyeon Mar 5, 2025
c566639
stream: fix sizeAlgorithm validation in WritableStream
daeyeon Mar 5, 2025
64f6a2f
doc: update node-api version matrix
legendecas Mar 5, 2025
4e222ae
tools: extract target abseil to abseil.gyp
legendecas Mar 5, 2025
b4c8440
crypto: add support for intermediate certs in --use-system-ca
timja Mar 5, 2025
157b36b
src: make even more improvements to error handling
jasnell Mar 1, 2025
755e460
doc: fix Windows ccache section position
StefanStojanovic Mar 5, 2025
8342183
test: skip uv-thread-name on IBM i
abmusse Mar 5, 2025
2bf0bd2
tools: switch back to official OpenSSL
richardlau Mar 5, 2025
2a6f908
test: update compression wpt
anonrig Mar 5, 2025
395439b
assert: improve myers diff performance
puskin94 Mar 6, 2025
ded4eca
doc: ping nodejs/tsc for each security pull request
RafaelGSS Mar 6, 2025
3483937
src: remove redundant qualifiers in src/quic
anonrig Mar 6, 2025
a790901
tls: implement tls.getCACertificates()
joyeecheung Mar 6, 2025
5401ac6
doc: recommend setting `noEmit: true` in `tsconfig.json`
styfle Mar 6, 2025
117c1ca
src: use Maybe<void> in ProcessEmitWarningSync
daeyeon Mar 6, 2025
8032e96
doc: use more clear name in getSystemErrorMessage's example
IkumaTadokoro Mar 4, 2025
365faa7
test: use `assert.match` in `test-esm-import-meta`
aduh95 Mar 7, 2025
f161033
win,build: add option to enable Control Flow Guard
huseyinacacak-janea Mar 7, 2025
4cc69f9
src: allow embedder customization of OOMErrorHandler
codebytere Mar 7, 2025
9325697
meta: move RaisinTen back to collaborators, triagers and SEA champion
RaisinTen Mar 7, 2025
27f98c3
tools: import rather than require ESLint plugins
targos Mar 7, 2025
abd73d8
build: fix compatibility with V8's `depot_tools`
richardlau Mar 7, 2025
2eea453
test: simplify test-tls-connect-abort-controller.js
anonrig Mar 7, 2025
388d670
tls: make server.prototype.setOptions end-of-life
anonrig Mar 7, 2025
3a497dc
net: replace brand checks with identity checks
anonrig Mar 7, 2025
d18f487
src: refactor SubtleCrypto algorithm and length validations
panva Mar 4, 2025
ca472ea
meta: bump ossf/scorecard-action from 2.4.0 to 2.4.1
dependabot[bot] Mar 8, 2025
93efa72
meta: bump github/codeql-action from 3.28.8 to 3.28.10
dependabot[bot] Mar 8, 2025
617a053
meta: bump codecov/codecov-action from 5.3.1 to 5.4.0
dependabot[bot] Mar 8, 2025
7c2709d
timers: simplify the compareTimersLists function
gurgunday Mar 8, 2025
b3b9f52
src: fix process exit listeners not receiving unsettled tla codes
dario-piotrowicz Mar 8, 2025
725089a
doc: revise `tsconfig.json` note
styfle Mar 8, 2025
9a9a45a
src: do not pass nullptr to std::string ctor
ckerr Mar 9, 2025
9df0ff7
test_runner: change ts default glob
marco-ippolito Mar 9, 2025
478a2e6
tools: add config subspace
marco-ippolito Mar 9, 2025
599ec77
test: update WPT for WebCryptoAPI to edd42c005c
nodejs-github-bot Mar 9, 2025
fbe37d5
esm: fix module.exports export on CJS modules
guybedford Mar 7, 2025
451be0e
deps: upgrade openssl sources to quictls/openssl-3.0.16
nodejs-github-bot Mar 5, 2025
96457b4
deps: update archs files for openssl-3.0.16
nodejs-github-bot Mar 5, 2025
188f1eb
deps: update simdjson to 3.12.2
nodejs-github-bot Mar 10, 2025
34975b3
doc: add info on how project manages social media
mhdawson Mar 4, 2025
dba6fdc
test: update WPT for urlpattern to 3b6b19853a
nodejs-github-bot Mar 10, 2025
d8a9ab4
doc: revise webcrypto.md types, interfaces, and added versions
panva Mar 10, 2025
7a1b26e
doc: add Darshan back as voting TSC member
mhdawson Mar 10, 2025
823c9b7
doc: fix usage of module.registerSync in comment
timokoessler Mar 10, 2025
1b655c7
test: test runner run plan
pmarchini Mar 10, 2025
a446e3b
sqlite: reset statement immediately in run()
cjihrig Mar 11, 2025
6156bbb
crypto: update root certificates to NSS 3.108
nodejs-github-bot Mar 11, 2025
baf989b
dns: remove redundant code using common variable
deokjinkim Mar 11, 2025
491eb66
doc: make first parameter optional in `util.getCallSites`
deokjinkim Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
inspector: report loadingFinished until the response data is consumed
The `Network.loadingFinished` should be deferred until the response is
complete and the data is fully consumed. Also, report correct request
url with the specified port by retrieving the host from the request
headers.

PR-URL: nodejs#56372
Refs: nodejs#53946
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Kohei Ueno <[email protected]>
legendecas authored Jan 5, 2025
commit 9400eae52ee10f25d63c06c52479c033e3149580
31 changes: 31 additions & 0 deletions lib/internal/inspector/network.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

const {
NumberMAX_SAFE_INTEGER,
Symbol,
} = primordials;

const { now } = require('internal/perf/utils');
const kInspectorRequestId = Symbol('kInspectorRequestId');

/**
* Return a monotonically increasing time in seconds since an arbitrary point in the past.
* @returns {number}
*/
function getMonotonicTime() {
return now() / 1000;
}

let requestId = 0;
function getNextRequestId() {
if (requestId === NumberMAX_SAFE_INTEGER) {
requestId = 0;
}
return `node-network-event-${++requestId}`;
};

module.exports = {
kInspectorRequestId,
getMonotonicTime,
getNextRequestId,
};
132 changes: 132 additions & 0 deletions lib/internal/inspector/network_http.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
'use strict';

const {
ArrayIsArray,
DateNow,
ObjectEntries,
String,
Symbol,
} = primordials;

const {
kInspectorRequestId,
getMonotonicTime,
getNextRequestId,
} = require('internal/inspector/network');
const dc = require('diagnostics_channel');
const { Network } = require('inspector');

const kResourceType = 'Other';
const kRequestUrl = Symbol('kRequestUrl');

// Convert a Headers object (Map<string, number | string | string[]>) to a plain object (Map<string, string>)
const convertHeaderObject = (headers = {}) => {
// The 'host' header that contains the host and port of the URL.
let host;
const dict = {};
for (const { 0: key, 1: value } of ObjectEntries(headers)) {
if (key.toLowerCase() === 'host') {
host = value;
}
if (typeof value === 'string') {
dict[key] = value;
} else if (ArrayIsArray(value)) {
if (key.toLowerCase() === 'cookie') dict[key] = value.join('; ');
// ChromeDevTools frontend treats 'set-cookie' as a special case
// https://github.com/ChromeDevTools/devtools-frontend/blob/4275917f84266ef40613db3c1784a25f902ea74e/front_end/core/sdk/NetworkRequest.ts#L1368
else if (key.toLowerCase() === 'set-cookie') dict[key] = value.join('\n');
else dict[key] = value.join(', ');
} else {
dict[key] = String(value);
}
}
return [host, dict];
};

/**
* When a client request starts, emit Network.requestWillBeSent event.
* https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-requestWillBeSent
* @param {{ request: import('http').ClientRequest }} event
*/
function onClientRequestStart({ request }) {
request[kInspectorRequestId] = getNextRequestId();

const { 0: host, 1: headers } = convertHeaderObject(request.getHeaders());
const url = `${request.protocol}//${host}${request.path}`;
request[kRequestUrl] = url;

Network.requestWillBeSent({
requestId: request[kInspectorRequestId],
timestamp: getMonotonicTime(),
wallTime: DateNow(),
request: {
url,
method: request.method,
headers,
},
});
}

/**
* When a client request errors, emit Network.loadingFailed event.
* https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-loadingFailed
* @param {{ request: import('http').ClientRequest, error: any }} event
*/
function onClientRequestError({ request, error }) {
if (typeof request[kInspectorRequestId] !== 'string') {
return;
}
Network.loadingFailed({
requestId: request[kInspectorRequestId],
timestamp: getMonotonicTime(),
type: kResourceType,
errorText: error.message,
});
}

/**
* When response headers are received, emit Network.responseReceived event.
* https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-responseReceived
* @param {{ request: import('http').ClientRequest, error: any }} event
*/
function onClientResponseFinish({ request, response }) {
if (typeof request[kInspectorRequestId] !== 'string') {
return;
}
Network.responseReceived({
requestId: request[kInspectorRequestId],
timestamp: getMonotonicTime(),
type: kResourceType,
response: {
url: request[kRequestUrl],
status: response.statusCode,
statusText: response.statusMessage ?? '',
headers: convertHeaderObject(response.headers)[1],
},
});

// Wait until the response body is consumed by user code.
response.once('end', () => {
Network.loadingFinished({
requestId: request[kInspectorRequestId],
timestamp: getMonotonicTime(),
});
});
}

function enable() {
dc.subscribe('http.client.request.start', onClientRequestStart);
dc.subscribe('http.client.request.error', onClientRequestError);
dc.subscribe('http.client.response.finish', onClientResponseFinish);
}

function disable() {
dc.unsubscribe('http.client.request.start', onClientRequestStart);
dc.unsubscribe('http.client.request.error', onClientRequestError);
dc.unsubscribe('http.client.response.finish', onClientResponseFinish);
}

module.exports = {
enable,
disable,
};
99 changes: 6 additions & 93 deletions lib/internal/inspector_network_tracking.js
Original file line number Diff line number Diff line change
@@ -1,102 +1,15 @@
'use strict';

const {
ArrayIsArray,
DateNow,
ObjectEntries,
String,
} = primordials;

let dc;
let Network;

let requestId = 0;
const getNextRequestId = () => `node-network-event-${++requestId}`;

// Convert a Headers object (Map<string, number | string | string[]>) to a plain object (Map<string, string>)
const headerObjectToDictionary = (headers = {}) => {
const dict = {};
for (const { 0: key, 1: value } of ObjectEntries(headers)) {
if (typeof value === 'string') {
dict[key] = value;
} else if (ArrayIsArray(value)) {
if (key.toLowerCase() === 'cookie') dict[key] = value.join('; ');
// ChromeDevTools frontend treats 'set-cookie' as a special case
// https://github.com/ChromeDevTools/devtools-frontend/blob/4275917f84266ef40613db3c1784a25f902ea74e/front_end/core/sdk/NetworkRequest.ts#L1368
else if (key.toLowerCase() === 'set-cookie') dict[key] = value.join('\n');
else dict[key] = value.join(', ');
} else {
dict[key] = String(value);
}
}
return dict;
};

function onClientRequestStart({ request }) {
const url = `${request.protocol}//${request.host}${request.path}`;
const wallTime = DateNow();
const timestamp = wallTime / 1000;
request._inspectorRequestId = getNextRequestId();
Network.requestWillBeSent({
requestId: request._inspectorRequestId,
timestamp,
wallTime,
request: {
url,
method: request.method,
headers: headerObjectToDictionary(request.getHeaders()),
},
});
}

function onClientRequestError({ request, error }) {
if (typeof request._inspectorRequestId !== 'string') {
return;
}
const timestamp = DateNow() / 1000;
Network.loadingFailed({
requestId: request._inspectorRequestId,
timestamp,
type: 'Other',
errorText: error.message,
});
}

function onClientResponseFinish({ request, response }) {
if (typeof request._inspectorRequestId !== 'string') {
return;
}
const url = `${request.protocol}//${request.host}${request.path}`;
const timestamp = DateNow() / 1000;
Network.responseReceived({
requestId: request._inspectorRequestId,
timestamp,
type: 'Other',
response: {
url,
status: response.statusCode,
statusText: response.statusMessage ?? '',
headers: headerObjectToDictionary(response.headers),
},
});
Network.loadingFinished({
requestId: request._inspectorRequestId,
timestamp,
});
}

function enable() {
dc ??= require('diagnostics_channel');
Network ??= require('inspector').Network;
dc.subscribe('http.client.request.start', onClientRequestStart);
dc.subscribe('http.client.request.error', onClientRequestError);
dc.subscribe('http.client.response.finish', onClientResponseFinish);
require('internal/inspector/network_http').enable();
// TODO: add undici request/websocket tracking.
// https://github.com/nodejs/node/issues/53946
}

function disable() {
dc.unsubscribe('http.client.request.start', onClientRequestStart);
dc.unsubscribe('http.client.request.error', onClientRequestError);
dc.unsubscribe('http.client.response.finish', onClientResponseFinish);
require('internal/inspector/network_http').disable();
// TODO: add undici request/websocket tracking.
// https://github.com/nodejs/node/issues/53946
}

module.exports = {
2 changes: 2 additions & 0 deletions src/node_builtins.cc
Original file line number Diff line number Diff line change
@@ -119,6 +119,8 @@ BuiltinLoader::BuiltinCategories BuiltinLoader::GetBuiltinCategories() const {
builtin_categories.cannot_be_required = std::set<std::string> {
#if !HAVE_INSPECTOR
"inspector", "inspector/promises", "internal/util/inspector",
"internal/inspector/network", "internal/inspector/network_http",
"internal/inspector_async_hook", "internal/inspector_network_tracking",
#endif // !HAVE_INSPECTOR

#if !NODE_USE_V8_PLATFORM || !defined(NODE_HAVE_I18N_SUPPORT)
Loading