News for hackers. Stuff that matters.
Re:Modern Node.js Patterns by farkin88 on Sunday August 03, 2025 @06:09PM (#44780275)
Yeah, that's the classic bundle size vs DX trade-off. Fetch definitely requires more boilerplate. The manual response.ok check and double await is annoying. For Lambda where I'm optimizing for cold starts, I'll deal with it, but for regular app dev where bundle size matters less, axios's cleaner API probably wins for me.
Re:Modern Node.js Patterns by hn_throwaway_99 on Sunday August 03, 2025 @08:30PM (#44781075)
Agreed, but I think that in every project I've done I've put at least a minimal wrapper function around axios or fetch - so adding a teeny bit more to make fetch nicer feels like tomayto-tomahto to me.
Re:Modern Node.js Patterns by jedwards1211 on Sunday August 03, 2025 @11:30PM (#44781902)
You’re shooting yourself in the foot if you put naked fetch calls all over the place in your own client SDK though. Or at least going to extra trouble for no benefit
Re:Modern Node.js Patterns by Tokumei-no-hito on Monday August 04, 2025 @09:10PM (#44793252)
why don't they just set those as options

{ throwNotOk, parseJson }

they know that's 99% of fetch calls, i do t see why it can't be baked in.