4 ms·
I love you Express, but my next project is going to be based on TJ's own Express successor: http://koajs.com/ http://koajs.com/
by nailer 13y ago
I love you Express, but my next project is going to be based on TJ's own Express successor: http://koajs.com/ http://koajs.com/
- alessioalex 13y agoThat's not a successor, it's a different framework based on generators. It's not as if it was Express 5.x or something.
- benesch 13y agoFrom the Koa homepage: > Koa is a new web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation I think he meant successor in the spiritual sense, which is undeniably true.
- ulisesrmzroche 13y agoIt's going to be an even bigger hit than express, for sure.
- nailer 13y agoI've been playing with 'Co', the thunk / flow control framework TJ uses for Koa: #!/usr/bin/env node --harmony var fs = require('fs'), co = require('co'), thunkify = require('thunkify'), request = require('request'), readFile = thunkify(fs.readFile); get = thunkify(request.get); var log = console.log.bind(console); // Create a thunk, and run it immediately. co(function *(){ try { var fileContents = yield readFile('myfile', 'utf8'); log(fileContents); var yahoo = (yield get('http://yahoo.com'))[0]; log(yahoo.statusCode) } catch(error) { log('Oh no, an error!') log(error.code) } })() Async, inline, catching errors. It's nice.
- ulisesrmzroche 13y agoYeah, once you start using yield it's really hard to write JS without it. It's nice to get that keyword back. You can start throwing that on mocha too, it's pretty sweet.
- btd 13y agoIt is nightmare for v8 jit.
- andreypopp 13y agoWho needs JIT on I/O bound tasks?
- coldtea 13y agoAny links for that?
- btd 13y agov8 does not optimize blocks inside try catch (not too fresh http://www.html5rocks.com/en/tutorials/speed/v8/ http://www.html5rocks.com/en/tutorials/speed/v8/) and about generators and optimizations (http://wingolog.org/archives/2013/06/11/ecmascript-generators-from-a-performance-perspective http://wingolog.org/archives/2013/06/11/ecmascript-generator...)
- lttlrck 13y agoit's a nightmare for crankshaft.
- btd 13y agoYes, you are right. I forgot how they call own optimizer. (i wanted to point that people do not repeat blindly that peace of code)
- romanovcode 13y agoDon't forget to switch when next framework arrives. You don't want to be one of those unpopular geek losers, right?
- LunaSea 13y agoYeah you'd rather want to be the aggressive inpertinent kind.
- jaegerpicker 13y agoYes because we should never switch to something we think is better right? I mean advances who needs or wants that?
- ulisesrmzroche 13y agoNo, but so far I've been using koa, it's really worth making the switch.
- prezjordan 13y agoKoa, if anything, will actually replace connect[1], which is the middleware layer that express is built on top of. And yes, TJ built that too. [1]: https://github.com/senchalabs/connect https://github.com/senchalabs/connect EDIT: Looks like Express doesn't use Connect anymore. I'm out of the loop.
- ulisesrmzroche 13y agoYeah, also, Koa has a lot of express sugar baked-in, express turned into sugar on top of connect, then left connect behind and so on that koa is actually really removed from connect.