Skip to content
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: this param for fetch calls #2292

Merged
merged 7 commits into from
Jul 19, 2023
Merged

fix: this param for fetch calls #2292

merged 7 commits into from
Jul 19, 2023

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Jul 19, 2023

  • Updates @web-std/fetch to v4 with fix for this param
  • Adds temporary fix for Node.js 20 - pass an ArrayBuffer as fetch body instead of a Blob
  • Switches smoke to listen on 127.0.0.1 instead of localhost so node doesn't auto resolve a IPv6 address and fail to connect
  • Tests client on Node.js 16, 18 and 20
  • Splits bundlesize from npm test tasks since it cannot be run on node.js 20 (depends on unmaintained native module iltorb which does not compile on node.js 20)

resolves #2274

@github-actions
Copy link
Contributor

github-actions bot commented Jul 19, 2023

@github-actions
Copy link
Contributor

package-lock.json changes

Summary

Status Count
UPDATED 1
REMOVED 27
Click to toggle table visibility
Name Status Previous Current
brotli-size REMOVED 0.1.0 -
bundlesize REMOVED 0.18.1 -
caller-callsite REMOVED 2.0.0 -
caller-path REMOVED 2.0.0 -
ci-env REMOVED 1.17.0 -
content-type UPDATED 1.0.4 1.0.5
decompress-response REMOVED 4.2.1 -
detect-libc REMOVED 1.0.3 -
duplexer REMOVED 0.1.2 -
expand-template REMOVED 2.0.3 -
github-build REMOVED 1.2.3 -
github-from-package REMOVED 0.0.0 -
gzip-size REMOVED 4.1.0 -
iltorb REMOVED 2.4.5 -
is-directory REMOVED 0.3.1 -
mimic-response REMOVED 2.1.0 -
mkdirp-classic REMOVED 0.5.3 -
napi-build-utils REMOVED 1.0.2 -
node-abi REMOVED 2.30.1 -
noop-logger REMOVED 0.1.1 -
prebuild-install REMOVED 5.3.6 -
prettycli REMOVED 1.4.3 -
simple-concat REMOVED 1.0.1 -
simple-get REMOVED 3.1.0 -
tar-fs REMOVED 2.1.1 -
tar-stream REMOVED 2.2.0 -
tunnel-agent REMOVED 0.6.0 -
which-pm-runs REMOVED 1.0.0 -

@alanshaw alanshaw marked this pull request as ready for review July 19, 2023 15:33
@alanshaw alanshaw requested a review from a team as a code owner July 19, 2023 15:33
@@ -53,7 +53,7 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/mocha": "9.0.0",
"bundlesize": "^0.18.1",
"body-parser": "^1.20.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...was a missing dependency

headers = { ...headers, 'X-Name': encodeURIComponent(name) }
const headers = {
...Web3Storage.headers(token),
'Content-Type': 'application/vnd.ipld.car',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensures we always get a Content-Type header even when we do the Node.js fix below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: I have created ipld/js-car#142 that we could reference official mime type, instead of having to copy that string all over.

"test:all": "run-s test:web test:cjs test:esm test:size",
"test:size": "bundlesize",
"test:all": "run-s test:web test:cjs test:esm",
"test:size": "npx bundlesize",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx so that npm install in ndoe.js 20 doesn't fail because native module can't be compiled.

@alanshaw alanshaw merged commit bf32c53 into main Jul 19, 2023
21 of 23 checks passed
@alanshaw alanshaw deleted the fix/fetch-this-param branch July 19, 2023 17:14
alanshaw added a commit to nftstorage/nft.storage that referenced this pull request Jul 20, 2023
alanshaw pushed a commit that referenced this pull request Jul 31, 2023
🤖 I have created a release *beep* *boop*
---


##
[7.19.0](api-v7.18.1...api-v7.19.0)
(2023-07-31)


### Features

* write content claims
([#2291](#2291))
([6a31c9b](6a31c9b))


### Bug Fixes

* remove unnecessary compatibility flags
([#2301](#2301))
([436cdb8](436cdb8))
* signer DID
([82c3462](82c3462))
* this param for fetch calls
([#2292](#2292))
([bf32c53](bf32c53))
* use error message value in cause
([9b07288](9b07288))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Put fails with ERR_INVALID_THIS
3 participants