Earlier quoted context omitted.
Has it ever occurred to you that your users can (a) see all requests you make to third party services, including your credentials and client secrets, (b) modify and replay those requests at will and (c) spoof responses from those services?
I think the misunderstanding is, beyond special cases like a payment processing, why would you be calling third party services from your service? When I think of calling a 3rd party HTTP API, I am thinking of public APIs, like say a widget that shows the weather in a users area.
Fetch API has landed into Node.js
161–170 of 210 posts
Re: Fetch API has landed into Node.js
#162Re: Fetch API has landed into Node.js
#163Earlier quoted context omitted.
Because fetch just landed in Node.js, making it a standard present in every context after like 5 years and he want to change the standard now. Edit: also, you are being downvoted because the etiquette on HN are that you don't ask "why was X downvoted".
As mentioned existing HTTP clients had this behaviour back in 2012, the designers of fetch chose to ignore these cowpaths in favour of a more minimal implementation requiring the use of third party HTTP clients in both browsers and node, simply to have reasonable defaults and not repeat oneself, for the foreseeable future.
Re: Fetch API has landed into Node.js
#164Wow I can't believe how light years ahead Deno is than Node. You want imports you want fetch you want TS, use Deno.
Re: Fetch API has landed into Node.js
#165Earlier quoted context omitted.
First: not a stupid question - the release cadence, multiple release lines and other minutia of a project like Node are not something I'd expect users to be intimately familiar with! This _just landed today_. You can get it by building from master: ``` # there is more details in building.md git clone https://github.com/nodejs/node cd node # may need to pass --openssl-no-asm ./configure make -j12 ./out/Release/node --…
Just slightly related to this - I wish I could ask GitHub to send me an email when specific release are available for the repo!
Re: Fetch API has landed into Node.js
#166Earlier quoted context omitted.
Those have been supported for several years now :) You need to tell Node to use the format by either naming your file `.mjs` or setting `"type": "module"` in your `package.json` file. > Also why do so many libraries have this strange 5 line header code for this umd, amd, business. Is that to make their packages work with nodejs? That's just old for "adapt the module system" from the old days and libraries just didn't…
"supported" is somewhat of a misnomer IMHO. It's only supported if the other tools you're using support ESM. Otherwise, it's not. And it's really annoying when libraries choose to go full ESM because it breaks things like tests and deployments in weird ways. It's a pain in the ass.
Re: Fetch API has landed into Node.js
#167Hey, Node core person here (and the person who triggered the land) - we're super excited for this and would love help and feedback. This is still experimental and we'd love to hear from the community what you'd like to see.
Re: Fetch API has landed into Node.js
#168Wow I can't believe how light years ahead Deno is than Node. You want imports you want fetch you want TS, use Deno.
Re: Fetch API has landed into Node.js
#169Re: Fetch API has landed into Node.js
#170Earlier quoted context omitted.
Fetch is a web JS API to do HTTP requests. NodeJS has its own API to do HTTP requests. This add supports for the fetch API. I think the only benefit it that it makes it easier to share code between front end and back end.
This is an understatement. With fetch available in node, we have a single, standardised, promise-based HTTP client Interface available on all (more or less common) JavaScript platforms. This is great news for an ecosystem traditionally extremely fragmented and may lead the way to more consolidation in the JS library space.
It's a great news for people doing both front end and backend I guess, but for people doing NodeJS développement it's just one more option to do http request (which I guess is going to be very similar to the module node-fetch that have existed for a while, without special consolidation effect)