9 ms·
Node.js 20 is now available
- Already__Taken 4y agoThe "Don't talk about deno" release. Quite an interesting feature list. I'm really interested if wasi + a permission prescription + package authorization might allow us sharable cli tools like git hooks and filters that we can trust.
- ShadowBanThis01 4y agoWhy are you referring to it as that?
- joshxyz 4y agobecause one of deno's key selling points is restrictions on permissions, on what can a running script do to its environment.
- scorxn 4y agodeno's built-in test runner is also a big selling point for me, and Node.js 20 is declaring theirs (node:test) to be stable.
- qbasic_forever 4y agoThe big new feature is a sandboxing with explicit CLI flag opt in to permissions, exactly like deno pioneered. Except there's zero mention of deno as a clear inspiration of the feature.
- xeromal 4y agoKind of reminds me of deno's support for package.json after realizing they needed the features.
- mark_and_sweep 4y agoNot needed at all. In fact, I've never used and will never use a package.json in any of my Deno projects. They added the feature to "enabl[e] developers to transition from existing Node projects with ease." https://deno.com/blog/v1.31#packagejson-support https://deno.com/blog/v1.31#packagejson-support
- ShadowBanThis01 4y agoI don't understand that description, but I'll take your word for it.
- whostolemyhat 4y agoYeah, not sure why a release note would mention a competitor?
- re-thc 4y agoIsn't Deno a dinosaur? I thought it's ancient!
- omneity 4y agoLove this. I wonder if we'll eventually have a new merge à la io.js/node.js Deno and Node are converging more and more on every release, such a deja vu. The main difference being that deno offers much more as a business than just the "deno" product itself, so an eventual merge wouldn't be so trivial. Denode or Nodeno? Who wants to place bets?
- capableweb 4y agoI sure hope not. NodeJS is a FOSS project under the Linux foundation (via OpenJS) and is not driven by profit, while Deno is developed by a for-profit company (Deno Land Inc) which has bunch of closed sourced projects to fund the company. Hopefully, NodeJS learned from the whole Npm Inc history and tries to remain more independent from for-profit companies. The whole io.js thing was a very different thing than Deno. Contributors tired of slow pace of NodeJS forked NodeJS into another FOSS version, with no for-profit motives, which meant it could eventually be merged back once the people behind the two projects reconciled.
- throw_m239339 4y ago> Hopefully, NodeJS learned from the whole Npm Inc history and tries to remain more independent from for-profit companies. This. Microsoft owns NPM so it basically owns Node.js ecosystem.
- omneity 4y agoVery good points. Deno is first and foremost a cloud business who happens to offer a Javascript runtime of its own making. It made us see a world where javascript can be (much more) secure and typed without a compilation step, and this is an important contribution I would like to still acknowledge. Now the fact that NodeJS is learning from Deno and making strides to support capabilities (are you related? lol) is extremely exciting to me and it will surely improve the state of the Javascript/Typescript ecosystem and pull along a lot of projects/devs who would never have moved to something like this purely due to inertia and dev cost. One can dream.
- Defletter 4y ago
- icpmacdo 4y agoWhat is the standard web application backend framework for Node.js these days, is it Koa? As I understand it express is quite dated because of the callback structure. I have been confused recently with the moving best practices. What is the server architecture Next.js is most often plugged into?
- greenbeard 4y agoExpress is still fine to use. To me it's either express or fastify. A lot of opinions in the JS world.
- super256 4y agoThis. Fastify is so great. Unfortunately, the documentation became worse after v2 because Matteo was too laissez-faire in approving new doc contributions. Imo the docs need a major re-write, beginning at "getting started". New users don't know whether they should use "fastify-cli gen", "npm init fastify" or copy manually from the "getting started"-guide. And people also tried to push their fastify-plugins to the top of the plugins-site by adding a "@username" for every plugin: https://i.imgur.com/hHyI6JO.png https://i.imgur.com/hHyI6JO.png (left are the old docs, right are the current docs where ppl try to game the system). Also, fastify-cli needs to rework the custom options in typescript projects imo. Ok, that's all. Other than that, fastify rocks!
- sideproject 4y agoI've used this - https://adonisjs.com/ https://adonisjs.com/ - I don't think it's "standard". Is there such a thing? I guess Express was a de-facto standard. I'm a bit biased since I come from Laravel background, so adonis feels familiar.
- tannhaeuser 4y agoExpress (fka Connect) is standard in the sense that the "middleware" API design was/is part of the CommonJs server-side JavaScript (SSJS) initiative [1] from which Node.js originated and insofar as you can write a middleware that plugs into Node.js' core http API and express.js at the same time since these invoke your code using the same basic callback, which was deemed desirable for portability back when Node.js wasn't the only SSJS framework around. Express/connect draws inspiration from Ruby's Sinatra/Rack and Python's WSGI, and is based on JSGI/JackJs. [1]: https://wiki.commonjs.org https://wiki.commonjs.org
- deleted 4y ago[deleted]
- hardwaresofton 4y agoWith testing built into core, I’m looking forward to the reduction in complexity and number of external testing frameworks. I generally chose tape/ava in the past and vitest these days, but it’s awesome that now a very simple testing mechanism is available in core
- silverwind 4y agoA shame it's not using `expect` syntax, which recently was also adopted by bun.
- hardwaresofton 4y agoWell I'm sure they knew about it -- maybe there's an impassioned debate on a GH Issue/Discussion somewhere on why they left it out. The refactoring of expect to a reusable library (that hopefully everyone could depend on) would be awesome as well. AFAIK there are multiple expect() implementations out there right now, would be nice if there was one.
- silverwind 4y agoYes, a standardized expect would be nice, but care has to be taken to not bloat it. Currently I use vitest and https://github.com/jest-community/jest-extended https://github.com/jest-community/jest-extended which gets you a reasonable amount of usable matchers.
- bitwize 4y agoexpect(me).to.barf.when(i.see(shit.like(this)));
- jitl 4y agoIt’s great for tab completion and can be very smart about types, and newer ones like jest don’t have excessive chaining style. Less bad than it used to be
- skwixusu 4y agoTesting, and now permissions might hit LTS in October! The velocity of dev while maintaining an arguably stable API after over a decade now is just admirable.
- kszyh 4y agoThey are so rushed with the numbering, I wonder when they will change to that relative to the year. After all, in a few years there will be a Node 50
- nailer 4y agoIt's semver. New major even number means a stable release with significant breaking changes.