Skip to content

Commit e1a2f86

Browse files
jzempelgeotrev
andauthored
doc(adrs): add theming peer dependency ADR-001 (#1560)
Co-authored-by: George Treviranus <3946669+geotrev@users.noreply.github.com>
1 parent d9d3ab0 commit e1a2f86

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ the links below to learn more.
165165
- Major release [migration](docs/migration.md) instructions
166166
- Component [API](docs/api.md)
167167
- [Development](docs/development.md) guidelines
168+
- Architectural [decision](docs/adrs/#readme) records
168169

169170
## Contribution
170171

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# ADR-001: Theming peer dependency
2+
3+
2023.04.24
4+
5+
## Context
6+
7+
Garden provides a collection of React components through multiple NPM packages.
8+
Each package has peer dependencies for `@zendeskgarden/react-theming`, `react`,
9+
`react-dom`, and `styled-components`. Typically, a package should increase its
10+
major version when there is a change in its peer dependency requirements.
11+
However, Garden proposes a DECISION to deviate from this [general
12+
rule](https://nodejs.org/en/blog/npm/peer-dependencies) and allow special
13+
treatment for `@zendeskgarden/react-theming`.
14+
15+
While this decision conflicts with [semantic versioning](https://semver.org/),
16+
it benefits both maintainers and consumers by enabling a centralized, tested
17+
collection of hooks and utilities across the codebase. As a result, consumers
18+
are not required to ingest duplicated and more brittle code. A terminal warning
19+
will notify the consumer if a peer version is out-of-date.
20+
21+
Ideally, all Garden package versions should align. However, at the very least,
22+
the `@zendeskgarden/react-theming` peer dependency should align with the highest
23+
version of a Garden component package dependency.
24+
25+
## Decision
26+
27+
As [centralized theming
28+
utilities](https://garden.zendesk.com/components/utilities) are added or
29+
modified (in non-breaking fashion), other Garden component packages may take
30+
advantage of them by updating their `@zendeskgarden/react-theming` peer dependency
31+
minor version without publishing a major version breaking change.
32+
33+
## Consequences
34+
35+
If a consumer upgrades a single Garden component package, they may see a console
36+
warning indicating that the `@zendeskgarden/react-theming` package is
37+
out-of-date. If the warning is ignored, there is a high likelihood that
38+
component rendering will fail due to a missing theming utility. However, there
39+
is no reason to believe that such a failure could slip through to production.

docs/adrs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Architectural Decision Records
2+
3+
Garden architectural decison records (ADRs) capture important decisions made,
4+
along with context and consequences.
5+
6+
- [ADR-001](./001-theming-peer-dependency.md): Theming peer dependency

0 commit comments

Comments
 (0)