Skip to content

Commit 4ca732f

Browse files
authored
Merge pull request #1566 from andrewnicols/deprecationGeneral
Document template documentation
2 parents e8f7e5d + 9192fe0 commit 4ca732f

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

‎general/development/policies/deprecation/index.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ In an open source project, the end use of the codebase varies. People may have c
3434

3535
When we talk about Public APIs in Moodle, we are not referring to the `public` keyword in the method definition.
3636

37-
Instead we are considering how that API feature is used. Is that API feature intended to be, or is there a reasonable expectation that it may be, consumed in some reasonable way including:
37+
Instead we are considering how that API feature is used. Is that API feature intended to be, or is there a reasonable expectation that it may be, consumed in some reasonable way including:
3838

3939
- being called or accessed externally; or
4040
- being overridden in a class OOP sense.
4141

4242
:::
4343

44+
Deprecation applies to all Moodle code, including PHP, JavaScript, templates, React components, web services, and so on.
45+
46+
The Deprecation policy also applies when code is _changed_ in a way that may break other code. This includes the impact it may have upon areas such as themes, hook subscribers, callbacks, and child templates.
47+
4448
## Moodle Core deprecation process {/* #moodle-core-deprecation-process */}
4549

4650
Once it is decided that a function should be deprecated, a multi-step process should be followed.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Deprecation of templates
3+
tags:
4+
- deprecation
5+
---
6+
7+
The Mustache Templating system does not formally support any deprecation process, therefore the deprecation _process_ is slightly different, while the principle and intent is the same.
8+
9+
For templates and the output component of them, the deprecation policy primarily applies to the context information used to render the template, and passed into child templates.
10+
11+
The deprecation of Templates follows the same general principle as the deprecation of other Moodle code. That is:
12+
13+
- Breaking changes to a template have the same impact as a deprecation and should be considered in the same way
14+
- Deprecations should only be on the `main` branch, not on stables. Exceptions to this may be made in certain conditions, including:
15+
- where a feature is discovered to have been broken irreparably
16+
- to address security issues
17+
- All deprecations should be noted with an [upgrade note](../../upgradenotes.md).
18+
- Deprecations are split into three stages:
19+
1. Initial deprecation
20+
2. Final deprecation
21+
3. Removal

0 commit comments

Comments
 (0)