Follow-up to #2873395: [meta] Add @internal to core classes, methods, properties
Problem/Motivation
https://www.drupal.org/core/d8-bc-policy#plugins
Particular plugin classes should not be considered part of the public API. References to plugin IDs and settings in default configuration can be relied upon however.
Some plugins that fall under this rule are being used by contrib. since they are useful to extend: CTools, Better Exposed Filters, MetaTag, Display Suite, Search API among others.
Proposed resolution
Add @internal tag to the Plugin classes
How to fix thisissue
- Read the description for a category in its issue
- Identify and confirm an example. Ask in IRC if unclear.
- Search core for the relevant category.
- Add @internal per the backwards compatibility policy.
- Reviewers should confirm that each @internal mention is appropriate for that category according to the policy.
Remaining tasks
Make the Patch and post it
User interface changes
None.
API changes
There should be no implicit API changes.
Comments
Comment #2
mradcliffeI think an exception needs to be made for particular views plugins.
It would be a pain in the butt to not be able to rely on ManyToOne or InOperator, which are valid views filter plugins, but really useful to extend as a contrib maintainer.
Perhaps there are some "base" views plugins that need to be marked as @api instead?
Comment #3
mradcliffeAn alternative would be to add the useful code into traits, and then mark those plugins as @internal but provide the traits as @api.
Comment #5
chenderson CreditAttribution: chenderson commentedI am working on this at DrupalCon Vienna
Comment #6
yogen.prasad CreditAttribution: yogen.prasad commentedI am working on this issue at DrupalCon Vienna 2017
Comment #7
mradcliffeTo expand on my suggestion above,
Basically, as I was reviewing the issue and looking at all the views plugins that we would mark @internal per policy, I thought back to how I developed contrib / custom modules, and how useful it was for me to extend off of views module's handler and plugin classes.
For instance I often found myself as a developer extending views_many_to_one and views_in_operator classes so that I did not need to rewrite some of the same functionality.
The same could be considered for some of the more basic filter, argument, and field plugins in views for Drupal 8.
I am not sure whether the correct approach is to make those classes a part of the API or mark them @internal in this issue and then follow-up to provide a way for contrib. and custom module developers to extend based on traits.
Comment #8
tedbowI do have the same concern as @mradcliffe. I am sure I would have done the same thing.
I took a quick look at Ctools and found that it is doing this, also Better Exposed Filters.
MetaTag
Display Suite
Search API, many times
I guess we could take this 2 ways.
Not sure
Comment #9
mradcliffeIn #2873696: Add @internal to core form classes, methods, and properties, I also brought it up as I was reviewing the patch, and we ended up not adding @internal to non-base form classes such as EntityForm and ContentEntityForm, but we did to EntityDeleteForm since there are base classes for confirmation forms.
We should probably explicitly add @api to these plugins since the policy still applies, and probably add it to those we did not add in #2873696: Add @internal to core form classes, methods, and properties.
Comment #10
tedbowTagging this for subsystem maintainer review