Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Improve the Developer Experience (DX) for contrib modules that define services provided by composer-managed dependencies. DX should include user interface improvements as well.
Current behavior as of #2276423: Add the ability to build a composer.json file using dependencies from disabled modules:
A module developer must either:
- Run
drush composer-json-rebuild --modules=<em>module1,module2</em>
, and then run composer and then install the module OR - Provide a list of modules at the bottom of the Composer Rebuild Form and then run composer and then install the module.
Other Considerations/Questions
- Devops: how does the above play out in a build environment?
Proposed resolution
Remaining tasks
User interface changes
API changes
Original report by cpliakas
Follow-up to #2276423: Add the ability to build a composer.json file using dependencies from disabled modules
Comments
Comment #1
cpliakas CreditAttribution: cpliakas commentedComment #2
mradcliffeAdded issue summary with regard to the current behavior.
Comment #3
cpliakas CreditAttribution: cpliakas commentedIn testing this against D8 HEAD, I am no longer able to reproduce the issue.
I have a module named "mymodule" that adds a service that extends a class that doesn't exist. Installing the module doesn't product any errors nor do cache clears. If I call
\Drupal::service('mymodule.client');
then I do get a fatal error since the extending class has not been installed yet, but this proves that the compiler is aware of my service.Therefore I suspect that something happened in core that prevents the service class files from being sources when the container is compiled. Can you replicate the behavior in the OP against D8 HEAD?
Comment #4
mradcliffeI'll try.
Comment #5
bojanz CreditAttribution: bojanz commentedNo longer relevant, I guess.