How Do You Solve A Problem Like Composer?

A Diverse Drupal Community Needs Composer

The Drupal community has been trying to come to terms with modern build tools for a while.

We have Drupal core which is managed with Composer, but we also have contrib modules and some of them want to use Composer, too.

The canonical example is Address module. It requires an external PHP library, necessitating the use of Composer to add it to the codebase.

At least, that's the thought.

I Humbly Offer A Drupal 8.1.x Development Process


Here are some ideals I'd like to see in Drupal core development:

  • There is a process by which the quality of Drupal can improve.
  • Non-coders can participate in planning.
  • Maintainers have a well-understood reason for saying, "No."
  • Everyone can do a better job of estimating their real level of participation in core development.
  • Time is structured such that we respect the time and effort of others.

I want to talk about that last one: Everyone's time and effort is valued.

Drush, The Tool You Love But Hate To Manage

You need Drush.

I need Drush to work on Pantheon. Pantheon's documentation states that they only support Drush 5, and since it's not my data I'm managing but my clients', that's what I have to use.

In fact, it's annoying to work with Drush. That is, the magic stuff it does when you use it isn't annoying and is quite useful. But keeping all the versions you need for all the different use-cases is what's quite annoying.

Install A Drupal 8 Module With Composer

Just a heads-up of a proof-of-concept I did.

Here's a github repo for the page_example module from examples. I've added a composer.json file which requires symfony/console (arbitrarily), and composer/installer (to make it work):

I then made a entry for it:

Big Generator

You know what an array is? Well there's Iterators and they act like arrays, only they're objects. And you can make a function that acts like an Iterator object, and that's a Generator.

OK then. We're done.

Wait, not done? OK.

Read on.