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

Standardize how middleware implementations will be distributed #253

Open
whitfin opened this issue Jul 15, 2018 · 1 comment
Open

Standardize how middleware implementations will be distributed #253

whitfin opened this issue Jul 15, 2018 · 1 comment

Comments

@whitfin
Copy link
Contributor

whitfin commented Jul 15, 2018

Right now there are two places for middleware; one in the middleware directory in the root, and another under the ::middleware module in the gotham code. Since this is a non-obvious separation, I think it important that we determine exactly what should live where.

My opinion is generally that anything which doesn't require external dependencies (database drivers, whatever) can/should live in the gotham code if it's simple enough. This makes it easier to document and use; things such as loggers, the session middleware, anything like that. Anything like the diesel middleware can ship externally and be pulled in as needed.

I do think that any "in-progress" middlewares should start out in the root middleware/under_development directory to avoid shipping breaking changes as the middleware changes. Once it becomes stable, we can consider folding it into the main codebase.

I'm curious if anyone has any feedback; just trying to nail it down as people keep asking in Gitter.

@secretfader
Copy link

Great question. Thanks for bringing it up in relation to #261.

I agree on all counts. If middleware doesn't require external dependencies, is commonly used in Gotham apps, and is maintained primarily by the core team, sources can and should live in Gotham core. I don't have a technical opinion on whether the code lives in gotham/ or middleware/ (assuming that if I don't use gotham::middleware::name my application won't ask for it to be compiled).

I'm open to moving tools like the JWT middleware into the repo if that's useful. Anything to help the Gotham ecosystem evolve.

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

No branches or pull requests

2 participants