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:

  1. Run drush composer-json-rebuild --modules=<em>module1,module2</em>, and then run composer and then install the module OR
  2. 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

cpliakas’s picture

Status: Reviewed & tested by the community » Active
mradcliffe’s picture

Issue summary: View changes

Added issue summary with regard to the current behavior.

cpliakas’s picture

Status: Active » Postponed (maintainer needs more info)

The module cannot be enabled because Drupal attempts to add a service to the service container with a class that does not exist i.e. ServiceNotFoundException thrown, but not caught.

In 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?

mradcliffe’s picture

I'll try.

bojanz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No longer relevant, I guess.