Problem/Motivation
In #3392616: Update to Symfony 6.4 we decided to convert both BookNavigationCacheContext and MenuActiveTrailsCacheContext to use lazy services.
This issue was created to do just that.
Currently both classes are container aware, so not to load an expensive service when not needed.
Steps to reproduce
Proposed resolution
- Change \Drupal\book\BookManager and \Drupal\Core\Menu\MenuActiveTrail to laze loading services.
- Remove container awareness from BookNavigationCacheContext and MenuActiveTrailsCacheContext
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3397173
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:
- 3397173-pp-1-convert-both
changes, plain diff MR !5172
Comments
Comment #2
spokjePostponing on the possible adoption of native Symfony lazy services in #3396928: Deprecate Drupal ProxyBuilder in favor of Symfony lazy services .
Comment #3
spokje#3396928: Deprecate Drupal ProxyBuilder in favor of Symfony lazy services is trickier than expected, let's not postpone better on perfect here.
Comment #4
spokjeComment #6
spokjeComment #7
spokjeComment #8
spokjeComment #9
smustgrave commentedPipeline is green and CR has the main points.
Almost marked because the syntax in the generated classes seemed off but checking others guess that's the case of how they get generated. And gitlabCI didn't complain.
If this gets in should the scope of #3396928: Deprecate Drupal ProxyBuilder in favor of Symfony lazy services be expanded?
Comment #10
spokjeComment #13
catchCommitted/pushed to 11.x and cherry-picked to 10.2.x, thanks!
Comment #15
spokjePublished CR.
Comment #16
hephaestus commentedThis change appears to be causing the issue discussed in #3403778: MenuActiveTrail ($menu_link_manager) must be of type Menu\MenuLinkManagerInterface, DependencyInjection\Container given after upgrading to 10.2.0-beta1.