Support service closure shorthand syntax in YamlFileLoader

Created on 7 January 2025, 7 months ago

Problem/Motivation

In #3228623-23: DX: Creating lazy services is too difficult/obscure/bespoke/brittle β†’ @chx provided a link to a commit adding a shorthand syntax @> for !service_closure in the symfony service yaml.

https://github.com/symfony/symfony/commit/ba299601bf460a5888a511d2c6da16...

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Postponed

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kim.pepper
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

    Postponing until this is available in a supported symfony version.

  • πŸ‡¨πŸ‡¦Canada Charlie ChX Negyesi 🍁Canada

    Hardly needs to be postponed, Drupal has a copy of YamlFileLoader, the patch could be applied any time.

    Documentation is underway too.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Yeah we can still do this, no need to wait years.

  • Pipeline finished with Failed
    6 months ago
    Total: 107s
    #424739
  • πŸ‡¨πŸ‡¦Canada Charlie ChX Negyesi 🍁Canada

    https://symfony.com/releases/7.3 comes out in May

    https://www.drupal.org/about/core/policies/core-release-cycles/schedule β†’ 11.2 comes out in Jun

    if this gets in now, a released Symfony still will predated a released Drupal

    (not that I have any idea why would that be a prerequisite)

  • Status changed to Active 2 months ago
  • πŸ‡¦πŸ‡ΊAustralia mstrelan

    FWIW we have symfony 7.3 in core now

  • πŸ‡¦πŸ‡ΊAustralia mstrelan

    Rebased, fixed the phpstan issues, added test coverage

  • Pipeline finished with Success
    2 months ago
    Total: 555s
    #510002
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

    Updated the issue summary and added a change record.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Ran test only job here https://git.drupalcode.org/issue/drupal-3498038/-/jobs/5941301

    1) Drupal\Tests\Core\DependencyInjection\YamlFileLoaderTest::testParseDefinitionsWithProvider
    Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "example_service_closure_shorthand" has a dependency on a non-existent service ">example_service_1". Did you mean one of these: "example_service_1", "example_service_2"?
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:116
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:123
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:83
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:84
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:48
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:93
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:48
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:84
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:48
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:45
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:39
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/Compiler/Compiler.php:73
    /builds/issue/drupal-3498038/vendor/symfony/dependency-injection/ContainerBuilder.php:813
    /builds/issue/drupal-3498038/core/tests/Drupal/Tests/Core/DependencyInjection/YamlFileLoaderTest.php
    

    Change makes sense and CR is clear.

    Don't see any open threads so LGTM

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
Production build 0.71.5 2024