Skip to content

Commit

Permalink
Merge branch 'main' into doc-updates-windows-install
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd authored Sep 29, 2023
2 parents 524159a + 16ac5e1 commit 775caf0
Show file tree
Hide file tree
Showing 231 changed files with 5,643 additions and 1,345 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,5 +361,6 @@ module.exports = {
WritableStream: 'readable',
WritableStreamDefaultWriter: 'readable',
WritableStreamDefaultController: 'readable',
WebSocket: 'readable',
},
};
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
/LICENSE @nodejs/tsc
/onboarding.md @nodejs/tsc

# website
/doc/api_assets @nodejs/website
/doc/template.html @nodejs/website
/tools/doc @nodejs/website
# nodejs.org website
/doc/api_assets @nodejs/nodejs-website
/doc/template.html @nodejs/nodejs-website
/tools/doc @nodejs/web-infra

# streams

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/auto-start-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install node-core-utils
run: npm install -g node-core-utils
- name: Install @node-core/utils
run: npm install -g @node-core/utils

- name: Setup node-core-utils
- name: Setup @node-core/utils
run: |
ncu-config set username ${{ secrets.JENKINS_USER }}
ncu-config set token "${{ secrets.GH_USER_TOKEN }}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/commit-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ jobs:
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install node-core-utils
run: npm install -g node-core-utils@latest
- name: Install @node-core/utils
run: npm install -g @node-core/utils

- name: Set variables
run: |
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
- name: Configure node-core-utils
- name: Configure @node-core/utils
run: |
ncu-config set branch ${GITHUB_REF_NAME}
ncu-config set upstream origin
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:
- corepack
- doc
- eslint
- github_reporter
- googletest
- histogram
- icu
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-v8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install node-core-utils
run: npm install -g node-core-utils@latest
- name: Install @node-core/utils
run: npm install -g @node-core/utils
- name: Check and download new V8 version
run: |
./tools/dep_updaters/update-v8-patch.sh > temp-output
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ref: https://github.com/gitpod-io/gitpod/issues/6283#issuecomment-1001043454
tasks:
- init: ./configure && timeout 50m make -j16 || true
- init: pnpm i -g node-core-utils
- init: pnpm i -g @node-core/utils

# Ref: https://www.gitpod.io/docs/prebuilds#github-specific-configuration
github:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.7.0">20.7.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.8.0">20.8.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V20.md#20.7.0">20.7.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V20.md#20.6.1">20.6.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V20.md#20.6.0">20.6.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V20.md#20.5.1">20.5.1</a><br/>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,8 @@ maintaining the Node.js project.
**Akhil Marsonya** <<[email protected]>> (he/him)
* [meixg](https://github.com/meixg) -
**Xuguang Mei** <<[email protected]>> (he/him)
* [mertcanaltin](https://github.com/mertcanaltin) -
**Mert Can Altin** <<[email protected]>>
* [Mesteery](https://github.com/Mesteery) -
**Mestery** <<[email protected]>> (he/him)
* [preveen-stack](https://github.com/preveen-stack) -
Expand Down
1 change: 1 addition & 0 deletions android_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def patch_android():
GYP_DEFINES += " v8_target_arch=" + arch
GYP_DEFINES += " android_target_arch=" + arch
GYP_DEFINES += " host_os=" + host_os + " OS=android"
GYP_DEFINES += " android_ndk_path=" + android_ndk_path
os.environ['GYP_DEFINES'] = GYP_DEFINES

if os.path.exists("./configure"):
Expand Down
44 changes: 44 additions & 0 deletions benchmark/error/format-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use strict';

const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [1e7],
input: [
'',
'a',
'a,b',
'a,b,c',
'a,b,c,d',
],
type: [
'undefined',
'and',
'or',
],
}, {
flags: ['--expose-internals'],
});

function main({ n, input, type }) {
const {
formatList,
} = require('internal/errors');

const list = input.split(',');

if (type === 'undefined') {
bench.start();
for (let i = 0; i < n; ++i) {
formatList(list);
}
bench.end(n);
return;
}

bench.start();
for (let i = 0; i < n; ++i) {
formatList(list, type);
}
bench.end(n);
}
File renamed without changes.
66 changes: 66 additions & 0 deletions benchmark/error/node-error-instantiation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
'use strict';

const common = require('../common');
const assert = require('assert');

const bench = common.createBenchmark(main, {
n: [1e6],
code: [
'built-in',
'ERR_HTTP2_STREAM_SELF_DEPENDENCY',
'ERR_INVALID_STATE',
'ERR_INVALID_URL',
],
stackTraceLimit: [0, 10],
}, {
flags: ['--expose-internals'],
});

function getErrorFactory(code) {
const {
ERR_HTTP2_STREAM_SELF_DEPENDENCY,
ERR_INVALID_STATE,
ERR_INVALID_URL,
} = require('internal/errors').codes;

switch (code) {
case 'built-in':
return (n) => new Error();
case 'ERR_HTTP2_STREAM_SELF_DEPENDENCY':
return (n) => new ERR_HTTP2_STREAM_SELF_DEPENDENCY();
case 'ERR_INVALID_STATE':
return (n) => new ERR_INVALID_STATE(n + '');
case 'ERR_INVALID_URL':
return (n) => new ERR_INVALID_URL({ input: n + '' });
default:
throw new Error(`${code} not supported`);
}
}

function main({ n, code, stackTraceLimit }) {
const getError = getErrorFactory(code);

Error.stackTraceLimit = stackTraceLimit;

// Warm up.
const length = 1024;
const array = [];
for (let i = 0; i < length; ++i) {
array.push(getError(i));
}

bench.start();

for (let i = 0; i < n; ++i) {
const index = i % length;
array[index] = getError(index);
}

bench.end(n);

// Verify the entries to prevent dead code elimination from making
// the benchmark invalid.
for (let i = 0; i < length; ++i) {
assert.strictEqual(typeof array[i], 'object');
}
}
62 changes: 62 additions & 0 deletions benchmark/error/node-error-stack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use strict';

const common = require('../common');
const assert = require('assert');

const bench = common.createBenchmark(main, {
n: [1e6],
code: [
'built-in',
'ERR_HTTP2_STREAM_SELF_DEPENDENCY',
'ERR_INVALID_STATE',
],
stackTraceLimit: [0, 10],
}, {
flags: ['--expose-internals'],
});

function getErrorStackFactory(code) {
const {
ERR_INVALID_STATE,
ERR_HTTP2_STREAM_SELF_DEPENDENCY,
} = require('internal/errors').codes;

switch (code) {
case 'built-in':
return (n) => new Error().stack;
case 'ERR_HTTP2_STREAM_SELF_DEPENDENCY':
return (n) => new ERR_HTTP2_STREAM_SELF_DEPENDENCY().stack;
case 'ERR_INVALID_STATE':
return (n) => new ERR_INVALID_STATE(n + '').stack;
default:
throw new Error(`${code} not supported`);
}
}

function main({ n, code, stackTraceLimit }) {
const getStack = getErrorStackFactory(code);

Error.stackTraceLimit = stackTraceLimit;

// Warm up.
const length = 1024;
const array = [];
for (let i = 0; i < length; ++i) {
array.push(getStack(i));
}

bench.start();

for (let i = 0; i < n; ++i) {
const index = i % length;
array[index] = getStack(index);
}

bench.end(n);

// Verify the entries to prevent dead code elimination from making
// the benchmark invalid.
for (let i = 0; i < length; ++i) {
assert.strictEqual(typeof array[i], 'string');
}
}
21 changes: 0 additions & 21 deletions benchmark/error/node-error.js

This file was deleted.

43 changes: 43 additions & 0 deletions benchmark/fs/bench-unlinkSync.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
'use strict';

const common = require('../common');
const fs = require('fs');
const tmpdir = require('../../test/common/tmpdir');
tmpdir.refresh();

const bench = common.createBenchmark(main, {
type: ['existing', 'non-existing'],
n: [1e3],
});

function main({ n, type }) {
let files;

switch (type) {
case 'existing':
files = [];

// Populate tmpdir with mock files
for (let i = 0; i < n; i++) {
const path = tmpdir.resolve(`unlinksync-bench-file-${i}`);
fs.writeFileSync(path, 'bench');
files.push(path);
}
break;
case 'non-existing':
files = new Array(n).fill(tmpdir.resolve(`.non-existing-file-${Date.now()}`));
break;
default:
new Error('Invalid type');
}

bench.start();
for (let i = 0; i < n; i++) {
try {
fs.unlinkSync(files[i]);
} catch {
// do nothing
}
}
bench.end(n);
}
18 changes: 15 additions & 3 deletions benchmark/fs/readFileSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ const fs = require('fs');
const bench = common.createBenchmark(main, {
encoding: ['undefined', 'utf8'],
path: ['existing', 'non-existing'],
n: [60e1],
hasFileDescriptor: ['true', 'false'],
n: [1e4],
});

function main({ n, encoding, path }) {
function main({ n, encoding, path, hasFileDescriptor }) {
const enc = encoding === 'undefined' ? undefined : encoding;
const file = path === 'existing' ? __filename : '/tmp/not-found';
let file;
let shouldClose = false;

if (hasFileDescriptor === 'true') {
shouldClose = path === 'existing';
file = path === 'existing' ? fs.openSync(__filename) : -1;
} else {
file = path === 'existing' ? __filename : '/tmp/not-found';
}
bench.start();
for (let i = 0; i < n; ++i) {
try {
Expand All @@ -21,4 +30,7 @@ function main({ n, encoding, path }) {
}
}
bench.end(n);
if (shouldClose) {
fs.closeSync(file);
}
}
Loading

0 comments on commit 775caf0

Please sign in to comment.