-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
lib: make fetch sync and return a Promise #49936
Merged
nodejs-github-bot
merged 1 commit into
nodejs:main
from
KhafraDev:fetch-sync-return-promise
Sep 30, 2023
Merged
lib: make fetch sync and return a Promise #49936
nodejs-github-bot
merged 1 commit into
nodejs:main
from
KhafraDev:fetch-sync-return-promise
Sep 30, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nodejs-github-bot
added
needs-ci
PRs that need a full CI run.
process
Issues and PRs related to the process subsystem.
labels
Sep 28, 2023
aduh95
reviewed
Sep 28, 2023
aduh95
approved these changes
Sep 28, 2023
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.
The title is click-baity, you didn't make fetch
sync, you made it a regular function 😅
benjamingr
approved these changes
Sep 28, 2023
lpinca
approved these changes
Sep 28, 2023
update test
KhafraDev
force-pushed
the
fetch-sync-return-promise
branch
from
September 28, 2023 20:30
c06b18c
to
e79c73c
Compare
I honestly didn't know what to title the PR lol |
I got this answer from the WHATWG chat:
|
KhafraDev
added
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
request-ci
Add this label to start a Jenkins CI on a PR.
labels
Sep 28, 2023
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Sep 28, 2023
atlowChemi
approved these changes
Sep 29, 2023
LiviaMedeiros
approved these changes
Sep 29, 2023
anonrig
approved these changes
Sep 30, 2023
JungMinu
approved these changes
Sep 30, 2023
atlowChemi
added
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Sep 30, 2023
nodejs-github-bot
removed
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Sep 30, 2023
Landed in fa250fd |
GeoffreyBooth
pushed a commit
to GeoffreyBooth/node
that referenced
this pull request
Oct 1, 2023
update test PR-URL: nodejs#49936 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
alexfernandez
pushed a commit
to alexfernandez/node
that referenced
this pull request
Nov 1, 2023
update test PR-URL: nodejs#49936 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos
pushed a commit
that referenced
this pull request
Nov 11, 2023
update test PR-URL: #49936 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
elrido
added a commit
to PrivateBin/PrivateBin
that referenced
this pull request
Dec 3, 2023
mocha tests started failing as of node 20.10.0, likely due to this change: nodejs/node#49936 Error was: node:internal/deps/undici/undici:11730 Error.captureStackTrace(err, this); ^ TypeError: Failed to parse URL from js/zlib-1.2.13.wasm at Object.fetch (node:internal/deps/undici/undici:11730:11) at async initialize (/home/runner/work/PrivateBin/PrivateBin/js/zlib-1.2.13.js:31:26) { [cause]: TypeError: Invalid URL: js/zlib-1.2.13.wasm at new URLImpl (/home/runner/work/PrivateBin/PrivateBin/js/node_modules/jsdom-url/node_modules/whatwg-url/lib/URL-impl.js:21:13) at new URLImplCore (/home/runner/work/PrivateBin/PrivateBin/js/node_modules/jsdom-url/lib/URLImpl.js:18:9) at new URLCore (/home/runner/work/PrivateBin/PrivateBin/js/node_modules/jsdom-url/lib/URL.js:28:9) at Object.construct (/home/runner/work/PrivateBin/PrivateBin/js/node_modules/class-proxy/index.js:18:23) at new Request (node:internal/deps/undici/undici:5270:25) at fetch (node:internal/deps/undici/undici:9508:25) at Object.fetch (node:internal/deps/undici/undici:11728:18) at fetch (node:internal/process/pre_execution:314:27) at initialize (/home/runner/work/PrivateBin/PrivateBin/js/zlib-1.2.13.js:31:32) at Object.<anonymous> (/home/runner/work/PrivateBin/PrivateBin/js/zlib-1.2.13.js:145:17) at Object.<anonymous> (/home/runner/work/PrivateBin/PrivateBin/js/zlib-1.2.13.js:146:4) [...] Notice that the error occurs on line 31, meaning that fetch is not undefined anymore. Node works on supporting fetch, which would make our workaround using fs.readFileSync obsolete, but it (or rather the undici library) currently doesn't support relative URLs.
debadree25
pushed a commit
to debadree25/node
that referenced
this pull request
Apr 15, 2024
update test PR-URL: nodejs#49936 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
KhafraDev
added a commit
to KhafraDev/node
that referenced
this pull request
Jun 6, 2024
- Extracts Blob.prototype.arrayBuffer so it cannot be overridden in .text(), etc. - Make .bytes() enumerable. I guess the WPT runner is not running the idlharness tests? - Make .text() return a Promise, rather than being explicitly async. This is a non-documented part of the webidl spec. Refs: nodejs#49936
KhafraDev
added a commit
to KhafraDev/node
that referenced
this pull request
Jun 6, 2024
- Extracts Blob.prototype.arrayBuffer so it cannot be overridden in .text(), etc. - Make .bytes() enumerable. I guess the WPT runner is not running the idlharness tests? - Make .text() return a Promise, rather than being explicitly async. This is a non-documented part of the webidl spec. Refs: nodejs#49936
KhafraDev
added a commit
to KhafraDev/node
that referenced
this pull request
Jun 6, 2024
- Extracts Blob.prototype.arrayBuffer so it cannot be overridden in .text(), etc. - Make .bytes() enumerable. I guess the WPT runner is not running the idlharness tests? - Make .text() return a Promise, rather than being explicitly async. This is a non-documented part of the webidl spec. Refs: nodejs#49936 - Have .text(), .arrayBuffer(), and .bytes() reject for an invalid this instead of throwing. Fix the tests regarding this.
KhafraDev
added a commit
to KhafraDev/node
that referenced
this pull request
Sep 25, 2024
- Extracts Blob.prototype.arrayBuffer so it cannot be overridden in .text(), etc. - Make .bytes() enumerable. I guess the WPT runner is not running the idlharness tests? - Make .text() return a Promise, rather than being explicitly async. This is a non-documented part of the webidl spec. Refs: nodejs#49936 - Have .text(), .arrayBuffer(), and .bytes() reject for an invalid this instead of throwing. Fix the tests regarding this.
nodejs-github-bot
pushed a commit
that referenced
this pull request
Sep 26, 2024
- Extracts Blob.prototype.arrayBuffer so it cannot be overridden in .text(), etc. - Make .bytes() enumerable. I guess the WPT runner is not running the idlharness tests? - Make .text() return a Promise, rather than being explicitly async. This is a non-documented part of the webidl spec. Refs: #49936 - Have .text(), .arrayBuffer(), and .bytes() reject for an invalid this instead of throwing. Fix the tests regarding this. PR-URL: #53372 Refs: #49936 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
targos
pushed a commit
that referenced
this pull request
Oct 4, 2024
- Extracts Blob.prototype.arrayBuffer so it cannot be overridden in .text(), etc. - Make .bytes() enumerable. I guess the WPT runner is not running the idlharness tests? - Make .text() return a Promise, rather than being explicitly async. This is a non-documented part of the webidl spec. Refs: #49936 - Have .text(), .arrayBuffer(), and .bytes() reject for an invalid this instead of throwing. Fix the tests regarding this. PR-URL: #53372 Refs: #49936 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
louwers
pushed a commit
to louwers/node
that referenced
this pull request
Nov 2, 2024
- Extracts Blob.prototype.arrayBuffer so it cannot be overridden in .text(), etc. - Make .bytes() enumerable. I guess the WPT runner is not running the idlharness tests? - Make .text() return a Promise, rather than being explicitly async. This is a non-documented part of the webidl spec. Refs: nodejs#49936 - Have .text(), .arrayBuffer(), and .bytes() reject for an invalid this instead of throwing. Fix the tests regarding this. PR-URL: nodejs#53372 Refs: nodejs#49936 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
tpoisseau
pushed a commit
to tpoisseau/node
that referenced
this pull request
Nov 21, 2024
- Extracts Blob.prototype.arrayBuffer so it cannot be overridden in .text(), etc. - Make .bytes() enumerable. I guess the WPT runner is not running the idlharness tests? - Make .text() return a Promise, rather than being explicitly async. This is a non-documented part of the webidl spec. Refs: nodejs#49936 - Have .text(), .arrayBuffer(), and .bytes() reject for an invalid this instead of throwing. Fix the tests regarding this. PR-URL: nodejs#53372 Refs: nodejs#49936 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
process
Issues and PRs related to the process subsystem.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I haven't tracked down exactly where the webidl spec says this, but every other platform I've tested matches this behavior. This has been nagging at me for a while 😅