8000 [RFC][Routing] Automatic bundle routing registration · Issue #48557 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[RFC][Routing] Automatic bundle routing registration #48557

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

Closed
Nek- opened this issue Dec 8, 2022 · 5 comments
Closed

[RFC][Routing] Automatic bundle routing registration #48557

Nek- opened this issue Dec 8, 2022 · 5 comments
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed) Routing

Comments

@Nek-
Copy link
Contributor
Nek- commented Dec 8, 2022

Description

I know this has probably already been discussed in the past, but I'd like to be sure nobody has changed his mind, and I'd also like to be sure it's not possible to find a way.

TL;DR: Adding routing directly inside a bundle would be nice. There are many possibilities to do it that may be considered.

I'm currently building a mini bundle that adds content to the .well-known folder. Those routes will probably never be changed. But still, the user needs to specify manually (or via flex) the routes. This seems really like something not-easy and not-logic.

If you think it outside of my little bundle, you can take API Platform, and in fact, many many bundles that use a dynamic route loader... Still need to be imported... While the user has almost no power over the routing that will be added to its application.

I think it's time to consider adding a feature inside Symfony that allows bundles to define (at least) an entry-point route (that the user may redefine to add a prefix if required). WDYT?

Example

No response

@carsonbot carsonbot added RFC RFC = Request For Comments (proposals about features that you want to be discussed) Routing labels Dec 8, 2022
@stof
Copy link
Member
stof commented Dec 8, 2022

This was rejected in the past, because it removes control for the routes that are the public API of the project (and sometimes, the order of routes might have an impact).
A custom route loader still gives control to the project to decide whether they import it or no (so if the project does not want those routes, it can remove the import, and it can also change the order of imports if needed).

The recommended way to handle that is to have a recipe that adds the route import by default.

@Nek-
Copy link
Contributor Author
Nek- commented Dec 8, 2022

I'm pushing again the topic because I think this is creating an unnecessary configuration for many bundles, while it could be made simpler.

@OskarStark
Copy link
Contributor

A very nice way would be to be able to ship this recipe via the repo itself, even this was discussed in the past, but I doesn't know the outcome of this discussion

@MatTheCat
Copy link
Contributor

@OskarStark symfony/flex#206

This is not something that is going to happen.

This was three years ago though.

@nicolas-grekas
Copy link
Member

I agree with @stof, the reasons of the current design are still sound to me. I'm 👎 sorry.

@fabpot fabpot closed this as completed Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed) Routing
Projects
None yet
Development

No branches or pull requests

7 participants
0