Generate plugin should no longer ask whether it should also create an API and a controller #6145
Labels
Task
Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone
After we have created a plugin using
./console generate:plugin
we are currently asking a developer whether he wants to generate an API and a Controller as well. When we created the first command to generate a plugin one often needed an API and a Controller as they were needed for a lot of things. This is no longer the case. Especially that a plugin developer needs both an API and a Controller is very rare. In all the tutorials / blog posts I am currently always writing to answer this question with "No". Therefore I propose to remove the question whether we should create those components as well. I think it is even rather confusing asking this question since a plugin developer would at this stage maybe not even know whether he actually needs them or not as it is not explained in which cases he needs them. In the end he might answer with yes although he does not need it.Alternatively we should only ask whether we should create a controller as well but even this is rarely needed. For widgets, reports, ... it is no longer needed. Only if someone wants to add an item to the menu but then no API is needed. If someone creates a report we will automatically create an API as well.
I propose to only generate a very basic plugin structure when executing
generate:plugin
. It should not even generate the JavaScript file. In the success message we could add some more text explaining how to proceed and what his options are. We could also mention all the othergenerate:*
commands and for what they are actually good. Maybe along with some links to blog posts/ developer guides.After removing the if condition in generate plugin we also have to update tutorials.
To be discussed...
The text was updated successfully, but these errors were encountered: