drupal-code-generator icon indicating copy to clipboard operation
drupal-code-generator copied to clipboard

Drop support for global installation

Open Chi-teck opened this issue 2 years ago • 1 comments

That applies to both Composer and PHAR installation.

Reasons

  1. It seems global installation is not widely used. Most people have DCG installed as a local Composer package and use it through Drush.

  2. Maintenance cost. No need to dump services and hooks for autocompletion. Also PHAR compiler can be removed.

  3. Reducing complexity. Currently generators follow "Progressive Enhancement" strategy. Meaning they are capable to work when Drupal is not bootstrapped. And if Drupal context is availble they can enhance user experience somehow. For instance by providing more accurate autocompletion. In practice that looks like follows.

    if ($this->drupalContext) {
      // Some code that enhances UX if Drupal is installed.
    }
    

    This duality brings complexity. With this change we can get rid of this condition and assume that Drupal Context is always available. Eventually that would allow generators to implement deeper integration with Drupal.

Proposed solution

  • [x] Update installation instruction in README.md and stop generating PHAR file since 2.4.0.
  • [ ] Remove Drupal Conext conditions, dumper scripts, PHAR complier, etc.
  • [x] Require Drupal core for testing.

Chi-teck avatar Jan 12 '22 08:01 Chi-teck

👍 Makes sense to me.

weitzman avatar Jan 12 '22 19:01 weitzman

Fixed in 3.x branch.

Chi-teck avatar Aug 25 '22 05:08 Chi-teck