Problem/Motivation

There is a need for a subtree split of each Drupal Component to exist on Drupal.org. This will allow other PHP projects to rely on Drupal Components the same way we rely on Symfony Compoments.

From core/lib/Drupal/Component/README.txt

Drupal Components are independent libraries that do not depend on the rest of
Drupal in order to function.

Components MAY depend on other Drupal Components or external libraries/packages,
but MUST NOT depend on any other Drupal code.

In other words, only dependencies that can be specified in a composer.json file
of the Component are acceptable dependencies. Every Drupal Component presents a
valid dependency, because it is assumed to contain a composer.json file (even
if it may not exist yet).

Each Component should be in its own namespace, and should be as self-contained
as possible. It should be possible to split a Component off to its own
repository and use as a stand-alone library, independently of Drupal.

Proposed resolution

Make this part:

It should be possible to split a Component off to its own
repository and use as a stand-alone library, independently of Drupal.

a reality on d.o.

This should be a "Read-only" repository and will live somewhere, and ideally should be linked on this page:
http://drupal.org/project/core

This is similar to Symfony's subtree split of Symfony's components:
https://github.com/symfony

Some work has already been done to create a subtree split of Drupal core (via a script) here:
https://github.com/tstoeckler/drupal-core

Ideally, the split should happen every time a commit is pushed to the primary drupal repository via a git hook. However if that is not possible, it should at least occur every release (i.e. beta1, beta2, etc.). I believe Symony does it nightly, the more often, the better.

Remaining tasks

  1. Create the subtree splits.
  2. Submit each Component to Packagist under the Dries account.

Comments

davidwbarratt’s picture

Mile23’s picture

axel.rutz’s picture

This is great, and should in some way include the issue workspaces from #2488266: [META] Improve Git workflow on Drupal.org by implementing issue workspaces.
Why? In a composer-with-patches workflow we need for each subtree split package the subtree splits of applicable patches.
(To some extent this can be circumvented by the -p2 option of patch/git-apply, but will break when a patch affects more than the subtree. For a example in the wild look at the essential #1269780-99: Remove symlinks option from .htaccess, which will not apply to drupal-core subtree, as it includes .htaccess.)

axel.rutz’s picture

Mile23’s picture

We discussed how to do testing and development on the component parts in #2337283: Add a composer.json file to every component

Basically the plan at this point is to file component patches against Drupal HEAD, because that's easy to implement in the short term. As specific needs develop later we can adapt to them.

The patches to add a composer.json file to each component also include a README.txt and a TESTING.txt which explains this.

Mile23’s picture

How do we move forward on creating the subtree split(s)?

I suggest that we start with Drupal\Component\Plugin\ since drupalci uses it: #2643110: Have drupalci_testbot require drupal/core-plugin in composer.json

davidwbarratt’s picture

Mixologic’s picture

Status: Active » Fixed

Indeed, we can, and are using splitsh/lite - https://bitbucket.org/drupalorg-infrastructure/subtree-splitter

As I mentioned over in #2352091: Create (and maintain) a subtree split of Drupal core, this is working now. Yay subtree splits. If you encounter any issues with this, lets do new issues.

Mile23’s picture

Status: Fixed » Reviewed & tested by the community

There's a change record to publish...

Also: Beer's on me.

Mile23’s picture

Also, it shouldn't effect the status of this issue, but there's already a version constraint problem. :-) #2873101: Component version constraints are out-dated

hestenet’s picture

Status: Reviewed & tested by the community » Fixed

The change record is published: https://www.drupal.org/node/2865141

Mile23’s picture

See if the components are testable in isolation: https://travis-ci.org/paul-m/drupal_component_tester

dsnopek’s picture

So... If this is Fixed - where are the repos with the split components? In https://github.com/drupal, I only see the core libraries, but not the components.

dsnopek’s picture

Oooooo, ok, the repos named like drupal/core-plugin are for \Drupal\Component\Plugin. I was assuming from the name that that was for \Drupal\Core\Plugin and that the component version would be called 'drupal/component-plugin'.

Sorry for the noise! I found them :-)

davidwbarratt’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.