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

Add ctx.wrappers array #694

Closed
wants to merge 1 commit into from

Conversation

PlasmaPower
Copy link
Contributor

Goes along with koajs/compose#52.

@PlasmaPower
Copy link
Contributor Author

Copied from another conversation:

If we implement this, I'd be in favor of removing the deprecated generator to promise conversion in favor of koa-convert providing a wrapper to convert generators to promise-based middleware. I think that would be the more versatile approach, as some people might want to use generators with the new argument syntax until async/await arrives. The current approach would convert them as if they took ctx as this instead of an argument, and you'd have to extend the Koa Application to change that.

@jonathanong
Copy link
Member

also see koajs/compose#51

@jonathanong jonathanong changed the base branch from v2.x to master February 25, 2017 06:27
@codecov
Copy link

codecov bot commented Mar 8, 2017

Codecov Report

Merging #694 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #694   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines         431    432    +1     
  Branches      103    103           
=====================================
+ Hits          431    432    +1
Impacted Files Coverage Δ
lib/application.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ebed04f...3529d0b. Read the comment docs.

@jonathanong
Copy link
Member

would really love more people to express their opinions, otherwise, I'm inclined to just merge it!

@PlasmaPower
Copy link
Contributor Author

This and #707 preform the same purpose different ways, so only one should be merged. Do you prefer this one?

@miwnwski
Copy link
Member

miwnwski commented Jul 2, 2022

I'll just close this as it has little relevance today IMO. Maybe there's still a need for wrappers but I doubt it personally and the same functionality can be approached in user land. Also, over the years I haven't really seen any requests for wrappers. If I remember correctly, this was brought to light due to TJ's original issue to simplify mw profiling, though today this can be solved with async_hooks which seems more like native approach Koa should aim towards. Please reopen if I'm wrong :)

@miwnwski miwnwski closed this Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants