Skip to content
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

Update plugin generators to use PHP attributes #114

Closed
Chi-teck opened this issue Oct 28, 2023 · 5 comments
Closed

Update plugin generators to use PHP attributes #114

Chi-teck opened this issue Oct 28, 2023 · 5 comments

Comments

@Chi-teck
Copy link
Owner

Chi-teck commented Oct 28, 2023

Drupal now supports plugin discovery through PHP attributes.
https://www.drupal.org/project/drupal/issues/3252386

DCG generators needs to be updated to support this feature.

The main question is how implement this without breaking compatibility with Drupal 10.1.

Option 1
Add CLI option or question to each plugin generator to ask a user explicitely whether the plugin should use attributes instead of annotations.

Downside: A lot of work. Each plugin template will have if statements to support both types of discovery. Testing double implementation would be a nightmare.

Option 2
Use PHP attributes by default and convert them into annotations magically using AssetPreProcess event if Drupal version is below 10.2.

Downside: Testing is still hard.

Option 3
Release new DCG version (3.4) that only supports Drupal 10.2 and above.
Keep DCG 3.3 as LTS release till Drupal 10.1 is EOL.

Option 4
Do nothing. Just wait for Drupal 10.1 EOL (June, 2024) before starting work on this.

@andypost
Copy link
Contributor

I think you need to get rid of old way in separate branch and just throw error if core is incompatible

surely drush should align as well

@andypost
Copy link
Contributor

I think the option 3 but with 4.0 release

@andypost
Copy link
Contributor

also depending on version you can use templates vs templates_attributes directory

@weitzman
Copy link
Contributor

weitzman commented Mar 4, 2024

Looks like we are cruising along toward Option 4?

@Chi-teck
Copy link
Owner Author

Plugin generators will be updated in DCG 4.x. See #156 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants