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

remove "light weight" from "A light-weight module that brings Fetch API to Node.js." #1637

Closed
Pomax opened this issue Sep 4, 2022 · 7 comments · May be fixed by #1777
Closed

remove "light weight" from "A light-weight module that brings Fetch API to Node.js." #1637

Pomax opened this issue Sep 4, 2022 · 7 comments · May be fixed by #1777
Labels

Comments

@Pomax
Copy link

Pomax commented Sep 4, 2022

Nitpicking, but: node-fetch is an almost 8MB install. It is very much not light weight (even if its own code is, it is heavily weighed down by the 7.5MB web-streams-polyfill dependency used by fetch-blob)

@Pomax Pomax added the bug label Sep 4, 2022
@jimmywarting
Copy link
Collaborator

once web-streams-polyfill release v4 then it will drop it's size again...

@Pomax
Copy link
Author

Pomax commented Sep 4, 2022

I don't see anything in v4 that justifies the claim that it'll be drastically smaller?

@jimmywarting
Copy link
Collaborator

jimmywarting commented Sep 5, 2022

v3 have many build version to choose from
MattiasBuelens/web-streams-polyfill#82

@Pomax
Copy link
Author

Pomax commented Sep 5, 2022

Cool. But in the mean time there is no indication that it's being actively worked on (just incidentally), and as a user of node-fetch I do not have the option to tell node-fetch that it's installing on a normal, current version of Node and so needs almost nothing from the web-streams polyfill.

Unless npm install node-fetch can be told to install only what it needs (which as far as I know is impossible?) node-fetch is not light-weight, it's incredibly bloated, and even if web-streams-poly V4 becomes the ultimate pick-and-choose, the problem of node-fetch pulling in the full polyfill dependency will still be there. Node-fetch is a a huge library, updating the project subtitle to not make a claim to the contrary would still be a decent thing to do.

@jghaanstra
Copy link

jghaanstra commented Nov 20, 2022

Why is this closed, the term lightweight is very misleading and it's been huge in size for more than a year now with no real indication of a solution any time soon.

@jimmywarting
Copy link
Collaborator

It where was once "lightweight" before we decided to make blob streams spec compatible by introducing whatwg streams polyfill that will conditionally be loaded.
And it will be that once again when stream polyfill release v4 (which i hope would have happen sooner).
So i really think it's up to Mattias to fix the release as he has promised but it has taken a very long time... hence why i closed this.

@Pomax
Copy link
Author

Pomax commented Nov 20, 2022

On a different note, Node 18 has native Fetch API built in (it was experimentally available in 17.5) so if you have the option of using the current LTS version of Node, you no longer even need node-fetch (as well as quite a few other packages that shimmed or polyfilled network fetching functionality).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants