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

fetch and http requests #154

Open
achingbrain opened this issue Nov 18, 2021 · 5 comments
Open

fetch and http requests #154

achingbrain opened this issue Nov 18, 2021 · 5 comments
Labels
effort/days Estimated to take multiple days, but less than a week kind/maintenance Work required to avoid breaking changes or harm to project's status quo status/blocked Unable to be worked further until needs are met

Comments

@achingbrain
Copy link
Member

This module exposes a HTTP class that lets you make HTTP requests. It accepts and returns interfaces from the browser fetch spec. Internally it juggles multiple fetch implementations between browsers, node, electron, and react native.

The types of all of these implementations differ to the degree that they are largely incompatible which means we @ts-ignore a bunch of stuff which lets us move on but gives us no type safety and causes all sorts of weird bugs and code gymnastics in other parts of the codebase.

We don't use or need the entirety of the fetch specification. Instead lets stop trying to be a general-purpose polymorphic fetch implementation and instead just expose the bits of the fetch API we use and have each implementation just service those bits.

@achingbrain achingbrain added the need/triage Needs initial labeling and prioritization label Nov 18, 2021
@achingbrain achingbrain changed the title fetch, http fetch and http requests Nov 18, 2021
@lidel lidel added effort/days Estimated to take multiple days, but less than a week kind/maintenance Work required to avoid breaking changes or harm to project's status quo P1 High: Likely tackled by core team if no one steps up and removed need/triage Needs initial labeling and prioritization labels Dec 3, 2021
@achingbrain
Copy link
Member Author

Looks like fetch may be coming to node after all: nodejs/node#41749

@vladfaust
Copy link

@achingbrain the issue you've mentioned has been merged.

@tinytb
Copy link

tinytb commented Nov 22, 2022

backlog grooming: has come to Node 18, which hasn't come to Electron yet. Will likely be in Electron 22 or 23 (possibly some months away, based on the release schedule).

@tinytb tinytb added status/blocked Unable to be worked further until needs are met and removed P1 High: Likely tackled by core team if no one steps up labels Nov 22, 2022
@TJKoury
Copy link

TJKoury commented Dec 1, 2022

Also consider moving the imports to static to help with bundlers. ESBuild doesn't like this. Can submit a pull if this is a change that will be considered.

@tinytb
Copy link

tinytb commented Jan 28, 2023

@TJKoury feel free to submit a PR. It's good to have an open mind to consider proposals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days Estimated to take multiple days, but less than a week kind/maintenance Work required to avoid breaking changes or harm to project's status quo status/blocked Unable to be worked further until needs are met
Projects
No open projects
Development

No branches or pull requests

5 participants