Problem/Motivation
Currently, the set of properties for a particular plugin type is only defined in one place - previously the plugin type's annotation class, and now the plugin type's attribute class.
This leads to some problems, such as:
- The long-standing problem where the EntityType annotation/attribute defines a 'field_ui_base_route' which is actually for field_ui, an optional module
- The long-standing feature needed for Views, where we'd like to add a property to FieldType plugins for Views, which is, again, an optional module -- #2337515: Allow @FieldType to customize views data
Proposed resolution
Allow supplementary third-party modules attributes on plugins. e.g.:
#[FieldType(
id: 'myfieldtype',
)]
#[ViewsFieldType(
views_data_provider: 'SomeClass',
)]
class MyFieldType {}
The discovery system should NOT allow a 3rd-party plugin attribute to replace a property in the main attribute, unless there is a deprecation marked.
Remaining tasks
User interface changes
None.
API changes
Modules can define attributes for plugin types they do not invent. They can then retrieve values for these properties for plugins from plugin definitions as normal.