Skip to content

Commit 775caf0

Browse files
authored
Merge branch 'main' into doc-updates-windows-install
2 parents 524159a + 16ac5e1 commit 775caf0

File tree

231 files changed

+5643
-1345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+5643
-1345
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -361,5 +361,6 @@ module.exports = {
361361
WritableStream: 'readable',
362362
WritableStreamDefaultWriter: 'readable',
363363
WritableStreamDefaultController: 'readable',
364+
WebSocket: 'readable',
364365
},
365366
};

.github/CODEOWNERS

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
/LICENSE @nodejs/tsc
2121
/onboarding.md @nodejs/tsc
2222

23-
# website
24-
/doc/api_assets @nodejs/website
25-
/doc/template.html @nodejs/website
26-
/tools/doc @nodejs/website
23+
# nodejs.org website
24+
/doc/api_assets @nodejs/nodejs-website
25+
/doc/template.html @nodejs/nodejs-website
26+
/tools/doc @nodejs/web-infra
2727

2828
# streams
2929

.github/workflows/auto-start-ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ jobs:
5555
with:
5656
node-version: ${{ env.NODE_VERSION }}
5757

58-
- name: Install node-core-utils
59-
run: npm install -g node-core-utils
58+
- name: Install @node-core/utils
59+
run: npm install -g @node-core/utils
6060

61-
- name: Setup node-core-utils
61+
- name: Setup @node-core/utils
6262
run: |
6363
ncu-config set username ${{ secrets.JENKINS_USER }}
6464
ncu-config set token "${{ secrets.GH_USER_TOKEN }}"

.github/workflows/commit-queue.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ jobs:
7474
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
7575
with:
7676
node-version: ${{ env.NODE_VERSION }}
77-
- name: Install node-core-utils
78-
run: npm install -g node-core-utils@latest
77+
- name: Install @node-core/utils
78+
run: npm install -g @node-core/utils
7979

8080
- name: Set variables
8181
run: |
8282
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
8383
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
8484
85-
- name: Configure node-core-utils
85+
- name: Configure @node-core/utils
8686
run: |
8787
ncu-config set branch ${GITHUB_REF_NAME}
8888
ncu-config set upstream origin

.github/workflows/tools.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- corepack
2424
- doc
2525
- eslint
26+
- github_reporter
2627
- googletest
2728
- histogram
2829
- icu

.github/workflows/update-v8.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
3434
with:
3535
node-version: ${{ env.NODE_VERSION }}
36-
- name: Install node-core-utils
37-
run: npm install -g node-core-utils@latest
36+
- name: Install @node-core/utils
37+
run: npm install -g @node-core/utils
3838
- name: Check and download new V8 version
3939
run: |
4040
./tools/dep_updaters/update-v8-patch.sh > temp-output

.gitpod.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Ref: https://github.com/gitpod-io/gitpod/issues/6283#issuecomment-1001043454
22
tasks:
33
- init: ./configure && timeout 50m make -j16 || true
4-
- init: pnpm i -g node-core-utils
4+
- init: pnpm i -g @node-core/utils
55

66
# Ref: https://www.gitpod.io/docs/prebuilds#github-specific-configuration
77
github:

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ release.
3434
</tr>
3535
<tr>
3636
<td valign="top">
37-
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.7.0">20.7.0</a></b><br/>
37+
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.8.0">20.8.0</a></b><br/>
38+
<a href="doc/changelogs/CHANGELOG_V20.md#20.7.0">20.7.0</a><br/>
3839
<a href="doc/changelogs/CHANGELOG_V20.md#20.6.1">20.6.1</a><br/>
3940
<a href="doc/changelogs/CHANGELOG_V20.md#20.6.0">20.6.0</a><br/>
4041
<a href="doc/changelogs/CHANGELOG_V20.md#20.5.1">20.5.1</a><br/>

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ maintaining the Node.js project.
721721
**Akhil Marsonya** <<[email protected]>> (he/him)
722722
* [meixg](https://github.com/meixg) -
723723
**Xuguang Mei** <<[email protected]>> (he/him)
724+
* [mertcanaltin](https://github.com/mertcanaltin) -
725+
**Mert Can Altin** <<[email protected]>>
724726
* [Mesteery](https://github.com/Mesteery) -
725727
**Mestery** <<[email protected]>> (he/him)
726728
* [preveen-stack](https://github.com/preveen-stack) -

android_configure.py

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def patch_android():
7070
GYP_DEFINES += " v8_target_arch=" + arch
7171
GYP_DEFINES += " android_target_arch=" + arch
7272
GYP_DEFINES += " host_os=" + host_os + " OS=android"
73+
GYP_DEFINES += " android_ndk_path=" + android_ndk_path
7374
os.environ['GYP_DEFINES'] = GYP_DEFINES
7475

7576
if os.path.exists("./configure"):

benchmark/error/format-list.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'use strict';
2+
3+
const common = require('../common.js');
4+
5+
const bench = common.createBenchmark(main, {
6+
n: [1e7],
7+
input: [
8+
'',
9+
'a',
10+
'a,b',
11+
'a,b,c',
12+
'a,b,c,d',
13+
],
14+
type: [
15+
'undefined',
16+
'and',
17+
'or',
18+
],
19+
}, {
20+
flags: ['--expose-internals'],
21+
});
22+
23+
function main({ n, input, type }) {
24+
const {
25+
formatList,
26+
} = require('internal/errors');
27+
28+
const list = input.split(',');
29+
30+
if (type === 'undefined') {
31+
bench.start();
32+
for (let i = 0; i < n; ++i) {
33+
formatList(list);
34+
}
35+
bench.end(n);
36+
return;
37+
}
38+
39+
bench.start();
40+
for (let i = 0; i < n; ++i) {
41+
formatList(list, type);
42+
}
43+
bench.end(n);
44+
}
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
6+
const bench = common.createBenchmark(main, {
7+
n: [1e6],
8+
code: [
9+
'built-in',
10+
'ERR_HTTP2_STREAM_SELF_DEPENDENCY',
11+
'ERR_INVALID_STATE',
12+
'ERR_INVALID_URL',
13+
],
14+
stackTraceLimit: [0, 10],
15+
}, {
16+
flags: ['--expose-internals'],
17+
});
18+
19+
function getErrorFactory(code) {
20+
const {
21+
ERR_HTTP2_STREAM_SELF_DEPENDENCY,
22+
ERR_INVALID_STATE,
23+
ERR_INVALID_URL,
24+
} = require('internal/errors').codes;
25+
26+
switch (code) {
27+
case 'built-in':
28+
return (n) => new Error();
29+
case 'ERR_HTTP2_STREAM_SELF_DEPENDENCY':
30+
return (n) => new ERR_HTTP2_STREAM_SELF_DEPENDENCY();
31+
case 'ERR_INVALID_STATE':
32+
return (n) => new ERR_INVALID_STATE(n + '');
33+
case 'ERR_INVALID_URL':
34+
return (n) => new ERR_INVALID_URL({ input: n + '' });
35+
default:
36+
throw new Error(`${code} not supported`);
37+
}
38+
}
39+
40+
function main({ n, code, stackTraceLimit }) {
41+
const getError = getErrorFactory(code);
42+
43+
Error.stackTraceLimit = stackTraceLimit;
44+
45+
// Warm up.
46+
const length = 1024;
47+
const array = [];
48+
for (let i = 0; i < length; ++i) {
49+
array.push(getError(i));
50+
}
51+
52+
bench.start();
53+
54+
for (let i = 0; i < n; ++i) {
55+
const index = i % length;
56+
array[index] = getError(index);
57+
}
58+
59+
bench.end(n);
60+
61+
// Verify the entries to prevent dead code elimination from making
62+
// the benchmark invalid.
63+
for (let i = 0; i < length; ++i) {
64+
assert.strictEqual(typeof array[i], 'object');
65+
}
66+
}

benchmark/error/node-error-stack.js

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
6+
const bench = common.createBenchmark(main, {
7+
n: [1e6],
8+
code: [
9+
'built-in',
10+
'ERR_HTTP2_STREAM_SELF_DEPENDENCY',
11+
'ERR_INVALID_STATE',
12+
],
13+
stackTraceLimit: [0, 10],
14+
}, {
15+
flags: ['--expose-internals'],
16+
});
17+
18+
function getErrorStackFactory(code) {
19+
const {
20+
ERR_INVALID_STATE,
21+
ERR_HTTP2_STREAM_SELF_DEPENDENCY,
22+
} = require('internal/errors').codes;
23+
24+
switch (code) {
25+
case 'built-in':
26+
return (n) => new Error().stack;
27+
case 'ERR_HTTP2_STREAM_SELF_DEPENDENCY':
28+
return (n) => new ERR_HTTP2_STREAM_SELF_DEPENDENCY().stack;
29+
case 'ERR_INVALID_STATE':
30+
return (n) => new ERR_INVALID_STATE(n + '').stack;
31+
default:
32+
throw new Error(`${code} not supported`);
33+
}
34+
}
35+
36+
function main({ n, code, stackTraceLimit }) {
37+
const getStack = getErrorStackFactory(code);
38+
39+
Error.stackTraceLimit = stackTraceLimit;
40+
41+
// Warm up.
42+
const length = 1024;
43+
const array = [];
44+
for (let i = 0; i < length; ++i) {
45+
array.push(getStack(i));
46+
}
47+
48+
bench.start();
49+
50+
for (let i = 0; i < n; ++i) {
51+
const index = i % length;
52+
array[index] = getStack(index);
53+
}
54+
55+
bench.end(n);
56+
57+
// Verify the entries to prevent dead code elimination from making
58+
// the benchmark invalid.
59+
for (let i = 0; i < length; ++i) {
60+
assert.strictEqual(typeof array[i], 'string');
61+
}
62+
}

benchmark/error/node-error.js

-21
This file was deleted.

benchmark/fs/bench-unlinkSync.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const fs = require('fs');
5+
const tmpdir = require('../../test/common/tmpdir');
6+
tmpdir.refresh();
7+
8+
const bench = common.createBenchmark(main, {
9+
type: ['existing', 'non-existing'],
10+
n: [1e3],
11+
});
12+
13+
function main({ n, type }) {
14+
let files;
15+
16+
switch (type) {
17+
case 'existing':
18+
files = [];
19+
20+
// Populate tmpdir with mock files
21+
for (let i = 0; i < n; i++) {
22+
const path = tmpdir.resolve(`unlinksync-bench-file-${i}`);
23+
fs.writeFileSync(path, 'bench');
24+
files.push(path);
25+
}
26+
break;
27+
case 'non-existing':
28+
files = new Array(n).fill(tmpdir.resolve(`.non-existing-file-${Date.now()}`));
29+
break;
30+
default:
31+
new Error('Invalid type');
32+
}
33+
34+
bench.start();
35+
for (let i = 0; i < n; i++) {
36+
try {
37+
fs.unlinkSync(files[i]);
38+
} catch {
39+
// do nothing
40+
}
41+
}
42+
bench.end(n);
43+
}

benchmark/fs/readFileSync.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ const fs = require('fs');
66
const bench = common.createBenchmark(main, {
77
encoding: ['undefined', 'utf8'],
88
path: ['existing', 'non-existing'],
9-
n: [60e1],
9+
hasFileDescriptor: ['true', 'false'],
10+
n: [1e4],
1011
});
1112

12-
function main({ n, encoding, path }) {
13+
function main({ n, encoding, path, hasFileDescriptor }) {
1314
const enc = encoding === 'undefined' ? undefined : encoding;
14-
const file = path === 'existing' ? __filename : '/tmp/not-found';
15+
let file;
16+
let shouldClose = false;
17+
18+
if (hasFileDescriptor === 'true') {
19+
shouldClose = path === 'existing';
20+
file = path === 'existing' ? fs.openSync(__filename) : -1;
21+
} else {
22+
file = path === 'existing' ? __filename : '/tmp/not-found';
23+
}
1524
bench.start();
1625
for (let i = 0; i < n; ++i) {
1726
try {
@@ -21,4 +30,7 @@ function main({ n, encoding, path }) {
2130
}
2231
}
2332
bench.end(n);
33+
if (shouldClose) {
34+
fs.closeSync(file);
35+
}
2436
}

0 commit comments

Comments
 (0)