-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to drupal-code-generator v3 #5371
Conversation
This kind of critical, because Drupal 10 has been already released and code generated by DCG 2 is not fully compatible with it. In order to support multiple Drupal versions DCG would have to generate code with deprecations . |
I dont feel strongly about it, but I think 1. is the best way forward. We could branch for Drush 12 now, with a target release date just before Drupalcon Pittsburgh (early June). Drush 12 would be Drupal 10 minimum. Here is the todo list for Drush 12 https://github.com/drush-ops/drush/milestone/7 |
Update: ignore below. I had merged composer changes into 11.x by accident. I changed the base of this PR to 12.x It says it has no merge conflicts but I dont see how composer.lock could not conflict. Please reroll if needed when you get a chance. |
Modules can subscribe to generator info event and register their generators. I am not sure if this is enough to resolve this task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does a global generator subscribe to the event? Here is what we say about authoring global generators today https://www.drush.org/11.x/generators/#global-generators
Those need to be registered in the generate command before |
I updated the dcf generator a bit in #5442. Still needs port to DCG3. |
For global generators, is there any reason we can't keep using the code in |
The dcf command has been updated to DCG3. Needs review. |
The link seems broken. Anyway we can use any discovery method as long as it can ignore DCG 2 generators. I would prefer something less magic, something that does not rely on reflection API and loading generator classes. That would allow to avoid difficulties in future major updates of DCG and symfony/console. |
The diff wont show because it is inside the file thats deleted in the PR. IMO we should merge this without major changes to generator discovery in drush (both global and module). Then we work on those in #4685 |
I've removed |
Drush currently uses DCG 2 to generate code.
Remaining tasks
drush generate
command to use PHP attributes instead of annotationsdrush:command-file
generatorThe big question is how to deliver this change. Here are a couple complications.
Basically there are two options.
drush generate
compatible with both DCG versions.