question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use web standard Request/Response APIs (a la Remix)

See original GitHub issue

Scope

Improves an existing behavior

Compatibility

  • This is a breaking change

Feature description

I think this could be done in a way that is non-breaking. But I think it’d be great to be able to write my handlers similar to how I write my Remix loaders/actions. They receive an object with { request, params, context } and return a Response. Could even use the Remix ponyfill for Request/Response: https://github.com/remix-run/web-std-io

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:10
  • Comments:34 (27 by maintainers)

github_iconTop GitHub Comments

5reactions
kettanaitocommented, Oct 17, 2022

@dbritto-dev, I know I could certainly use your help! Here are a couple of ways you can help me make this change a reality faster:

  • Help me review the API changes in MSW #1436
  • Help me review the API changes in @mswjs/interceptors https://github.com/mswjs/interceptors/pull/292
  • Read through the Migration guide and see what we can improve, or what we have missed covering to help developers migrate during the update.
  • If you have time, it’d be awesome to write a codemod for this migration. It probably makes sense to start with this once we’ve published this change as a release candidate, so we can iterate on the feedback and then have a codemod for the public release.
4reactions
kentcdoddscommented, Sep 13, 2022

Yup. I just think it’s an important imperative to keep things as standard as possible rather than almost standard. Even in the name of convenience.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web Fetch API - Remix
Remix adds Request , Response , Headers , and fetch to your loader's global context, so you can use them anywhere just like...
Read more >
Mock Service Worker on Twitter: "We've got a great suggestion ...
Use web standard Request/Response APIs (a la Remix ) · Issue #1404 · mswjs/msw. Scope Improves an existing behavior Compatibility This is a ......
Read more >
Monitor your web application with the Reporting API
It also intentionally violates its own policies, uses deprecated APIs, and does other bad things in order to generate reports.
Read more >
Web Storage API - MDN Web Docs - Mozilla
The Web Storage API provides mechanisms by which browsers can store key/value pairs, in a much more intuitive fashion than using cookies.
Read more >
Walmart Developer Portal: Developer Portal
To set up your business with Walmart, use the tools and APIs to provide access to ... about the endpoints, request/response structures, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found