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

feat: add Response.json static method #10

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

mcansh
Copy link
Collaborator

@mcansh mcansh commented May 25, 2022

remix-run/remix#3308

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

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

image

Signed-off-by: Logan McAnsh <logan@mcan.sh>
@changeset-bot
Copy link

changeset-bot bot commented May 25, 2022

🦋 Changeset detected

Latest commit: 7c9a525

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

Signed-off-by: Logan McAnsh <logan@mcan.sh>
@kettanaito
Copy link

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.

@mcansh
Copy link
Collaborator Author

mcansh commented Oct 14, 2022

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

@kettanaito
Copy link

@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!

Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
@mcansh mcansh marked this pull request as ready for review November 6, 2023 23:36
[skip ci]

Signed-off-by: Logan McAnsh <logan@mcan.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants