Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: support for Koa 2.0 #25

Open
HowlingEverett opened this issue Oct 29, 2015 · 2 comments
Open

Feature: support for Koa 2.0 #25

HowlingEverett opened this issue Oct 29, 2015 · 2 comments

Comments

@HowlingEverett
Copy link
Contributor

Koa 2.0 is moving away from generator functions completely, which came as a bit of a surprise. The ultimate end-goal appears to be building the middleware around ES7 async/await. That works in the alpha.2 already when you run with babel, but in the interim it seems like tj is expecting package authors to switch from generator middleware functions to Promises.

A lot of middleware can be hacked into compatibility simply by calling co.wrap around the initialiser, but koa-handlebars is a bit more complex since it's augmenting the context with functions that other route handlers use.

I'm happy to help out with this once I get my head around the new API, since koa-handlebars is the only piece of middleware in my current project that isn't working with the koa 2.0 alpha yet.

@chrisveness
Copy link

With Node.js v7 arriving later this month, which has async/await implemented behind a --harmony flag, Koa v2 will be usable without Babel.

It would be great to see koa-handlebars have Koa v2 support (presumably published @next until async/await emerges from behind its flag).

@dominicbarnes
Copy link
Owner

I'd gladly accept a PR here, as I don't really maintain this much these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants