refactor: use WHATWG URL instead of url.parse#48674
Conversation
aeefb54 to
c0d8f9f
Compare
| @@ -227,8 +227,7 @@ function validateHeader (name: any, value: any): void { | |||
| } | |||
|
|
|||
| function parseOptions (optionsIn: ClientRequestConstructorOptions | string): NodeJS.CreateURLLoaderOptions & ExtraURLLoaderOptions { | |||
There was a problem hiding this comment.
thought: this function feels like it needs a gentle rewrite overall. (non-blocking since the changes here preserve existing behavior 👍)
ckerr
left a comment
There was a problem hiding this comment.
Removing the deprecated code LGTM.
Marking as "request changes" because of the question about main.ts. Before merging this PR, it would be good to get info on why we had to revert this change the last time we did it.
default_app/main.ts
Outdated
| const file = option.file; | ||
| // eslint-disable-next-line n/no-deprecated-api | ||
| const protocol = url.parse(file).protocol; | ||
| const protocol = new URL(file).protocol; |
There was a problem hiding this comment.
🤔
I'm suspicious of this change because Sam tried doing this before and then backed it out.
Do we ever accept weird URLs here where url.parse() and WHATWG might differ, e.g. passing in a Windows file path with backslashes?
@MarshallOfSound (or anyone else) DYK why that change was backed out?
|
In general this PR is a Good Thing and I feel kinda bad that I've played a part in its staying in limbo for a month. @MarshallOfSound reping on #48674 (comment) In the alternate, @codebytere WDYT about using WHATURL everywhere except that one line that's in contention? |
0fc38ed to
e78dedc
Compare
|
@ckerr done! |
e78dedc to
c995c86
Compare
c995c86 to
a61aafb
Compare
jkleinsc
left a comment
There was a problem hiding this comment.
Looks like the change causes tests to fail.
a61aafb to
31a2b36
Compare
jkleinsc
left a comment
There was a problem hiding this comment.
Looks like tests are still failing.
Description of Change
Fixes #49550
Fixes #49840
Node is deprecating
url.parse:Checklist
npm testpassesRelease Notes
Notes: none