web-std-io icon indicating copy to clipboard operation
web-std-io copied to clipboard

feat: add Response.json static method

Open mcansh opened this issue 3 years ago • 4 comments
trafficstars

https://github.com/remix-run/remix/discussions/3308

======================================================================================

confirmed working with npm link and importing Response from @remix-run/web-fetch

image

mcansh avatar May 25 '22 21:05 mcansh

🦋 Changeset detected

Latest commit: 7c9a52518b261e47dec483201c8bd985f3f4420b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@remix-run/web-fetch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 25 '22 21:05 changeset-bot[bot]

As far as I know, there's no Response.json static method on the Fetch API Response class. If this is a convenience feature, I'd highly encourage you not to add it to the Response class directly.

I'm solving a similar convenience issue in MSW, and you can draw some inspiration from there.

kettanaito avatar Oct 11 '22 12:10 kettanaito

it's in the spec and implemented in chrome, so it really just makes our polyfill closer to the spec

mcansh avatar Oct 14 '22 20:10 mcansh

@mcansh, a good point, I must've been using a really old version of Chrome so it didn't show up when I checked this. Thanks for correcting me!

kettanaito avatar Oct 14 '22 22:10 kettanaito