feat: add Koa2 support#117
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
CLA signed. |
|
CLAs look good, thanks! |
|
Awesome. Thanks for contributing this. I think it looks good, but I need to think more about whether there should be separate |
|
@DominicKramer that’s fair, and it should be possible to support both by doing an argument count. I can go ahead and update this, but I’m also curious, do you know why the koa1 tests aren’t failing right now? |
|
Thank you for looking into how to support Koa 1 and 2 together. It looks like there isn't a koa interface unit test. This is something that I will need to create. |
|
Hey @DominicKramer - I changed this to work with both koa1 and koa2. I did escape the type system a bit with some |
|
@mike-marcacci Thanks for working on this. It looks really good. I will take care of updating the types for you. Thanks. |
|
Awesome! Thanks so much @DominicKramer. I did also want to reiterate my note from the original PR: I'm pretty sure the "system-tests" aren't actually being run, at least locally with |
|
@mike-marcacci Sorry, I missed your "system tests" comment. It is expected that the system tests are not run with |
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
|
CLAs look good, thanks! |
|
🤦🏻♂️ I guess I should have read the package.json. Also it looks like I inadvertently pulled in some greenkeeper commits and broke the CLA googlebot, so I rebased and forced-pushed. |
|
No worries. |
The Koa middleware has been updated to return an object that is both a Promise and Iterator, supporting both Koa 1.x and 2.x
| } | ||
| }; | ||
| } | ||
| } No newline at end of file |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @@ -0,0 +1,69 @@ | |||
| /** | |||
| * Copyright 2016 Google Inc. All Rights Reserved. | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Fixes #8
1 I added tests to "system-tests", which I didn't get running locally. Also, the existing koa test should be failing, given that the code targets koa@1 while it depends on koa@2. I assume these aren't used?
2 Docs for all middleware are missing from
README.md, so I didn't add any, andREADME_OLD.mdis clearly "old".