- Issue created by @bradjones1
Drupal core is moving towards using a βmainβ branch. As an interim step, a new 11.x branch has been opened β , as Drupal.org infrastructure cannot currently fully support a branch named
main
. New developments and disruptive changes should now be targeted for the11.x
branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule β and the Allowed changes during the Drupal core release cycle β .Drupal 9.5.0-beta2 β and Drupal 10.0.0-beta2 β were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule β and the Allowed changes during the Drupal core release cycle β .
Drupal 9.4.0-alpha1 β was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule β and the Allowed changes during the Drupal core release cycle β .
Drupal 9.3.0-rc1 β was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule β and the Allowed changes during the Drupal core release cycle β .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
IIRC this was critical for certain aspects of the Drupal bootstrap process to become sufficiently fast in the majority of cases.
So the work that gets done here almost certainly will need to provide profiling data if it changes lazy services, and certainly if it removes them altogether.
That being said: +1 to this being poor DX right now. It's painful to make service lazy.
- π¬π§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 work 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.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
I created π Replace lazy service proxy generation with service closures Active to look at the service closure approach. It might be a big change to do in one go, so we could split it into smaller tasks.
- π¨π¦Canada Charlie ChX Negyesi πCanada
Note #17 has been fixed in https://github.com/symfony/symfony/commit/ba299601bf460a5888a511d2c6da16... do we want to patch your yaml loader?
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Created an issue for #23 π Support service closure shorthand syntax in YamlFileLoader Postponed