You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
Right now there are two places for middleware; one in the
middleware
directory in the root, and another under the::middleware
module in thegotham
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 thediesel
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.
The text was updated successfully, but these errors were encountered: