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
undici collaboration #1247
Comments
I've made some similar attempts in regards to https://github.com/github/fetch. |
I think a blocker here is node 16+ requirement of undici |
Some form of collaboration with undici would be cool. The node 16+ would be a blocker doe. might just as well push for implementing undici into node core instead. and let undici and node-fetch takes it corse to become obsolete in the feature?
When whatwg streams landed in nodejs we shifted the focus from being a tiny bit lightweight and having some few node specific feature. To be more strict/spec compatible. So whatever code you write can for sure be used with Browser, Deno, node's core fetch, undici and node-fetch That have lead to:
Much less so now when whatwg streams landed in NodeJS, Now we are more strict.
This is our goal to be spec compatible and more cross compatible with other fetch implementations in other environments. My impression of undici is that you still lack support for FormData and Blobs still? I haven't used or taken a look at your repo for a while. |
We are just about to land support for formdata (Pr is open). Blob support has already landed. |
Ok, it wasn't the last time i checked. |
Whether fetch does get implemented Node.js or more strictly in undici, the goal of node-fetch would change to backporting it to the oldest Node version still in maintenance until that becomes one that doesn't require a ponyfill. At that point, if the community still relied on the now-legacy streams and buffers, then node-fetch may want to backport that too like suggested above. |
Yup, node-fetch would be more of a polyfill instead. until it's no longer needed |
Sounds reasonable. Just wanted to reach out and see if there was anything we can do. Feel free to close this. |
if you break out some stuff to separate packages that can be shared across node-fetch and undici (and is still compatible with node v12.20) then we could use the same stuff. Would be grate to agree upon some packages so there isn't duplicated code for two similar things |
@ronag the kind of collaboration i would like to have now is for the smaller core pieces that builds up fetch for what it's today to be shipped to NodeJS core first I'm talking about
This 3 could be considerable easy to ship to nodes core first, without having any logic associated to the fetch specification at all. it can also be easliy sharable between node-fetch and undici We would like to slowly but safely remove bits and pieces one bit at the time so we can depend on core features instead. would be nice to be able to stop depending on fetch-blob and formdata-polyfill for example... |
We are currently working with implementing fetch in https://github.com/nodejs/undici which is being considered for inclusion in Node core.
I was hoping that maybe we could combine some of our efforts with node-fetch. We are already using some of the tests from node-fetch (thank you and we have of course added reference and LICENSE from node-fetch).
undici is looking for what I believe is a more strict interpretation of the spec at the cost of ergonomics. I was thinking about whether it would be an idea to suggest whether node-fetch would consider using undici/fetch as it's base implementation while providing a more node friendly interface? e.g. support for more
FormData
,Headers
,Blob
,File
implementations, better node stream support etc... while keeping the fetch spec parts in undici?The text was updated successfully, but these errors were encountered: