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

Idea: refactor Robyn & SubRouter #1071

Open
dave42w opened this issue Dec 4, 2024 · 0 comments
Open

Idea: refactor Robyn & SubRouter #1071

dave42w opened this issue Dec 4, 2024 · 0 comments

Comments

@dave42w
Copy link
Contributor

dave42w commented Dec 4, 2024

A couple of things bother me about Robyn and SubRouter.

First, this is a lot of code to have in init.py If 686 lines were the whole package then it makes sense But this is two large classes plus (somewhat randomly) the ALLOW_CORS function with loads more code not included in this file.

I'd like to move these out to other modules (which won't change the developer experience as we control that in init.py), robyn.py would be the obvious module name but it's not available. Maybe into robyn_classes or robyn_app

Also, I think we need a RobynBase as a common superclass for Robyn and SubRouter. This way we don't have things like start and inject_global as part of SubRouter where they absolutely should not be called. This gets us on the way to more cleanly nest subrouters to any depth.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant