-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing][ServiceRouterLoader] Use a private service #30402
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
Comments
👍 for the intend. IIUC the steps needed are:
@symfony/deciders any blocker? |
Looks good to me, let's remove the container. |
Alright I'm gonna work on it this week-end! |
2 tasks
fabpot
added a commit
that referenced
this issue
Aug 9, 2019
…rs (fancyweb) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle][Routing] Private service route loaders | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30402 | License | MIT | Doc PR | symfony/symfony-docs#11337 Continuation of #30926. ~Please review only the 2nd commit, I'm building this on top of #32582 Commits ------- 64aa2c8 [FrameworkBundle][Routing] Private service route loaders
symfony-splitter
pushed a commit
to symfony/framework-bundle
that referenced
this issue
Aug 9, 2019
…rs (fancyweb) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle][Routing] Private service route loaders | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#30402 | License | MIT | Doc PR | symfony/symfony-docs#11337 Continuation of symfony/symfony#30926. ~Please review only the 2nd commit, I'm building this on top of symfony/symfony#32582 Commits ------- 64aa2c8529 [FrameworkBundle][Routing] Private service route loaders
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using a service router loader (
type: service
), the service has to bepublic
. It would be nice if it was not mandatory (to follow Symfony good practices).The implementation I thought of would be to tag custom router loader services with a new tag, to be able to inject them in the
ServiceRouterLoader
service in a second "private" service locator. Creating another loader for private services would be bad for DX.The proposed implementation might be bad for DX actually since it forces developers to add a tag. However, that would works great if there was a concrete interface to implement for service router loader because it could be autoconfigured.
I also thought that we could parse all routes config files before compilation to get the referenced services, but I think that would involve a lot of code and probably be overkill.
Is the whole thing overkill ? Does anyone have a better / easier implementation idea ? @Tobion @nicolas-grekas @stof
The text was updated successfully, but these errors were encountered: