Skip to content

Commit a071d4f

Browse files
committed
[docs] Reduce duplication and apply style fixes
1 parent e41613e commit a071d4f

File tree

2 files changed

+29
-108
lines changed

2 files changed

+29
-108
lines changed

docs/apis/plugintypes/index.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,18 @@ foreach ($pluginman->get_plugin_types() as $type => $dir) {
139139
When a plugin or subplugin type is no longer needed or is replaced by another plugin type, it should be deprecated.
140140
Using `components.json` or `subplugins.json` plugin types and subplugin types, respectively, can be marked as deprecated.
141141

142-
The process for plugin/subplugin type deprecation differs slightly to normal [Deprecation](/general/development/policies/deprecation) process.
142+
The process for plugin and subplugin type deprecation differs slightly to the normal [Deprecation](/general/development/policies/deprecation) process.
143143
Unlike with code deprecation, where the deprecated class or method is usually expected to remain functional during the deprecation window, deprecated plugin/subplugin types are treated as end-of-life as soon as they are deprecated.
144144

145-
Once deprecated, core will exclude plugins of the respective plugin type when performing common core-plugin communication, such as with hooks, callbacks, events, etc.
146-
In the case of subplugins, the expectation is that the component code (the component under which the subplugins reside), will have been updated and all references to the subplugins removed/replaced, before the time of deprecation.
145+
Once deprecated, core will exclude plugins of the respective plugin type when performing common core-plugin communication, such as with hooks, callbacks, events, and-so-on.
146+
In the case of subplugins, the subplugin owner (the component which the subplugin belongs to), **must** have been updated to remove or replace all references to the subplugins before the time of deprecation.
147147

148148
Class autoloading and string resolution is still supported during the deprecation window, to assist with any plugin migration scripts that may be required.
149149

150150
:::info limitations
151-
Whilst both plugin and subplugin types can be deprecated, only those plugin types _not_ supporting subplugins can be deprecated presently.
151+
152+
Whilst both plugin and subplugin types can be deprecated, only those plugin types which do _not_ support subplugins can be deprecated.
153+
152154
:::
153155

154156
### Deprecation process
@@ -159,18 +161,34 @@ Deprecation follows a 3 stage process:
159161
2. The plugin/subplugin type is marked as deleted (a core version bump is also required).
160162
3. Final removal of the plugin/subplugin type from the respective config file.
161163

162-
During first stage deprecation, plugins of the respective type may remain installed, but are deemed end-of-life. This stage gives admins time to remove the affected plugins from the site, or migrate them to their replacement plugins.
164+
#### First stage deprecation
165+
166+
During first stage deprecation, plugins of the respective type may remain installed, but are deemed end-of-life.
167+
168+
This stage gives administrators time to remove the affected plugins from the site, or migrate them to their replacement plugins.
169+
170+
#### Second stage deprecation
171+
172+
The second stage deprecation is the deletion phase.
173+
174+
If any affected plugins are still present (that is any which have not been uninstalled or migrated yet), the site upgrade will be blocked.
163175

164-
In second stage deprecation (deletion), if any affected plugins are still present (i.e. have not been uninstalled/migrated yet) site upgrade will be blocked. These plugins must be removed before continuing with site upgrade.
176+
These plugins **must** be removed before continuing with site upgrade.
165177

166-
In final stage deprecation (final removal), the relevant config changes supporting first and second stage deprecation can be removed from the respective config files. This removes the last reference to these plugin/subplugin types.
178+
#### Final deprecation
179+
180+
In the final deprecation stage the relevant configuration changes supporting first and second stage deprecation can be removed from the respective config files. This removes the last reference to these plugin/subplugin types.
167181

168182
### Deprecating a plugin type
169183

170-
To mark a plugin type as deprecated or deleted, edit `lib/components.json`, remove the plugin type from the `plugintypes` object and add it to `deprecatedplugintypes`. To mark a plugin type for stage 2 deprecation (deletion), edit the same file and move the plugin type from the `deprecatedplugintypes` object to the `deletedplugintypes` object.
184+
The first phase of plugin type deprecation involves describing the plugin in the `deprecatedplugintypes` configuration in `lib/components.json`. The plugin type must also be removed from the `plugintypes` object.
185+
186+
The second phase of plugin type deprecation involves moving the entry from the `deprecatedplugintypes` object to the `deletedplugintypes` object.
171187

172188
:::info Remember
189+
173190
Don't forget to increment the core version number when marking a plugin/subplugin type for either deprecation or deletion. A version bump isn't needed for final removal.
191+
174192
:::
175193

176194
:::tip Example of plugin type deprecation config values
@@ -229,7 +247,9 @@ To mark a subplugin type as deprecated, edit the component's `subplugins.json` f
229247
Following deletion, the plugin/subplugin type can be removed from the respective JSON entirely.
230248

231249
:::info Remember
250+
232251
Don't forget to increment the core version number when marking a plugin/subplugin type for either deprecation or deletion. A version bump isn't needed for final removal.
252+
233253
:::
234254

235255
:::tip Example of subplugin type deprecation config values

docs/devupdate.md

Lines changed: 1 addition & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -120,103 +120,4 @@ Please see the [PHPUnit 11 Upgrade Guide](/general/development/tools/phpunit/upg
120120

121121
<Since version="5.0" issueNumber="MDL-79843" />
122122

123-
A new process for plugin type and subplugin type deprecation has been introduced.
124-
125-
Using `components.json` or `subplugins.json` plugin types and subplugin types, respectively, can be marked as deprecated or deleted.
126-
127-
:::info
128-
Plugin/subplugin type deprecation doesn't follow the same rules as code deprecation. Core considers deprecated plugins as end-of-life and will omit them from many core APIs. Things like hooks, callbacks and events will not include/call plugins of a deprecated type.
129-
:::
130-
131-
Deprecation follows a 3 stage process:
132-
133-
1. The plugin/subplugin type is marked as deprecated (a core version bump is also required).
134-
2. The plugin/subplugin type is marked as deleted (a core version bump is also required).
135-
3. Final removal of the plugin/subplugin type from the respective config file.
136-
137-
:::info Limitations
138-
Currently, only those plugin types _not_ supporting subplugins can be deprecated.
139-
:::
140-
141-
During first stage deprecation, plugins of the respective type may remain installed, but are deemed end-of-life. This stage gives admins time to remove the affected plugins from the site, or migrate them to their replacement plugins.
142-
143-
In second stage deprecation (deletion), if any affected plugins are still present (i.e. have not been removed/uninstalled yet) site upgrade will be blocked. These plugins must be removed at this time to continue.
144-
145-
In final stage deprecation (final removal), the relevant config changes supporting first and second stage deprecation can be removed from the respective config files. This removes the last reference to these plugin/subplugin types.
146-
147-
:::tip Example of the new plugin/subplugin type deprecation config values
148-
149-
To mark a plugin type as deprecated in `components.json`, the plugin type should be removed from the `plugintypes` object, and added to a new `deprecatedplugintypes` object.
150-
151-
```json title="lib/components.json demonstrating first stage deprecation of a plugin type"
152-
{
153-
"plugintypes": {
154-
...
155-
},
156-
"subsystems": {
157-
...
158-
},
159-
"deprecatedplugintypes": {
160-
"aiplacement": "ai/placement"
161-
}
162-
}
163-
```
164-
165-
To mark a subplugin type as deprecated in a component's `subplugins.json`, the subplugin type should be removed from the `subplugintypes` object, and added to a new `deprecatedsubplugintypes` object.
166-
167-
```json title="mod/lti/db/subplugins.json demonstrating first stage deprecation of a subplugin type"
168-
{
169-
"subplugintypes": {
170-
},
171-
"deprecatedsubplugintypes": {
172-
"ltiservice": "service",
173-
"ltisource": "source"
174-
}
175-
}
176-
```
177-
178-
To mark a plugin type as deleted in `components.json`, the plugin type should be removed from the `deprecatedplugintypes` object, and added to a new `deletedplugintypes` object.
179-
180-
```json title="lib/components.json demonstrating second stage deprecation (deletion) of a plugin type"
181-
{
182-
"plugintypes": {
183-
...
184-
},
185-
"subsystems": {
186-
...
187-
},
188-
"deprecatedplugintypes": {
189-
},
190-
"deletedplugintypes": {
191-
"aiplacement": "ai/placement"
192-
}
193-
}
194-
```
195-
196-
To mark a subplugin type as deleted in a component's `subplugins.json`, the subplugin type should be removed from the `deprecatedsubplugintypes` object, and added to a new `deletedsubplugintypes` object.
197-
198-
```json title="mod/lti/db/subplugins.json demonstrating second stage deprecation (deletion) of a subplugin type"
199-
{
200-
"deprecatedsubplugintypes": {
201-
},
202-
"deletedsubplugintypes": {
203-
"ltiservice": "service",
204-
"ltisource": "source"
205-
}
206-
}
207-
```
208-
209-
Third stage deprecation just removes the plugin/subplugin type from the respective `deletedplugintypes` or `deletedsubplugintypes` objects. If these objects are empty, they may also be removed entirely.
210-
211-
```json title="lib/components.json demonstrating final stage deprecation of a plugin type. The process is the same for subplugin types."
212-
{
213-
"plugintypes": {
214-
...
215-
},
216-
"subsystems": {
217-
...
218-
},
219-
}
220-
```
221-
222-
:::
123+
A new process for plugin type and subplugin type deprecation has been introduced. See [the Plugin Type deprecation](./apis/plugintypes/index.md#deprecating-a-plugin-type) and [Subplugin deprecation](./apis/plugintypes/index.md#deprecating-a-subplugin-type) documentation for further information.

0 commit comments

Comments
 (0)