- Issue created by @smustgrave
Potential other tags to enable this for:
- Cache contexts
- Cache bins (potentially)
- Page cache policies
- Theme negotiators
- plugin_manager_cache_clear (which has its own autoconfigure logic anyway already in
\Drupal\Core\Plugin\PluginManagerPass::process
- Param converters
One 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.
- π¬π§United Kingdom longwave UK
Narrowing 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 π Use service autoconfiguration for all event subscribers Needs work for the remaining event subscribers.
- π¬π§United Kingdom longwave UK
Implementing this for cache contexts is blocked by π SessionCacheContext class should implement CacheContextInterface Needs work as not all cache contexts currently implement an interface.
Narrowing 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.
That sounds like a really good idea!
Cache contexts
Look at cache contexts there are actually two interfaces involved:
1.
\Drupal\Core\Cache\Context\CacheContextInterface
2.\Drupal\Core\Cache\Context\CacheContextsPass
Interesting 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:
cache.page: class: Drupal\Core\Cache\CacheBackendInterface tags: - { name: cache.bin } factory: ['@cache_factory', 'get'] arguments: [page]
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:
basic_auth.page_cache_request_policy.disallow_basic_auth_requests: class: Drupal\basic_auth\PageCache\DisallowBasicAuthRequests public: false tags: - { name: page_cache_request_policy }
This looks like a perfect candidate for autoconfiguration.
Theme negotiators
An example looks like this:
theme.negotiator.ajax_base_page: class: Drupal\Core\Theme\AjaxBasePageNegotiator arguments: ['@csrf_token', '@config.factory', '@request_stack'] tags: - { name: theme_negotiator, priority: 1000 }
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::process
Param converters
Looking at an example:
access_check.entity: class: Drupal\Core\Entity\EntityAccessCheck tags: - { name: access_check, applies_to: _entity_access }
The additional parameter is required. This seems to unqualify them for autoconfiguration. We could introduce an additional attribute.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Added β¨ Add autoconfigure for module loggers Needs review as a sub-issue.