Skip to content

Commit 804e605

Browse files
committed
improve convention node on controller suffixes
1 parent 8975e8d commit 804e605

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/_guide/conventions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ subtitle: Conventions
55

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

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

10-
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/).
10+
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.
1111

1212
```typescript
1313
@controller

0 commit comments

Comments
 (0)