News for hackers. Stuff that matters.
Re:Fetch API has landed into Node.js by inglor on Tuesday February 01, 2022 @08:54AM (#30162370)
The commit adds undici (another Node.js project at 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 and in https://docs.google.com/document/d/1tn_-0S_FG_sla81wFohi8Sc8... a discussion from 2018 we had on it

Re:Fetch API has landed into Node.js by staticelf on Tuesday February 01, 2022 @09:02AM (#30162482)
Ok 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!

Re:Fetch API has landed into Node.js by ilkkao on Tuesday February 01, 2022 @01:08PM (#30166568)
I 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.

Re:Fetch API has landed into Node.js by Narretz on Tuesday February 01, 2022 @10:21AM (#30163649)
To 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.