Skip to content

What is the reason to patch the fetch? #25573

Closed
@artalar

Description

@artalar

This looks so unpredictable:

  • works only for get and head (Many APIs request data via post)
  • do not support XMLHttpRequest / WebSocket / WebTransport / postMessage and other side-effects
  • you already have a bad practice with console.log patching (one of the feedback)
  • request.json() will parse and return a new data each time, so dependent effects will recall anyway?
  • finally, it just super bad pattern to patch globals, it always leads to problems eventually. Next.js already holds "next" word in fetch options, which disallow to use it in feature platform updates.

So, what is the reason to patch the fetch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions