Drupal-console: Move symfony/thanks from a required dependency to a suggestion

Created on 15 Feb 2018  路  8Comments  路  Source: hechoendrupal/drupal-console

Problem/Motivation

In #3727 the symfony/thanks project was added as a dependency to Drupal Console. This project is a nice initiative to elicit some response and additional exposure from the PHP community.

However adding this as a requirement to Drupal Console will cause this software to be installed unsolicited on tens of thousands of development machines and servers.

For small projects and personal hobby sites this might not be a problem, but Drupal is also used for large corporate and government projects that have strict policies regarding the software that can be used. It is very hard to convince management why we suddenly require to have software on our servers that is doing nothing but distributing "internet points" in a fun way.

Solution

I think the best way would be to use the suggest feature of Composer to add symfony/thanks to the project. This will still expose the package to everybody who uses drupal-console, but does not make it a hard requirement. Developers can then decide for themselves whether to include it or not.

Most helpful comment

The symfony/thanks component was removed, we will follow this issue at d.o. https://www.drupal.org/project/drupal/issues/2945263

All 8 comments

If you really have such strict restrictions, you can just add this snippet in your composer.json:

    "replace": {
        "symfony/thanks": "*"
    },

Related to https://github.com/drupal-composer/drupal-project/issues/352
I don't adhere to the reasoning presented here.
Adding symfony/thanks or drupal-console to the requirements create an experience that is an integral part of what the authors want to provide. Code is never cold and purely technical.

I don't see how github stars can be an integral part of a development/maintenance console experience.

You are also adding a dependency. That means that if ever something goes wrong with "thanks" then drupal console will break.

Use require for the bare minimum absolute necessities that your package simply won't work without and use suggest for providing an optimal "experience".

@alexpot Adding a link to the d.o. issue Add symfony/thanks to Drupal by alexpott to keep track of replies => https://www.drupal.org/project/drupal/issues/2945263

If you really have such strict restrictions, you can just add this snippet in your composer.json:

"replace": {
    "symfony/thanks": "*"
},

I really don't think that forcing people to mess with the requirements of their dependencies can ever be considered a good practice.

The nature of this issue is very similar to what is happening now in Webform project. See Add Contribute module as a dependency and Remove Contribute dependency. Opinions seem to be divided equally.

Nobody force you to do that. Two of the most popular web frameworks in te world (namely Laravel and Symfony) ship this 200 LOC standalone and totally optional class and it looks like the internet is still running.

My point was just, if you really want to get rid of this dependency (there is no benefit of doing this IMO), you're not suck, Composer covers your need. So there is no point removing it totally for very specific siitautions (strict policies etc) that are already handled.

The symfony/thanks component was removed, we will follow this issue at d.o. https://www.drupal.org/project/drupal/issues/2945263

Was this page helpful?
0 / 5 - 0 ratings