Koa – Next generation web framework for Node.js
koajs.com
koajs.com
> Koa is old
9 years since 1.0, so sure, that's "old" by some definition. That said, I've been hoping we can get past that definition now that JS-the-language stopped iterating as quickly.
> but somehow it never gained enough traction. ... look at Bun or Deno frameworks like ElysiaJS or Hono.
Elysia has 45k downloads a week and Hono has 460k, but it's Koa at 2.5m downloads a week that never gained enough traction?
Koa never managed to unseat Express because the average Node developer is sick of framework churn and wants to just build stuff. The even-newer frameworks aren't somehow more likely to do so than Koa was.
> From a technical standpoint, Koa was all about composing middleware and using JS generators. I don't think that's relevant anymore.
Can you elaborate? What's the new, 'relevant' technical foundation for an HTTP server library?
That said, I also honestly don't know what specifically we're talking about here—I've used Koa on a few small projects and never used a generator for it. I landed on it because it has first-class support for async. Maybe there are generators used under the hood?
I didn't bother questioning the generators in the first post not because I knew what they were referring to but because the main thrust to my question remains either way: what's the new technical foundation that Koa is supposedly lacking, and why must every JS framework use the latest hotness?
Koa supports async and otherwise feels very much like express. That has been plenty good for me.
Edit: Google turns up no references to generators whatsoever on the koajs.com pages, so I'm not at all sure what OP was talking about. But again—I'm less concerned about whether they got the details of the implementation correct than I am about the idea that JS frameworks need to be swapped out constantly to stay relevant.
WRT frameworks, I think that good frameworks have a staying power: see Spring Boot, Django, Rails, and, well, Express.
When a language evolves as quickly as JS/TS has been past 10 years, fundamentally better ways to do things spring up relatively often. They may be adopted by existing frameworks, or give rise to completely new, legacy-free ones. Sadly, the "legacy-free" tag very often comes with the "nor battle-tested, here be dragons" tag.
I did find this video that covers an early version of Koa. https://youtu.be/RVxx2T7SPw8
> An introduction to the Koa web framework for Node.js and some of the technologies behind it. Covers ES6 generators, promises and TJ Hollowaychuk's Co library.
Koa is awesome.
Here is a post from 2013 explaining how Koa eliminates callbacks with yields.
https://blog.stevensanderson.com/2013/12/21/experiments-with...
They am even removing generators in v3
IMH, the upside is that it's a light abstraction of the node's HTTP request. All extensions are provided in different packages (unlike express).
The downside is that you need to set up the basics (like routers[0]) that are out-of-the-box.
So every new "next generation" that pops up really needs to be an incredible next generation to matter.