Problem/Motivation
This is a meta issue to organize child issues for applying the Drupal 8 core backwards compatibility policy: https://www.drupal.org/core/d8-bc-policy.
Proposed resolution
Done when all child issues are complete.
Each child issue should apply to each of the following areas on the policy page:
Novice categories that can be done quickly
- Tests
- Controllers and Form classes
- Plugins
- Entity handlers
- Param converters
- Access checkers
- Event Subscribers
- JavaScript classes
- Constructors for service objects
- Constructors for plugins
- Constructors for controllers (Is this duplicated by the controller class task above?)
- Protected methods
- Protected properties
- Public properties
- Public methods
- Underscore-prefixed functions and methods
Categories that need more time and review
- PHP classes
- The Installer: install global functions, install tasks, and classes.
- Hook implementations
How to fix each child issue
- 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.
- Using PHPStorm's subclass hinting feature. Go to relevant base class (e.g.
core/lib/Drupal/Core/Form/FormBase.php) and search for all usages. - Add @internal to subclasses that are not base classes. If there is no DocBlock, create one.
- Using PHPStorm's subclass hinting feature. Go to relevant base class (e.g.
- 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
- Create child issues. Each issue should:
- Contain the description of the category in the issue description
- A link to the this issue and a link to the backwards compatibility policy: https://www.drupal.org/core/d8-bc-policy
- Tag issue as Novice if the category is listed in the Novice section above.
User interface changes
None.
API changes
There should be no implicit API changes.
Comments
Comment #2
mradcliffeThe meta issue should be a plan and not a task because it is not actionable.
Comment #3
mradcliffeAdding a bit of description for how to approach each issue so that the child issues can link to the meta issue.
Comment #4
mradcliffe@xjm gave a review of the issue so far.
1. We should be explicit in the descriptions of the categories in the child issues and add that to the instructions for creating child issues and for fixing child issues.
2. Split into novice / not-novice
3. Find and identify an example of the change for novices so that we can confirm what is done.
I added hook implementations as a non-novice task for now because it is not technically in the policy yet, but it should be according to @catch and @xjm.
The controller constructor and controller classes may be duplicate. Shouldn't controller class @internal apply to all methods as well?
Comment #5
heddnAdding at least a single example sub issue would be super helpful. We could use it as a clone then.
Comment #6
nvexler commented@heddn I'd totally agree with an example being useful. I'm currently working on https://www.drupal.org/comment/12060517/ and could use an example.
Comment #7
mradcliffeAdded @nvexler's tips to the issue summary.
Comment #8
nvexler commentedMade some minor fixes to the instructions. Right on @mradcliffe for adding the instructions I wrote up :). Props also to @naveenvalecha since it was his idea in the first place.
Comment #10
webchickI have perhaps what is a very silly question but... if we don't want things to be part of the public API, why are we indicating this by adding specially-formatted comments, and not by explicitly declaring those things as
privatelike is standard in other OO code in other languages (and shows up in standard IDEs, etc.)? I guess cos it would break BC to do it now? Something to do in 9, potentially?Comment #11
mile23The point of the annotation is to show that even if a method is public, it isn't necessarily part of the API. So if you call something marked
@internal, your code might break later.It's similar to
@deprecated, except you should think of it as already gone. :-)Also:
privateonly says that the method can't be called from another class context, not that the code is considered an implementation detail of an API. And, for some reason Drupal culture says we can't useprivatein core anyway.Comment #14
joachim commentedGiven that https://www.drupal.org/core/d8-bc-policy still says that it's not yet official policy, is it wise to go ahead with marking things as @internal in the code? Shouldn't we agree on the policy first?
Comment #15
xjm@joachim: Sorry, missed that comment back when you posted it. In practice, the policy is official and has been for years. I'll reword that part of the doc. Edit: Actually it looks like I already fixed the doc several months ago, but did not document that here. :)