-
Notifications
You must be signed in to change notification settings - Fork 875
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
Refactor ctx
#1177
Comments
@lidel I was actually thinking about this now and searched to see if there was an issue about it. And guess what: there is. I think the code needs improvements here and there and there are certainly a lot of things that can be improved. On my new PRs, I've been avoiding adding things to |
At the same time, we need to come up with a code layout that also avoid circular dependencies. |
I need to handle this in order to handle #1996 |
@hacdias im going to be adding typings via jsdoc to ctx, and making it import/require-able |
|
Is this issue resolved or still pending? |
Still pending. I have a PR WIP where I cleaned up quite a bit, but I haven't returned to it for a while. |
There is just one codebase that is run by one instance of the program at the time. Is it worth having a variable called
ctx
(context)? That'd certainly be more useful in HTTP (or any other protocol) handlers where each request is different.While working on #1175 I found it a bit annoying to have to pass
ctx
around because I needed one single variable.The idea is to remove
ctx
where possible and simply export the functions. Also, refactor the code so we don't have named and default exports on the same file as we do right now. That has been the cause for some bugs up until now.The text was updated successfully, but these errors were encountered: