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

Koa 2 support #4

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Koa 2 support #4

wants to merge 8 commits into from

Conversation

jordaaash
Copy link
Collaborator

@jordaaash jordaaash commented Sep 6, 2017

I updated everything to use Koa 2's (ctx, next) => middleware signature.

  1. Replaced all generators with async/await
  2. Changed this refs to context and fixed args accordingly
  3. Replaced var with let/const as needed
  4. Removed extends.js (use native Object.assign)
  5. Removed co-mocha (mocha has support for async/await)
  6. Updated all dependencies
  7. Updated all tests (changes above, and popsicle API changed)
  8. Updated TravisCI Node versions
  9. Added a yarn.lock file
  10. Added engines to package.json (async/await requires >= 7.6.0)
  11. Updated to version 2.0.0 (I can remove this and rebase before any merge)

@coveralls
Copy link

coveralls commented Sep 6, 2017

Coverage Status

Coverage decreased (-2.5%) to 87.5% when pulling 61597fc on jordansexton:koa-2 into b39f76f on blakeembrey:master.

@blakeembrey
Copy link
Owner

@jordansexton I don't really use Koa anymore in my own projects. Did you want to take over this module at all? I'm happy to give you access on GitHub and NPM 😄

@jordaaash
Copy link
Collaborator Author

Sure, thanks! We use this in production, so I'm happy to help maintain as long at least as that's the case.

@jordaaash
Copy link
Collaborator Author

What are you working with now, out of curiosity?

@blakeembrey
Copy link
Owner

blakeembrey commented Sep 6, 2017

Most people want Express.js used in the project, but in personal projects I've been using https://github.com/serviejs (inspired partially by Koa) because it works seamlessly on any environment (I'm focusing on AWS lambda) and for front-end/back-end (client request libraries can use exactly the same interface - it's partially inspired by my work with Popsicle and will eventually make it's way back there too).

I've added you on GitHub and NPM now, it's all yours 😄

Edit: Let me know if there's any issues though.

@blakeembrey
Copy link
Owner

On a side note also, just be aware that path-to-regexp 2.0 currently has no support for the "asterisk" pattern ('/*'). It's easily worked around and shouldn't be used too often (you would usually want .use instead), but just wanted to make sure you saw that change.

@jordaaash
Copy link
Collaborator Author

Thank you! I'll check over this PR again before publishing. I didn't know that about the lack of wildcard support.

@jordaaash
Copy link
Collaborator Author

And servie looks cool. I haven't seen this yet, I'll check it out.

koa-router has some longstanding issues that haven't been fixed in their koa 2/node 7 branch with path prefixes, layering mounted routers, etc.

My best options looked to be to continue to use kroute, or try one of the trie-based routers, but the ones with koa integration don't seem well-maintained, so I decided to update things here for now.

@blakeembrey
Copy link
Owner

@jordansexton Feel free to merge and release whenever you want to. I can also transfer the github repo to you entirely, if you'd prefer 😄

@jordaaash
Copy link
Collaborator Author

Thanks for the ping! It's not a problem that it's here, I've just been busy with work. I hope to be able to have time to address this soon. I just didn't want to merge and release if an issue arose that I wouldn't be able to troubleshoot quickly!

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

Successfully merging this pull request may close these issues.

None yet

3 participants