[meta] Introduce specific annotations for each plugin type

Created on 10 April 2013, about 12 years ago
Updated 7 February 2024, about 1 year ago

Problem/Motivation

  • @Plugin is a dumping ground for metadata, and is often used for configuration, not metadata (information that is only useful once you have an instantiated plugin)
  • It also conveys no information to those looking at a plugin implementation
  • It provides no place to document the keys used by that particular annotation
  • Improved DX because we're putting an emphasises on the domain instead of the "system". I don't need to know that Entity types are plugins, I just need to know what metadata I need to provide for my EntityType.
  • Opportunity for custom validation/mapping in the constructor of the custom annotation class. I'd assume this is possible somehow with Plugins already, but doing it in the annotation class that you own is very intuitive and simple.

Proposed resolution

Introduce @PluginID for those that only need a plugin ID (Views handlers, Tour tips, eventually many basic ones in contrib)
Force any complex annotations to be custom classes, so they can be properly documented and discoverable.
For example, instead of @Plugin, have @EntityType.

@Plugin can be left in core for contrib, and might be extended by core annotations, but should not be used at all in core once this is done

Remaining tasks

Open issues for each plugin type

User interface changes

N/A

API changes

None yet

Sub Issues

Beta phase evaluation

🌱 Plan
Status

Fixed

Version

9.5

Component
PluginΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024