Skip to content

Commit

Permalink
chore: add guideline how deprecations shall be handled (GetStream#1676)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlaz authored Jul 18, 2022
1 parent c85c29a commit 48d1913
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
22 changes: 21 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
module.exports = {
extends: ['@commitlint/config-conventional']
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
'deprecate',
],
],
},
};
3 changes: 2 additions & 1 deletion developers/COMMIT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
We follow [Angular's Commit Messag Format rules](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format). Even though these are curated sets of rules, the following represent our additions to them:
We follow [Angular's Commit Message Format rules](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format). Even though these are curated sets of rules, the following represent our additions to them:

## Commit message type

Expand All @@ -21,3 +21,4 @@ It must be one of the following:
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **test**: Adding missing tests or correcting existing tests
* **deprecate**: Certain parts or APIs are deprecated and scheduled for a removal in a newer major version
25 changes: 25 additions & 0 deletions developers/DEPRECATIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Deprecations

You can deprecate a feature or a component once:
1. an alternative exists.
2. the support for the given functionality is scheduled for termination

The deprecated component should be marked as follows:

```typescript jsx
/**
* @deprecated - This UI component will be removed in the next major release. This component is deprecated because <XY>.
* For more information see [docs link](https://....)
*
* FixedHeightMessage - This component renders a single message.
* It uses fixed height elements to make sure it works well in VirtualizedMessageList
*/
```

### How to deprecate?

1. Deprecated component:
1. does not receive an alternative -> update the documentation on how to implement the deprecated feature.
2. receives an alternative -> update the documentation on how to use the introduced alternative solution.
2. Commit the changes under `deprecate` commit type, with commit description stating the reasons for deprecation.
3. Create an issue, so it can be scheduled for removal in foreseeable future. Tag the issue with the label `breaking`.

0 comments on commit 48d1913

Please sign in to comment.