Add symfony/config to core's dependencies for package_manager

Created on 9 December 2022, almost 2 years ago
Updated 1 March 2023, over 1 year ago

Problem/Motivation

package_manager needs the symfony/config package, because:

Composer Stager uses automatic service loading, where (almost) the only entry in its services.yml is to point its namespace to its src directory, and all the classes within there automatically get corresponding service definitions. Composer Stager is designed to not know anything about Drupal, and is not a Drupal module, so does not itself register these services in Drupal's service container.

Package Manager is the Drupal module that interfaces with Composer Stager. It needs to use Composer Stager's services, so it brings them in via PackageManagerServiceProvider. However, the code to discover and register services for all classes within a namespace/directory relies on the symfony/config package.

Proposed resolution

composer require symfony/config ^6.2

If for some reason we don't want to add this dependency, we could try to implement the needed functionality in πŸ“Œ Support resource key in services.yml Active without it, but then that would be more custom code for Drupal to maintain.

Remaining tasks

In #1632930: Add Symfony/Component/Config despite Symfony potentially releasing BC-breaking updates after 2.3. β†’ we had rejected adding symfony/config, partly out of performance concerns, but that was a long time ago. Still, if we want to add it now, we should profile/benchmark the impact it would have to the time it takes to do a container rebuild. If we only use it in a few isolated places, like in PackageManagerServiceProvider, it probably wouldn't add much cost. But once it's in core, there might be a temptation to use it in more places.

User interface changes

None.

API changes

symfony/config is now a dependency of Drupal core. (It already was a dev dependency for Drupal core!)

It is required for the experimental Package Manager module, but it will also be used for improved service container/dependency injection DX in ✨ Use native Symfony YamlLoader + Config Needs work .

Data model changes

None.

Release notes snippet

TBD

πŸ“Œ Task
Status

Closed: duplicate

Version

10.1 ✨

Component
OtherΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024