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

split into symfony-cmf/chain-router and symfony-cmf/dynamic-router #274

Open
dbu opened this issue May 18, 2022 · 4 comments
Open

split into symfony-cmf/chain-router and symfony-cmf/dynamic-router #274

dbu opened this issue May 18, 2022 · 4 comments
Milestone

Comments

@dbu
Copy link
Member

dbu commented May 18, 2022

splitting this into 2 repositories would make the purpose of each repository clearer. the chain router is only a few classes, and shares no code with the dynamic router. this would be a clear benefit for users only wanting the chain router. (most people using the dynamic router probably also want to use chain router to be able to still use configured routing in addition to dynamic)

questions:

  • should we keep the namespace the same? that would mean that there is a risk that if we accidentally add a class with the same FQN in both repositories, one would hide the other. if we change the namespace, it will be a bit more annoying to upgrade for consumers.
  • should the routing bundle depend on both components? or do we also split the bundle? i tend to have the bundle depend on both.
@dbu dbu added this to the 4.0 milestone May 18, 2022
@danrot
Copy link

danrot commented May 18, 2022

Just wondering: What's the use case for having a chain router without a dynamic router? Are there other router implementations I am not aware of? Or do you want to support creating a completely different individual router per project? And is that something people already do?

@dbu
Copy link
Member Author

dbu commented May 18, 2022

i expect some people to have implemented https://github.com/symfony/symfony/blob/6.1/src/Symfony/Component/Routing/RouterInterface.php with their own custom logic. e.g. to bridge into a legacy application, or for a much simpler thing than dynamic router.

technically, the 2 parts in this repository have no direct dependency in either direction. the chain router is generic, and the dynamic router would work just fine without the chain router (probably rather in a non symfony-full-stack context).

@aschempp
Copy link

i expect some people to have implemented https://github.com/symfony/symfony/blob/6.1/src/Symfony/Component/Routing/RouterInterface.php with their own custom logic. e.g. to bridge into a legacy application, or for a much simpler thing than dynamic router.

If that legacy application already has a router and multiple controllers, maybe that would be the case. Not sure if that would be applicable e.g. for someone migrating from a Silex app.

In the case of Contao CMS, we used a simple catch all route (with our custom router loader) in the regular Symfony router when we moved to Symfony initially. It provided all we needed, it just always forwarded to the same controller which then did run the legacy router. We then started actually using the DynamicRouter because it was exactly what we needed: to load dynamic router from database into the routing system. I would never have thought about using the ChainRouter separately 🤷

@dbu
Copy link
Member Author

dbu commented May 19, 2022

there is at least one application using only the chain router: https://twitter.com/SnakeAAS/status/1526843448644489216

even if most people will install both, i think we would benefit from the added clarity of splitting the repository.

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

No branches or pull requests

3 participants