Active
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 May 2023 at 20:03 UTC
Updated:
20 Oct 2023 at 01:50 UTC
Jump to comment: Most recent
Follow up from #3221128: Enable service autoconfiguration for core event subscribers
NA
Sub-issues:
TBD
TBD
TBD
TBD
TBD
Comments
Comment #3
duadua commentedPotential other tags to enable this for:
\Drupal\Core\Plugin\PluginManagerPass::processOne interesting question would be: How can the documentation updates be handled. It seems like it would be best to update the documentation once the story is more coherent.
Comment #4
longwaveNarrowing the scope of this, perhaps this can be a discussion issue and then we open child issues when we have determined tags that could be autoconfigured. I opened #3367455: Use service autoconfiguration for all event subscribers for the remaining event subscribers.
Comment #5
longwaveImplementing this for cache contexts is blocked by #2915594: SessionCacheContext class should implement CacheContextInterface as not all cache contexts currently implement an interface.
Comment #6
duadua commentedThat sounds like a really good idea!
Cache contexts
Look at cache contexts there are actually two interfaces involved:
1.
\Drupal\Core\Cache\Context\CacheContextInterface2.
\Drupal\Core\Cache\Context\CacheContextsPassInteresting enough the services then require to start with
cache_context., see\Drupal\Core\Cache\Context\CacheContextsPass,but I don't see a reason why this would block autoconfiguration.
Cache bins (potentially)
Looking at an example:
Given the additional arguments, it feels like this could be its own issue to discuss it.
Page cache policies
An example of a page cache policy looks like:
This looks like a perfect candidate for autoconfiguration.
Theme negotiators
An example looks like this:
Theme negotiator seem to care all about priorities. This seems to unqualify them for autoconfiguration. We could introduce an additional attribute.
plugin_manager_cache_clear
This has its own autoconfigure logic anyway already in
\Drupal\Core\Plugin\PluginManagerPass::processParam converters
Looking at an example:
The additional parameter is required. This seems to unqualify them for autoconfiguration. We could introduce an additional attribute.
Comment #7
kim.pepperAdded #3395032: Add autoconfigure for module loggers as a sub-issue.