Update
This project was moved to https://www.drupal.org/project/backport, see comments in this issue and #2947630: Transfer ownership of Backport module.
Problem/Motivation
Ok, hear me out.
Things have changed a lot in the Drupal ecosystem since this module was initially created and since @Fabianx's original feelings towards this topic (#2513036-1: Remove Dependencies (Symfony & Drupal Components) from the repository).
Drupal 8 itself even made Composer "official" in #1475510: Remove external dependencies from the core repo and let Composer manage the dependencies instead.
I think it's quite safe to make the judgment that Composer is now "de facto".
https://www.drupal.org/docs/develop/using-composer
https://www.drupal.org/docs/develop/using-composer/using-composer-with-d...
Drupal.org has also made leaps and bounds in regards to infrastructure and packaging over the years:
#2551607: [meta] Path forward for Composer support
#2485011: Infrastructure Requirements to support Composer based workflows
#2352091: Create (and maintain) a subtree split of Drupal core
#2513388: Create (and maintain) a subtree split of each Drupal Component
---
It was also brought up in #2513036: Remove Dependencies (Symfony & Drupal Components) from the repository that this module bundles external 3rd party code (where licensing isn't exactly 100% compatible). Given the advent of the core/component sub-tree split, I think it stands to reason that it would be far easier to simply depend on Composer Manager.
Drupal 7 has no "native" support for Composer like Drupal 8 does and we'll need something that we can, reliably, use to retrieve Composer's autoloader.
Then this module can simply require drupal/core so we can have the full heart of Drupal 8 at our fingertips, but only hook up the parts that can be supported in Drupal 7.
This means we'd likely need to create a Drupal 7 specific DrupalKernel and our own supported core.services.yml that allows us to "bootstrap" Drupal 8 code within the confines of Drupal 7.
Whenever we need to replace or "fix" something for Drupal 7, we can extend or replace services as needed.
For classes that aren't services (e.g. Drupal\Core\Site\Settings), we can use cweagans/composer-patches to patch them as needed.
Think of this as kind of like running "Drupal 8" within Drupal 7, but where Drupal 8 is using Drupal 7's DB and methodology when it has to.
The performance impact is quite negligible once the container has been fully built since most of Drupal 8 code is autoloaded classes. Given that most of the code in Drupal 7 is procedural (including most Drupal 7 contrib), the relatively "weight" of doing this is rather minuscule.
Things like routes and rendering, for example, will likely never be able to be supplemented given the vast difference between the versions.
The three primary reasons I'm suggesting any of this is because:
- It will make maintaining this module much easier.
- This module isn't duplicating code that already exists.
- It will give sites a way to preemptively "upgrade" their site in pieces before actually doing a real full upgrade (think d.o, which is currently on Drupal 7).
---
Also, I know I just created the 7.x-2.x branch, but I'm begnning to think this module should actually move to major versioning parity with each Drupal 8 major version, e.g.:
7.x-4.x === 8.4.x
7.x-5.x === 8.5.x
7.x-6.x === 8.6.x
Proposed resolution
Create a new 7.x-4.x branchAdd anycomposerdependencyRefactor module'scomposer.jsonto requiredrupal/core: ~8.4.5Remove unnecessary codeCreate Drupal 7 specificDrupalKernelCreate Drupal 7 specificcore.services.ymlStart hooking up services that can be backported.
Remaining tasks
Discuss and garner information that allows us to come to a dicisionCreate POCCreate child issues
User interface changes
TBD, but likely none
API changes
TBD, but some are likely
Data model changes
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2947485-3.patch | 29.05 KB | markhalliwell |
Comments
Comment #2
markhalliwellComment #3
markhalliwellWIP POC patch.
Requires the latest patch from #2876808: Refactor composer_manager_build_json() to be more dynamic.
Comment #4
markhalliwellP.S. I'm also under no illusion that this drastically changes the original "lightweight" intention of this module. However, I think it is unavoidable given the complexities of composer + 8.x and the subsequent feature requests in this IQ.
If this project should remain dependent on CTools and keep its manual c&p nature, maybe I was just overzealous in thinking that this module should evolve into something more. Perhaps a namespace change? I can look into perhaps taking over https://www.drupal.org/project/backport since that is essentially what I am proposing to do: backport 8.x functionality into 7.x.
Comment #5
markhalliwellI've created #2947630: Transfer ownership of Backport module as a placeholder until a decision can be made here.
Comment #6
fabianx commentedService Container was always meant to provide a full blown BC layer to run D8 modules on D7.
And my reluctance to composer_manager has long since changed, too.
And if there was not the problem with security releases and at that time reluctance of d.org itself to pull D8 in, I would have long done just that.
The main problem was and is entity API as it's kinda impossible to provide a layer for that.
That said I am also happy if this moves to the 'backport' namespace.
I would then simply deprecate this module and point to the new one.
And I think ABI compatiblity with 7.x-4.x == CORE 8.x-4x is a MUST - especially as the #1 bug report here is due to drush Symfony version not matching e.g. shipped Symfony version.
Comment #7
markhalliwellDiscussed this with @dawehner in slack.
We still want the ability to use something other than
composer_manager, so we'll need to add Any Dependency support for both https://www.drupal.org/project/composer_manager and https://www.drupal.org/project/composer_autoloader, barring #2904194: Allow obtaining the class loader for future usage makes it in sometime soon.Also, it seems that there is a consensus with deprecating this project and moving future dev work to the https://www.drupal.org/project/backport namespace.
I'll go ahead and make this change, add all current maintainers to that project and then move issues over to that project.
Comment #8
markhalliwellCommitted dd42eb0 to backport-7.x-4.x.
Comment #10
markhalliwellInstead of relying/waiting on https://www.drupal.org/project/composer_autoloader/issues/2904194, I decided to just create the following: https://www.drupal.org/project/backport_composer
Comment #12
markhalliwell