using subtree splits to spread - drupalcon...drupal components are independent libraries that do not...
TRANSCRIPT
![Page 1: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/1.jpg)
![Page 2: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/2.jpg)
USING SUBTREE SPLITS TO SPREAD DRUPAL INTO EVERYTHING
D AV I D B A R R AT T ( D AV I D W B A R R AT T )
![Page 3: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/3.jpg)
Drupal: Everything except the /core folder.
Drupal core: Everything in the /core folder.
CLARIFICATION
![Page 4: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/4.jpg)
npmjs.com bower.io
bundler.io
DEPENDENCY MANAGEMENT
![Page 5: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/5.jpg)
DEPENDENCY MANAGEMENT
name = Really Neat Widget description = Provides a really neat widget for your site's sidebar. core = 7.x package = Views dependencies[] = views dependencies[] = panels
in Drupal
![Page 6: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/6.jpg)
Composer is a tool for dependency management in PHP.
COMPOSERcomposer.org
![Page 7: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/7.jpg)
CONSUMERS & PROVIDERS
![Page 8: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/8.jpg)
DEPENDENCY MANAGEMENT
name = Really Neat Widget description = Provides a really neat widget for your site's sidebar. core = 7.x package = Views dependencies[] = views dependencies[] = panels
in Drupal
![Page 9: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/9.jpg)
Projects that consume libraries via Composer
CONSUMERS
![Page 10: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/10.jpg)
composer.json
{ "require": { "guzzlehttp/guzzle": "~5.0" } }
CONSUMERS
![Page 11: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/11.jpg)
PRO-TIPGenerate (or update) composer.json
$ composer require guzzlehttp/guzzle ~5.0
![Page 12: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/12.jpg)
DOWNLOADING DEPENDENCIES
$ composer install
![Page 13: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/13.jpg)
DOWNLOADING DEPENDENCIESLoading composer repositories with package informationInstalling dependencies (including require-dev) - Installing react/promise (v2.2.0) Loading from cache
- Installing guzzlehttp/streams (3.0.0) Loading from cache
- Installing guzzlehttp/ringphp (1.0.7) Loading from cache
- Installing guzzlehttp/guzzle (5.2.0) Loading from cache
Writing lock fileGenerating autoload files
![Page 14: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/14.jpg)
DOWNLOADING DEPENDENCIES
-rw-r--r-- composer.json-rw-r--r-- composer.lockdrwxr-xr-x vendor
![Page 15: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/15.jpg)
LOCKING DEPENDENCIES
x
{ "packages": [ { "name": "guzzlehttp/guzzle", "version": "5.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", "reference": "475b29ccd411f2fa8a408e64576418728c032cfa" } } ] }
composer.lock
![Page 16: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/16.jpg)
IGNORING DEPENDENCIES
vendor/
.gitignore
![Page 17: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/17.jpg)
AUTOLOADING
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client(); $response = $client->get('http://guzzlephp.org');
![Page 18: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/18.jpg)
GET OFF THE ISLAND
{ ``"require": { "symfony/yaml": "2.6.*", "twig/twig": "1.18.*", "doctrine/common": "~2.4.2", "doctrine/annotations": "1.2.*", "guzzlehttp/guzzle": "~5.0", "symfony-cmf/routing": "1.3.*", "easyrdf/easyrdf": "0.9.*", "zendframework/zend-feed": "2.4.*", "stack/builder": "1.0.*", "egulias/email-validator": "1.2.*", "masterminds/html5": "~2.1" } }
core/composer.json
![Page 19: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/19.jpg)
PROPOSAL #1Issue #1475510
Remove external dependencies from the core repo and let Composer manage the dependencies instead
![Page 20: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/20.jpg)
$ cd core; composer install;
PROPOSAL #1Issue #1475510
![Page 21: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/21.jpg)
PROPOSAL #2Issue #2444615
Move phpunit and mink to require-dev
![Page 22: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/22.jpg)
PROPOSAL #2Issue #2444615
{ "require": { "mikey179/vfsStream": "1.*", "stack/builder": "1.0.*", "egulias/email-validator": "1.2.*" }, "require-dev": { "phpunit/phpunit": "4.4.*", "behat/mink": "~1.6", "behat/mink-goutte-driver": "~1.1", "fabpot/goutte": "^2.0.3", "masterminds/html5": "~2.1" } }
![Page 23: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/23.jpg)
$ cd core; composer install --no-dev;
PROPOSAL #2Issue #2444615
![Page 24: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/24.jpg)
PROPOSAL #3
Require Drush as a dev dependency
![Page 25: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/25.jpg)
PROPOSAL #3
{ "require-dev": { "drush/drush": "~7.0" } }
![Page 26: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/26.jpg)
Package (typically a library) that can be consumed by another package or project
PROVIDERS
![Page 27: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/27.jpg)
composer.jsonPROVIDERS
{ "name": "guzzlehttp/guzzle", }
![Page 28: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/28.jpg)
composer.jsonPROVIDERS
{ "name": "guzzlehttp/guzzle", "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients" }
![Page 29: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/29.jpg)
COME TO OUR ISLANDcore/composer.json
{ "name": "drupal/core", "description": "Drupal is an open source content management platform powering millions of websites and applications.", "type": "drupal-core" }
![Page 30: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/30.jpg)
DRUPAL CORE AS A DEPENDENCYcomposer.json
{ "require": { "drupal/core": "~8.0" } }
![Page 31: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/31.jpg)
A Composer plugin that installs packages of a specific type in a specific directory
COMPOSER INSTALLERScomposer.github.io/installers
![Page 32: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/32.jpg)
DRUPAL CORE AS A DEPENDENCYcomposer.json
{ "require": { "composer/installers": "^1.0.20", "drupal/core": "~8.0" } }
![Page 33: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/33.jpg)
PROJECT TYPEcomposer.json
{ "type": "project" }
![Page 34: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/34.jpg)
PROJECTS & FRAMEWORKS
Project Framework
Drupal Drupal Core
Symfony Standard Symfony
Laravel Laravel Framework
![Page 35: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/35.jpg)
PROPOSAL #4Issue #2385387
Permanently split Drupal and Drupal core into separate repositories
![Page 36: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/36.jpg)
PROPOSAL #5Issue #2352091
Create (and maintain) a subtree split of Drupal core
![Page 37: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/37.jpg)
PROPOSAL #5Issue #2352091
![Page 38: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/38.jpg)
PROPOSAL #5Issue #2352091
![Page 39: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/39.jpg)
PROPOSAL #5Issue #2352091
![Page 40: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/40.jpg)
PROPOSAL #6
Split each component into a read-only repository
![Page 41: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/41.jpg)
PROPOSAL #6core/lib/Drupal/Component/README.txt
Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function.
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).
16 components are ready to be shared
![Page 42: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/42.jpg)
PROPOSAL #6
![Page 43: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/43.jpg)
PROPOSAL #6
![Page 44: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/44.jpg)
CONTRIB
{ "require": { "guzzlehttp/oauth-subscriber": "0.2.*" } }
![Page 45: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/45.jpg)
COMPOSER MANAGER
![Page 46: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/46.jpg)
LOAD MODULE WITH COMPOSER
{ "require": { "drupal/really_neat_widget": "8.1.*" } }
composer.json
![Page 48: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/48.jpg)
DRUPAL PACKAGIST
{ "require": { "drupal/really_neat_widget": "7.1.*" }, "repositories": [ { "type": "composer", "url": "https://packagist.drupal-composer.org" } ] }
![Page 49: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/49.jpg)
PROPOSAL #6
Provide a Release Webhook & Better APIs
![Page 50: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/50.jpg)
PROPOSAL #7
Switch to Semantic Versioning for Drupal contrib extensions (modules, themes, etc)
Issue #1612910
![Page 52: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/52.jpg)
PROPOSAL #9
Allow contrib developers to define subfolders (modules or libraries) that should have subtree splits
![Page 53: USING SUBTREE SPLITS TO SPREAD - DrupalCon...Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function. In other words, only dependencies](https://reader036.vdocuments.mx/reader036/viewer/2022081617/6049674557283814aa63569b/html5/thumbnails/53.jpg)
QUESTIONSC O M M E N T S O R I N S U LT S