Git Product home page Git Product logo

Comments (6)

simov avatar simov commented on April 28, 2024

Last time I checked Grant was working fine with Koa2. Check out my comment here.

I know that support for generators will be dropped in Koa3 so I think that would be a breaking change here as well. Using async/await functions for your Koa routes shouldn't be a problem, it's just that Grant is going to use a generator function for its routes.

I'm usually fairly quick to respond and apply a patch if needed so you just have to let me know if something isn't working.

from grant.

 avatar commented on April 28, 2024

mm, sorry, i'm not aware of any Koa3, did i miss something?

AFAIK, current version is v1 and it uses generators.
Next version is v2 and will be released (pretty soon) when Node will natively support async/await.
v2 does not allow generators middleware, everything should be async/await.

So when v2 released, will you support both versions or would async/await version replace generators one?

Thanks.

from grant.

simov avatar simov commented on April 28, 2024

Check out this section:

Old signature middleware (v1.x) support will be removed in v3

Koa v2.x will try to convert legacy signature, generator middleware on app.use, using koa-convert. It is however recommended that you choose to migrate all v1.x middleware as soon as possible.

From my prevous comment:

7a7e10c works for both Koa1.x and Koa2.x. For Koa2.x you have to update the koa-mount module to v2.x as well.

Again:

Grant currently works with both Koa1 and Koa2, however it won't work with Koa3 out of the box.

Let me know if something isn't working for you with Koa2.

from grant.

 avatar commented on April 28, 2024

thanks for patience :)
will give it another try and reply with results

from grant.

 avatar commented on April 28, 2024

works perfect!
was cooking it wrong.
thank you.

from grant.

simov avatar simov commented on April 28, 2024

No problem, thanks for the feedback!

from grant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.