Problem/Motivation
In #3540386: [meta] Explore using more service closures to break deep dependency chains and load fewer services @berdir noticed a long dependency chain:
router_listener -> router -> router.no_access_checks -> url_generator -> renderer -> theme.manager -> theme.registry -> extension.list.module
Url generator in this one looked weird, so I checked, it's not used.
This has been the case since #3293284: Throw an exception when Router::generate() is called which is 'only' three years ago. We should be able to remove the dependency now.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screenshot 2025-08-08 134043.png | 92.85 KB | berdir |
Issue fork drupal-3540398
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
catchComment #4
berdirThis looks good, nice little cleanup.
Comment #5
berdirCouldn't resist to try my debug file idea, it's a bit tricky to diff, there are also some seemingly unrelated changes that I'm seeing, I think the whole thing isn't quite stable yet, possibly due to caches warming up, so I did a git diff words, as a screenshot.
Essentially, the url_generator moves down to the maintenance mode subscriber. Which is likely another good target for some service locators, it has a ton of dependencies that only needed if maintenance mode is on.
This also shows the middleware issue that #3538294: Regression: All stack middlewares are constructed at the same time even for cached pages is working on quite nicely.
I'll share more of that and some example files later in #3540386: [meta] Explore using more service closures to break deep dependency chains and load fewer services.
Comment #6
alexpottCommitted 4748574 and pushed to 11.x. Thanks!