deps: update undici to 7.16.0 · nodejs/node@b711256

78 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,6 @@

1+

[submodule "test/web-platform-tests/wpt"]

2+

path = test/web-platform-tests/wpt

3+

url = https://github.com/web-platform-tests/wpt.git

4+

[submodule "test/fixtures/cache-tests"]

5+

path = test/fixtures/cache-tests

6+

url = https://github.com/http-tests/cache-tests

Original file line numberDiff line numberDiff line change

@@ -94,34 +94,50 @@ Create a commit which includes all of the updated files in lib/llhttp.

9494
9595

`undici` runs a subset of the [`web-platform-tests`](https://github.com/web-platform-tests/wpt).

9696
97-

### Requirements:

98-

- [Node core utils](https://github.com/nodejs/node-core-utils) setup with credentials.

99-
100-

To update every test, run the following commands. Typically you would only need to update the tests in a specific directory.

97+

### Steps:

10198
10299

```bash

103-

git node wpt resources

104-

git node wpt interfaces

105-

git node wpt common

106-

git node wpt fetch

107-

git node wpt xhr

108-

git node wpt websockets

109-

git node wpt mimesniff

110-

git node wpt storage

111-

git node wpt service-workers

112-

git node wpt eventsource

100+

git submodule update --init --recursive

113101

```

114102
115-

#### Run the tests

103+

### Run the tests

116104
117105

Run the tests to ensure that any new failures are marked as such.

118106
119-

You can mark tests as failing in their corresponding [status](./test/wpt/status) file.

107+

Before running the tests for the first time, you must setup the testing environment.

108+

```bash

109+

cd test/web-platform-tests

110+

node wpt-runner.mjs setup

111+

```

112+
113+

To run all tests:

120114
121115

```bash

122116

npm run test:wpt

123117

```

124118
119+

To run a subset of tests:

120+

```bash

121+

cd test/web-platform-tests

122+

node wpt-runner.mjs run [filter] [filterb]

123+

```

124+
125+

To run a single file:

126+

```bash

127+

cd test/web-platform-tests

128+

node wpt-runner.mjs run /path/to/test

129+

```

130+
131+

### Debugging

132+
133+

Verbose logging can be enabled by setting the [`NODE_DEBUG`](https://nodejs.org/api/cli.html#node_debugmodule) flag:

134+
135+

```bash

136+

npx cross-env NODE_DEBUG=UNDICI_WPT node --run test:wpt

137+

```

138+
139+

(`npx cross-env` can be omitted on Linux and Mac)

140+
125141

<a id="lint"></a>

126142

### Lint

127143
Original file line numberDiff line numberDiff line change

@@ -1,6 +1,6 @@

11

# undici

22
3-

[![Node CI](https://github.com/nodejs/undici/actions/workflows/nodejs.yml/badge.svg)](https://github.com/nodejs/undici/actions/workflows/nodejs.yml) [![neostandard javascript style](https://img.shields.io/badge/neo-standard-7fffff?style=flat\&labelColor=ff80ff)](https://github.com/neostandard/neostandard) [![npm version](https://badge.fury.io/js/undici.svg)](https://badge.fury.io/js/undici) [![codecov](https://codecov.io/gh/nodejs/undici/branch/main/graph/badge.svg?token=yZL6LtXkOA)](https://codecov.io/gh/nodejs/undici)

3+

[![Node CI](https://github.com/nodejs/undici/actions/workflows/ci.yml/badge.svg)](https://github.com/nodejs/undici/actions/workflows/nodejs.yml) [![neostandard javascript style](https://img.shields.io/badge/neo-standard-7fffff?style=flat\&labelColor=ff80ff)](https://github.com/neostandard/neostandard) [![npm version](https://badge.fury.io/js/undici.svg)](https://badge.fury.io/js/undici) [![codecov](https://codecov.io/gh/nodejs/undici/branch/main/graph/badge.svg?token=yZL6LtXkOA)](https://codecov.io/gh/nodejs/undici)

44
55

An HTTP/1.1 client, written from scratch for Node.js.

66
Original file line numberDiff line numberDiff line change

@@ -2,7 +2,7 @@

22
33

const WASM_BUILDER_CONTAINER = 'ghcr.io/nodejs/wasm-builder@sha256:975f391d907e42a75b8c72eb77c782181e941608687d4d8694c3e9df415a0970' // v0.0.9

44
5-

const { execSync } = require('node:child_process')

5+

const { execSync, execFileSync } = require('node:child_process')

66

const { writeFileSync, readFileSync } = require('node:fs')

77

const { join, resolve } = require('node:path')

88

@@ -69,10 +69,10 @@ if (process.argv[2] === '--docker') {

6969

}

7070
7171

const hasApk = (function () {

72-

try { execSync('command -v apk'); return true } catch (error) { return false }

72+

try { execSync('command -v apk'); return true } catch { return false }

7373

})()

7474

const hasOptimizer = (function () {

75-

try { execSync(`${WASM_OPT} --version`); return true } catch (error) { return false }

75+

try { execSync(`${WASM_OPT} --version`); return true } catch { return false }

7676

})()

7777

if (hasApk) {

7878

// Gather information about the tools used for the build

@@ -104,7 +104,19 @@ ${join(WASM_SRC, 'src')}/*.c \

104104

${WASM_LDLIBS}`, { stdio: 'inherit' })

105105
106106

if (hasOptimizer) {

107-

execSync(`${WASM_OPT} ${WASM_OPT_FLAGS} --enable-simd -o ${join(WASM_OUT, 'llhttp_simd.wasm')} ${join(WASM_OUT, 'llhttp_simd.wasm')}`, { stdio: 'inherit' })

107+

// Split WASM_OPT_FLAGS into an array, if not empty

108+

const wasmOptFlagsArray = WASM_OPT_FLAGS ? WASM_OPT_FLAGS.split(/\s+/).filter(Boolean) : []

109+

execFileSync(

110+

WASM_OPT,

111+

[

112+

...wasmOptFlagsArray,

113+

'--enable-simd',

114+

'-o',

115+

join(WASM_OUT, 'llhttp_simd.wasm'),

116+

join(WASM_OUT, 'llhttp_simd.wasm')

117+

],

118+

{ stdio: 'inherit' }

119+

)

108120

}

109121

writeWasmChunk('llhttp_simd.wasm', 'llhttp_simd-wasm.js')

110122