Skip to content

Commit 1006b8c

Browse files
committed
improve convention node on controller suffixes
1 parent 27b53f0 commit 1006b8c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/_guide/conventions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ subtitle: Common naming and patterns
77

88
Catalyst strives for convention over code. Here are a few conventions we recommend when writing Catalyst code:
99

10-
### Use `Element` or `Component` to suffix your controller class
10+
### Suffix your controllers consistently, for symmetry
1111

12-
Built in HTML elements all extend from the `HTMLElement` constructor, and are all suffixed with `Element` (for example `HTMLElement`, `SVGElement`, `HTMLInputElement` and so on). Catalyst components can be suffixed with `Element`, `Component` or `Controller`. We think elements should behave as closely to the built-ins as possible, so we like to use `Element`, but the other suffixes might be useful for symettry with other server side comoponent frameworks such as [ViewComponent](https://viewcomponent.org/).
12+
Catalyst components can be suffixed with `Element`, `Component` or `Controller`. We think elements should behave as closely to the built-ins as possible, so we like to use `Element` (existing elements do this, for example `HTMLDivElement`, `SVGElement`). If you're using a server side comoponent framework such as [ViewComponent](https://viewcomponent.org/), it's probably better to suffix `Component` for symmetry with that component framework.
1313

1414
```typescript
1515
@controller

0 commit comments

Comments
 (0)