koajs / kick-off-koa

[MAINTAINERS WANTED] An intro to koa via a set of self-guided workshops

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update to support Koa 3 version

batjko opened this issue · comments

For example, Exercise 1 still tells you to use app = koa() instead of the class-based notation (app = new Koa()).
And once you change this, koa tells you that generators are now deprecated and will be removed:

PS D:\koa-test1> node server
koa deprecated Support for generators will be removed in v3. See the documentation for examples of how to convert old middleware https://github.com/koajs/koa/blob/mas
ter/docs/migration.md server.js:6:5

I don't know when v3 comes out, but it seems this repo is already out of date for the current version, so it makes sense to go straight to v3.

I was about to log something similar when I saw you already did so... two years ago! I think it'd be great if the examples used the newer syntax of ``async (ctx, next) => { }withawait next()` rather than generator functions.

Not holding my breath, though. Doesn't look like there's much activity on this project. Otherwise, it was very helpful for getting up and running with Koa, mind you!

I think it'd be great if the examples used the newer syntax of ``async (ctx, next) => { } with await next()` rather than generator functions.

Agreed

I discovered that there is a pull request that does just that. Sadly, it's been waiting for approval since December. #58

I see that #58 has been merged but no release made. Can I help somehow to move it on?

While waiting for this to get published to npm, one could try installing from git as a workaround:
npm install git+https://github.com/koajs/kick-off-koa
(N.B. I installed kick-off-koa in a local directory and used npx kick-off-koa for running it, I don't think that's relevant here but just in case)