3 ms·
The commit adds undici (another Node.js project at https://github.com/nodejs/undici https://github.com/nodejs/undici ) as a dependency and exposes its `fetch` -
by inglor 5y ago
The commit adds undici (another Node.js project at https://github.com/nodejs/undici https://github.com/nodejs/undici ) as a dependency and exposes its `fetch` - the code changes you see are probably just adding a flag :)
> I just wonder how come features like this that kind of seems obvious to include in the ecosystem takes quite some time to land?
I answered that below (check it out) but note how expensive adding a bad API is vs. asking people for one more `npm install` :) There is more discussion in https://github.com/nodejs/node/issues/19393 https://github.com/nodejs/node/issues/19393 and in https://docs.google.com/document/d/1tn_-0S_FG_sla81wFohi8Sc8YI5PJiTopEzSA7UaLKM/edit?usp=sharing https://docs.google.com/document/d/1tn_-0S_FG_sla81wFohi8Sc8... a discussion from 2018 we had on it
- staticelf 5y agoOk cool and thanks for the clarification, I imagined it was more to the topic than I realized. Last question I have is will this be included in the next version of the LTS version or how do experimental features usually progress for someone who are unfamiliar? Can't wait until I can use fetch in my codebase without any additional dependencies!
- Narretz 5y agoTo add, unidici is an http client. Node already has http / https, but unidici is much faster and probably has other improvements, too. They could have built a fetch interface on top of http, but they probably saw an opportunity to make more drastic improvements.
- ilkkao 5y agoI had a quick look, the implementation is interesting Node uses undici JS library. Undici includes a C HTTP parser that is used via webassembly. The parser is generated from rules that are implemented in JS/TS using llparse framework. A native C binary there in the middle is quite surprising.