- Issue created by @claudiu.cristea
- Status changed to Needs review
7 months ago 8:21am 4 June 2024 - π·π΄Romania claudiu.cristea Arad π·π΄
Just a proof of concept. Should we go this way?
- π¬π§United Kingdom catch
I tried to use autoconfigure on a different issue and ran into us not setting autoconfigure: true in various module services.yml files, so gave up.
I think this is a good idea and can't think of any drawbacks, but am concerned that I could be missing something that this would break - i.e. could autoconfigure suddenly find classes that it currently doesn't and add tags to them etc?
Also wondering whether we should require this to be set explicitly in all module services.yml files, issue a deprecation if it isn't, and then throw an exception in Drupal 12 - that way we could remove this code later and modules would have had to opt in or out by then.
- π¬π§United Kingdom longwave UK
As discovered in π Use autoconfigure more in core Active I'm not sure we can do this for autoconfigure at least.
The example found there is that the mysql driver has a service which implements a Views interface. However, Views is not guaranteed to be available (in tests, and perhaps in a small number of real sites), so container rebuild crashes. I imagine that this scenario is more likely in contrib where a service has an optional dependency, and the service isn't used when the dependency isn't available.
- π©πͺGermany donquixote
I did wonder why Symfony didn't just globally enable it
I would imagine this is for BC reasons, same as here.
There are probably plenty of existing packages that would break if symfony would enable autowire and autoconfigure by default. - Status changed to Needs work
6 months ago 1:22pm 2 July 2024 - πΊπΈUnited States smustgrave
Does seem to have some buy in. Maybe the tests could cover some of the concerns mentioned. Moving to NW for those.