- π¬π§United Kingdom longwave UK
Symfony 6.2 supports lazy services out of the box: https://symfony.com/doc/current/service_container/lazy_services.html
We should figure out how this works and see if we can swap our custom implementation to using Symfony's.
- π¬π§United Kingdom catch
I think that was already attempted in π Deprecate Drupal ProxyBuilder in favor of Symfony lazy services Closed: won't fix .
- π¨π¦Canada Charlie ChX Negyesi πCanada
You want ServiceClosureArgument
Your problem is our YAML loader AFAIK doesn't support it
You want to add a notation like the already existing @? probably @> because it's reminiscent of fn () => and probably upstream it too -- Symfony has its own way to do it using some godforsaken YAML notation uglier than sin and waaaaay too long, too.
- πΊπΈUnited States bradjones1 Digital Nomad Life
Re: ##13, we're using this pattern at π Cache bin names should be set from service tags, not the service name Needs review though as mentioned, the Drupal container doesn't support it directly. I disagree that the Symfony syntax is too ugly to use, but service closure is a good candidate here to remove all this even uglier boilerplate.
- π¬π§United Kingdom longwave UK
- πΊπΈUnited States bradjones1 Digital Nomad Life
Does this mean we could deprecate the existing lazy proxy creation script and require any new core lazy services be injected with a service closure or something else less boilerplate?
- π¨π¦Canada Charlie ChX Negyesi πCanada
Yeah,
arguments: [!service_closure '@example_service_1']
is exactly the godforsaken ugly syntax I mentioned. Nah. We could and should do better:arguments: ['@>example_service_1']
and be done. - π¦πΊAustralia dpi Perth, Australia
Does this mean we could deprecate the existing lazy proxy creation script
A worthwhile cause <3
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Note π Add support for !service_closure custom tag in YamlFileLoader Fixed went in recently.