-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(deps): update undici to 4.0.0 #7931
Changes from 2 commits
fea217c
e79239e
4cc8333
b92f97d
206c0ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ | |
"new-github-issue-url": "^0.2.1", | ||
"p-retry": "^4.2.0", | ||
"terminal-link": "^2.1.1", | ||
"undici": "3.3.6" | ||
"undici": "^4.0.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know why but pnpm also keeps the version 3.x.x which causes build of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also experiencing errors when _http_common is removed from Webpack's externals |
||
}, | ||
"files": [ | ||
"README.md", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
import getStream = require('get-stream') | ||
import { Client, Pool } from 'undici' | ||
import { Client, Dispatcher, Pool } from 'undici' | ||
import { URL } from 'url' | ||
export class Undici { | ||
private pool: Pool | ||
private closed = false | ||
private url: string | URL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure about this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok and how exactly I'm on a phone |
||
constructor(url: string | URL, moreArgs?: Pool.Options) { | ||
this.url = url | ||
this.pool = new Pool(url, { | ||
connections: 100, | ||
pipelining: 10, | ||
keepAliveMaxTimeout: 600e3, | ||
headersTimeout: 0, | ||
bodyTimeout: 0, | ||
...moreArgs, | ||
}) | ||
} | ||
request( | ||
body: Client.DispatchOptions['body'], | ||
body: Dispatcher.DispatchOptions['body'], | ||
customHeaders?: Record<string, string>, | ||
) { | ||
return new Promise((resolve, reject) => { | ||
this.pool.request( | ||
{ | ||
origin: this.url, | ||
path: '/', | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
...customHeaders, | ||
}, | ||
body, | ||
bodyTimeout: 0, | ||
}, | ||
async (err, result) => { | ||
if (err) { | ||
|
@@ -45,6 +48,7 @@ export class Undici { | |
return new Promise((resolve, reject) => { | ||
this.pool.request( | ||
{ | ||
origin: this.url, | ||
path: '/', | ||
method: 'GET', | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar enough with esbuild. The problem is that undici uses
path.resolve
to establish a path to wasm files (https://github.com/nodejs/undici/blob/e705509ab22ab80aadf0fc1a394afff7dc014fdf/lib/client.js#L390-L398) and I wasn't able to find a plugin that could resolve that and copy files accordingly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just don't know what I'm doing myself.