koajs / examples

Example Koa apps
4.52k stars 744 forks source link

Init project for koa2 #99

Closed bananaappletw closed 7 years ago

bananaappletw commented 7 years ago

There are still many problems of migration to koa2. Some modules doesn't work without using ES6 import syntax, Ex: https://github.com/koajs/csrf. The should.js version of this repo is very old. But the current should.js is not stable enough to upgrade. So, I only migrate examples which run without errors.

hemanth commented 7 years ago

Nice to see the 99 PR being a nice refactor, these being a decent amount of breaking changes would need sometime for a detailed review, more over we could create another branch for v2 and link it in the docs till it looks good.

bananaappletw commented 7 years ago

@hemanth Actually, this is @coderhaoxin 's idea. Since the current koajs/koa default branch is koa2. The examples project should be koa2, too. For koa1, already created https://github.com/koajs/examples/tree/koa-v1 branch We could try to migrate examples step by step on master branch. Then more people could help to migrate examples.

haoxins commented 7 years ago

@bananaappletw great work !

Since the current koajs/koa default branch is koa2. The examples project should be koa2, too.

Agreed :)

bananaappletw commented 7 years ago

@hemanth @coderhaoxin Any update?

hemanth commented 7 years ago

I would give a 👍

haoxins commented 7 years ago

@bananaappletw great works! But can you finish most migrations in this PR ?

I don't think it's a good idea to remove most examples, and add them back later >_<.

Maybe we can also just keep koa@1 examples in a short time. cc @hemanth advices ?

hemanth commented 7 years ago

But can you finish most migrations in this PR ?

Yes, that was the initial thought.

bananaappletw commented 7 years ago

@coderhaoxin @hemanth Thanks for review. I will do the most migration, if they could be migrated. Because there some examples which doesn't have relative package of koa2 to implement same functionality of previous examples. Maybe combine koa1 and koa2 examples together until koa1 could be migrate to koa2? Note in README.md which examples are not migrated yet? What do you think?

bananaappletw commented 7 years ago

@coderhaoxin @hemanth I need some time to migrate it@@ After some migration work, I will send another pull request.

bananaappletw commented 7 years ago

@coderhaoxin @hemanth I suggest just remove koa1 examples and note on README.MD those examples are not migrated yet. Then this repo doesn't need to handle for different syntax (generator). Other people could also help to migrate those examples.

bananaappletw commented 7 years ago

@coderhaoxin @hemanth Any feedback? I think this is the compromise way for current situation.

haoxins commented 7 years ago

I suggest just remove koa1 examples and note on README.MD those examples are not migrated yet.

+1 👍