| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Some minor style notes, I haven’t reviewed in depth.
Sorry, something went wrong.
|
@GeoffreyBooth fixed + added http 404 handling |
Sorry, something went wrong.
This is actually a bit complicated since import.meta.url needs the value synchronously for the response location after all redirects so it actually relies on storing the value for now. |
Sorry, something went wrong.
Ah, mind if I add a comment to the code explaining that around the cacheForGET code? |
Sorry, something went wrong.
I'm all for comments |
Sorry, something went wrong.
|
Added both comments. |
Sorry, something went wrong.
There was a problem hiding this comment.
Oow, fancy. Much cleaner than .on(…) 🙌
Sorry, something went wrong.
There was a problem hiding this comment.
| * It caches either the promise or the cahce entry since import.meta.url needs | |
| * It caches either the promise or the cache entry since import.meta.url needs |
Sorry, something went wrong.
|
@bmeck @nodejs/modules this could use some reviews :) |
Sorry, something went wrong.
There was a problem hiding this comment.
Can we get a 404 test though to land?
Sorry, something went wrong.
|
Added test :) |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Commit Queue failed- Loading data for nodejs/node/pull/41950 ✔ Done loading data for nodejs/node/pull/41950 ----------------------------------- PR info ------------------------------------ Title module: prefer async/await in https imports (#41950) Author Benjamin Gruenbaum (@benjamingr) Branch benjamingr:use-async-await-in-fetch-module -> nodejs:master Labels esm, needs-ci Commits 1 - module: prefer async/await in https imports Committers 1 - Benjamin Gruenbaum PR-URL: https://github.com/nodejs/node/pull/41950 Fixes: https://github.com/nodejs/node/issues/41950 Reviewed-By: Guy Bedford Reviewed-By: James M Snell ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/41950 Fixes: https://github.com/nodejs/node/issues/41950 Reviewed-By: Guy Bedford Reviewed-By: James M Snell -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - module: prefer async/await in https imports ℹ This PR was created on Sat, 12 Feb 2022 18:50:10 GMT ✔ Approvals: 2 ✔ - Guy Bedford (@guybedford): https://github.com/nodejs/node/pull/41950#pullrequestreview-884778590 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/41950#pullrequestreview-889949951 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2022-02-23T18:10:07Z: https://ci.nodejs.org/job/node-test-pull-request/42748/ - Querying data for job/node-test-pull-request/42748/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/1889467631 |
Sorry, something went wrong.
PR-URL: nodejs#41950 Fixes: nodejs#41950 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#41950 Fixes: nodejs#41950 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
This is failing in the v16.x branch; let me work in a backport for this: /node --inspect --experimental-network-imports --dns-result-order=ipv4first test/es-module/test-http-imports.mjs
Debugger listening on ws://127.0.0.1:9229/924045ba-ef66-4869-84bf-085849cbf26b
For help, see: https://nodejs.org/en/docs/inspector
node:internal/errors:465
ErrorCaptureStackTrace(err);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "list" argument must be an instance of Array. Received an instance of Buffer
at concat (node:buffer:537:3)
at node:internal/modules/esm/fetch_module:165:24
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async node:internal/modules/esm/fetch_module:171:7
at async defaultLoad (node:internal/modules/esm/load:21:14) at async ESMLoader.load (node:internal/modules/esm/loader:407:20)
at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:326:11)
at async link (node:internal/modules/esm/module_job:70:21) {
code: 'ERR_INVALID_ARG_TYPE'
} Looks like the toArray() method is returning the Buffer not the array, see: https://github.com/nodejs/node/pull/41553/files#diff-00d8d040a3fe90e3052af39cb55dc9bcac70539d5d17791449cbfe7e3b55fb90R1903-R1904 |
Sorry, something went wrong.
PR-URL: nodejs/node#41950 Fixes: nodejs/node#41950 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
cc @bmeck @nodejs/modules
This PR refactors the fetch_module fetchWithRedirects function to use the new modern facilities for streams:
Note this can probably be further simplified by always caching the promise (and never the value) and by moving the "memoize" functionality to a helper).
Fixes: #41950