0s: "next generation web framework for node.js" (oh god, not another)<p>5s: "designed by the team behind Express" (wait what?)<p>6s: "Through leveraging generators Koa allows you to ditch callbacks" (wow, ok. oh hey, that makes "next generation" not just marketing fluff)<p>18s:<p><pre><code> app.use(function *(next){
var start = new Date;
yield next;
var ms = new Date - start;
this.set('X-Response-Time', ms + 'ms');
});
</code></pre>
(oh sweeet)
Does koa (or co) solve the problem with generators where<p>* stack traces of errors are useless? [1]<p>* missing catch filters/pattern matching i.e. catch (e) {} also captures type, reference and range errors i.e. "pokemon exception handling"?<p>[1]: <a href="http://spion.github.io/posts/analysis-generators-and-other-async-patterns-node.html#stack-trace-accuracy" rel="nofollow">http://spion.github.io/posts/analysis-generators-and-other-a...</a>
I have some questions about this:<p>1. The FAQ gives a political answer about the status of Express but I imagine that Express will not be actively maintained any more. Correct?<p>2. If focus is now on Koa, why the name change from Express when it is already a huge name for node frameworks?<p>3. If a new developer sees Express and Koa, would they immediately know which one is being focused on?<p>Basically I'm wondering why it couldn't be called Express 3.0 (or 4.0).
What's the star in "function *(){}" for ?<p>EDIT: Answer: that's how "generator functions" are recognized. <a href="http://wiki.ecmascript.org/doku.php?id=harmony:generators" rel="nofollow">http://wiki.ecmascript.org/doku.php?id=harmony:generators</a>
Which Nodejs Web framework is the most popular in production? There are so many choices: <a href="http://nodeframework.com/" rel="nofollow">http://nodeframework.com/</a><p>It seems Express and Connect? <a href="http://stackoverflow.com/questions/3809539/choosing-a-web-application-framework-using-node-js" rel="nofollow">http://stackoverflow.com/questions/3809539/choosing-a-web-ap...</a>
Not sure I understand the semantics. I'm passed what looks like a continuation, but instead of calling it, I yield it?<p>What other values can I yield, and why would I want to?<p>Alternatively, couldn't the `next` object just be a plain continuation?
It's funny -- I love node.js for pretty much everything <i>except</i> for web frameworks. IMO Express, Koa, Sails, and Meteor are all lacking some kind of <i>je ne sais quoi</i>... maybe I should try my hand at one as an open source project...? Anyone have any good resources about framework design?