-
Notifications
You must be signed in to change notification settings - Fork 405
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
fix: Render decorator for Koa Driver #1482
fix: Render decorator for Koa Driver #1482
Conversation
Unfortunately I’m not familiar with koa so I cannot review this. |
@attilaorosz Hey, thanks for replying! I can give more details:
I've already implemented this solution on my local version to confirm it works and the tests are also there to provide some insurance about it. |
@attilaorosz @NoNameProvided Hello! Can I get some feedback on this? It's a bit annoying to manually edit the file everytime I reinstall my modules so the feature can work as expected! haha Thanks! |
Sorry for the late response! |
@attilaorosz Hello and thanks for coming back to my PR! koaApp.context.render = async function (view: string, locals?: object) {
this.body = await nunjucksRenderPromise(view, locals);
this.status = 200;
return this;
}; Note: I've fixed the formatting. |
Without my PR, though, using |
Sounds good. Sorry, as I mentioned I'm not experienced with koa. I'm open to do this but then let's remove the koa-views dev dependency. |
@attilaorosz No worries, it's fine! I'll remove the dev dependency, indeed I missed it! Edit: It's done! |
Thanks for the contribution! |
@attilaorosz No problem, thanks for merging! Do you think it will be released soon? |
Releasing right now |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Fixes the
@Render
decorator when usingKoa
by hijacking thenext
function to ensure thectx.render
promise will be completed.Checklist
Update index.md
)develop
)npm run prettier:check
passesnpm run lint:check
passesFixes
fixes #1147, fixes #902, fixes #610, fixes #602