Skip to content

Commit 9bedd0e

Browse files
committed
- Fix English grammar and syntax
- Generalize for npm and Volto - Clean up MyST style and formatting
1 parent 25cb25b commit 9bedd0e

File tree

1 file changed

+44
-45
lines changed

1 file changed

+44
-45
lines changed
Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,86 @@
11
---
22
myst:
33
html_meta:
4-
"description": "Understanding deprecation in Plone - rationales, philosophy, and use cases."
5-
"property=og:description": "Understanding deprecation in Plone - rationales, philosophy, and use cases."
4+
"description": "Understanding deprecation in Plone - rationale, philosophy, and use cases"
5+
"property=og:description": "Understanding deprecation in Plone - rationale, philosophy, and use cases"
66
"property=og:title": "Deprecation"
7-
"keywords": "deprecation, Plone, Python, philosophy"
7+
"keywords": "deprecation, Plone, Python, Node.js, React, philosophy, rationale, use cases"
88
---
99

1010
(conceptual-deprecation-label)=
1111

1212
# Deprecation
1313

14-
This chapter describes rationales and philosophy of deprecations in Plone, Zope, and Python.
15-
It is meant as a guide on how to think about deprecations in Plone core packages.
14+
This chapter describes the rationale and philosophy of deprecations in Plone.
15+
It is meant as a guide for how to think about deprecations in Plone core packages.
1616

1717
```{seealso}
1818
For implementation details and code examples, see {doc}`/developer-guide/deprecation`.
1919
```
2020

21+
(why-deprecation-label)=
22+
2123

2224
## Why deprecation
2325

24-
At some point we:
26+
Developers may need to get rid of old code, unify to a consistent API style, fix typos in names, move code or templates around, resolve technical debt, address security issues, or adapt to changes in external dependencies.
2527

26-
- need to get rid of old code,
27-
- want to unify API style (consistent API),
28-
- fix typos in namings,
29-
- move code or templates around (inside package or to another package).
28+
When refactoring code, it's often necessary to move modules, functions, classes, and methods.
29+
It's critical not to break third party code imports from the old place.
30+
It's also important that usage of old functions or methods must work for a while to allow developers to migrate or update their code.
3031

31-
While refactoring code, moving modules, functions, classes and methods is often needed.
32-
To not break third party code imports from the old place or usage of old functions/ methods must work for while.
3332
Deprecated methods are usually removed with the next major release of Plone.
33+
Plone follows the [semantic versioning guideline](https://semver.org).
3434

35-
Following the [semantic versioning guideline](https://semver.org) is recommended.
3635

36+
## Help programmers without annoyance
3737

38-
## Help programmers, no annoyance
38+
Developers should use code deprecations to support the consumers of the code, that is, their fellow Plone developers.
39+
From the consumer's point of view, Plone core code is an API.
40+
Any change may annoy them, but they feel better when deprecation warnings tell them how to adapt their code to the changes.
3941

40-
The developers should use code deprecations to support the consumers of the code.
41-
From their point of view, Plone core code is an API to them.
42-
Any change is annoying to them anyway, but they feel better if deprecation warnings are telling them what to do.
42+
Deprecations must always log at the level of warning.
4343

44-
Deprecations must always log at level *warning* and have to answers the question:
44+
Deprecations should always answer the following questions.
4545

46-
**"Why is the code gone from the old place? What to do instead?"**
46+
- Why is the code gone from the old place?
47+
- What to do instead?
4748

48-
A short message is enough., i.e.:
49+
A short message is enough, such as the following examples.
4950

50-
- "Replaced by new API xyz, found at abc.cde".,
51-
- "Moved to xyz, because of abc.",
52-
- "Name had a typo, new name is "xyz".
51+
- "Replaced by new API `xyz`, found at `abc.cde`".
52+
- "Moved to `xyz`, because of `abc`".
53+
- "Name had a typo, new name is `xyz`".
5354

54-
All logging has to be done once, i.e. on first usage or first import.
55+
All logging must be done only once, in other words, on the first usage or import.
5556
It must not flood the logs.
5657

5758

5859
## Use cases
5960

60-
Renaming
61-
62-
: We may want to rename classes, methods, functions or global or class variables in order to get a more consistent API or because of a typo, etc.
63-
We never just rename, we always provide a deprecated version logging a verbose deprecation warning with information where to
64-
import from in future.
65-
66-
Moving a module, class, function, etc to another place
61+
The following use cases describe when to deprecate.
6762

68-
: For some reason, i.e. merging packages, consistent API or resolving cirular import problems, we need to move code around.
69-
When imported from the old place it logs a verbose deprecation warning with information where to import from in future.
63+
Rename
64+
: Developers may want to rename classes, methods, functions, or global or class variables to get a more consistent API or because of a typo.
65+
Never just rename.
66+
Always provide a deprecated version that logs a verbose deprecation warning with information for where to import from in the future.
7067

71-
Deprecation of a whole package
68+
Move objects
69+
: For reasons described in {ref}`why-deprecation-label`, developers may need to move code around.
70+
When imported from the old place, it logs a verbose deprecation warning with information of where to import from in the future.
7271

73-
: A whole [package](https://docs.python.org/3/tutorial/modules.html#packages)
72+
Deprecation of a whole Python or npm package
73+
: A whole {ref}`Python package <python:tut-packages>` or [npm package](https://www.npmjs.com/) may be moved to a new location.
7474

75-
- all imports still working, logging deprecation warnings on first import
76-
- ZCML still exists, but is empty (or includes the zcml from the new place if theres no auto import (i.e. for meta.zcml).
75+
- All imports still work.
76+
- Log deprecation warnings on first import.
77+
- The ZCML still exists, but is empty or includes the ZCML from the new place, if there's no auto import for `meta.zcml`.
7778

78-
Deprecation of a whole released/ installable package.
79-
80-
: We will provide a last major release with no 'real' code, only backward compatible (bbb) imports of public API are provided.
81-
This will be done the way described above for a whole package.
82-
The README clearly states why it was moved and where to find the code now.
79+
Deprecation of a whole released or installable package
80+
: Plone developers provide a major release with no "real" code, but only backward compatible imports of the public API.
81+
This will be done the way described above for a whole package.
82+
The README clearly states why it was moved and where to find the code now.
8383

8484
Deprecation of a GenericSetup profile
85-
86-
: They may got renamed for consistency or are superfluos after an update.
87-
Code does not need to break to support this.
85+
: These may have been renamed for consistency or are superfluous after an update.
86+
Code does not need to break to support this.

0 commit comments

Comments
 (0)