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

Convert Radar to PSR-15 compatible middleware #38

Open
wants to merge 9 commits into
base: 2.x
Choose a base branch
from
Open

Convert Radar to PSR-15 compatible middleware #38

wants to merge 9 commits into from

Conversation

kevinsmith
Copy link

This isn't meant to be merged in. Given the magnitude of changes made here, I just wanted to get initial reactions. Is this a direction the maintainers want to take this project?

No documentation or tests yet. Just the minimum necessary for a working proof-of-concept.

This is intended to become a new repository/package called Radar.Middleware. I'm working on another fork to modify the existing Radar.Adr to become just a micro-framework that wires up Aura.Di, Aura.Router, Relay 2.x, and the new Radar.Middleware, but there's no need to do that if this proposal isn't accepted.

Radar.Middleware is a fully PSR-15 compatible middleware package, uncoupled to any particular DI, middleware dispatcher, or router. It works with any PSR-11 compatible DI and any PSR-15 compatible dispatcher. And it can be used in combination with any PSR-15 compatible router that passes the route handler to the next middleware through a request attribute (customizable but named request-handler by default) such as these. It effectively subs in as an ADR-specific alternative to middlewares/request-handler. (See how that middleware is used.)

This change does remove some features though. Since Radar.Middleware is no longer coupled to Aura.Router, it can't provide route- and responder-specific features like…

My motivation here is to give us an ADR handler that can be used in a much wider variety of projects than just greenfield projects that start with Radar.Project. I've personally got a side project where I'm using PHP-DI, FastRoute, and Relay 2.x, so the existing Radar skeleton won't work. And I can see use cases for modernizing legacy projects that eventually want to move to an ADR pattern. Interoperability FTW!

So, thoughts?

@pmjones
Copy link

pmjones commented Mar 8, 2018

This is a neat idea. I will review it locally instead of online.

@jakejohns
Copy link
Contributor

For what it's worth, here's my brainstorming on the direction I think the radar stuff should go in terms of
https://github.com/jakejohns/radar-new

@cxj cxj changed the base branch from 1.x to 2.x August 18, 2019 20:40
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