8 ms·
Exploring competitive features in Node.js v18 and v19
- idontwantthis 4y agoDoes the test library have full mocking support?
- Waterluvian 4y agoMy initial reaction is: We’re supposed to be thrilled about a years old API finally landing in Node? A built-in test system when there’s so many great choices by not being batteries included? A standard update to catch up to the latest Chromium? Other than the fourth point (yay a better watch mechanism!) this actually persuaded me to think that maybe Node is stale. Well… not stale. Stable. Maybe at my ripe old age of 36 I’m a curmudgeon, but I think it’s fine to just focus on maintenance mode and following the browser for API and feature guidance.
- beeandapenguin 4y agoThat’s the thing. I think Node is struggling to keep up with pace of web platform standards.
- Waterluvian 4y agoIt does feel like that. I’m rather surprised to learn that Fetch is landing now?
- beeandapenguin 4y agoYea for real. I’m sure there’s tons of reasons why it took so long, there’s gotta be some devil in the details. Maybe the standards compliance, complexity of the code base, something something “ecosystem”, all the above… Feels like a similar situation to CJS/ESM, which is still a headache in Node regardless of its support
- christophilus 4y agoI'm 100% in favor of being able to do more things with fewer dependencies, so yes. I think having watch, test, and fetch built in are great.
- llanowarelves 4y agoI agree. I am glad Node is getting there despite dragging its feet. The DX with all the package boilerplate is atrocious compared to what it could be. Even if Deno, Bun etc were to fizzle out, I am glad they exist to show the way and put pressure on Nodejs at bare minimum.
- satvikpendem 4y ago> Even if Deno, Bun etc were to fizzle out, I am glad they exist to show the way and put pressure on Nodejs at bare minimum. This is how I felt about io.js back in the day too, and about vim versus neovim; competitive pressure works.
- Etheryte 4y agoThis is a slight misnomer in my opinion. When those dependencies are bundled into Node you have fewer listed dependencies, yes, but you haven't actually reduced the amount of external code you rely on.
- christophilus 4y agoYou have a single vendor to worry about— like Microsoft when you use .NET, Google when you use Go, etc. You obviously will always have external dependencies unless you build everything from your own hardware up. But it’s clearly a win to vet and trust one vendor, and have one solid, trusted platform to build on vs pulling in literally thousands of dependencies from random vendors as is common in most JS stacks.
- Etheryte 4y agoThat's a fair point. Currently I'm not convinced all of this is the right direction for Node, but we'll see how it pans out. Node is already huge so I would much rather they pick their battles and do those features well, rather than try and be mediocre at everything.
- throwaway0asd 4y agoTest runners have been super requested lately in the Node GitHub issues. I have not understood why that is because writing a test running of your own is trivial.
- rpep 4y agoIt’s trivial but not useful when good solutions already exist
- nsonha 4y agoNo it’s very not, show us your trivially written test runner
- hinkley 4y agoAnd then the terrible tests you wrote for your terrible runner. The bookkeeping isn’t hard, but the matchers and the lifecycle bits get tricky.
- winrid 4y agoI love how they make it sound like Node/v8 gets faster every release. That's not the always the case, remember to benchmark! :p https://user-images.githubusercontent.com/3397140/86506040-a99ef880-bdcb-11ea-9758-6c8fd340ade0.png https://user-images.githubusercontent.com/3397140/86506040-a...
- throwaway0asd 4y agohttps://github.com/nodejs/node/issues/44186 https://github.com/nodejs/node/issues/44186
- wdb 4y agoIt’s a shame ESM gets forced through your throat these days
- hinkley 4y agoI don’t think I’ve gotten free performance since Node 12. There’s a little juice in Node 16 for async code and certain class patterns but those are mostly avoiding penalties, not getting new benefits.
- Alifatisk 4y ago”Competetive features”
- hliyan 4y agoGood. A reduction in dependencies and tooling. Once matured, no more: isomorphic fetch, pkg, nodemon, mocha/jest. Now if we can do the same for webpack and typescript, that would be great. There must come a day when a developer can bootstrap a reasonably sized Node project with just the built in tooling.
- christophilus 4y agoThis is why I’m excited about Bun. I’ve built a handful of 0-dependency utility web apps (internal company tooling) with it. It’s early days, but it’s already quite good.
- satvikpendem 4y agoDeno does this by default, plus you can use npm packages in Deno as well. It also has a compile option that turns the entire project into a binary you can deploy, which is great to not have to ship source files and run them with Node as is usually the case. For the frontend, Vite works well, and NextJS if you're using React in particular.
- Katie69 4y ago[dead]
- singularity2001 4y agoimport test from 'node:test'; ^^^^^^ Uncaught: SyntaxError: Cannot use import statement inside the Node.js REPL, alternatively use dynamic import import test from 'node:test'; ^^^^^^ SyntaxError: Cannot use import statement outside a module import test from 'node:test'; ^^^^^^ error: Unsupported scheme "node" for module "node:test". This whole import / require / ... debacle is what drives me away from JS the most
- spartanatreyu 4y agoYou'd probably like deno... It's typescript, web standards only (no require, top-level-await, no module messaround), and built-in test runner from the start.
- ilaksh 4y agoThe snapshot feature seems really interesting.
- nsonha 4y agoThis watch thing seems pretty simplistic, does it just watch the entry point? A directory? The default should be watch all files in dependency graph.
- nl 4y agoDependency graphs in the JS ecosystem are notoriously large. I certainly wouldn't want this because of the huge number of dependencies. Watching a src directory is usually the way to go.