You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: specifications/shorthand-api.md
+27-5Lines changed: 27 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,39 @@
5
5
6
6
7
7
-[Why?](#why)
8
+
-[DOM Structure](#dom-structure)
9
+
-[A Moving Target](#a-moving-target)
10
+
-[Ownership](#ownership)
11
+
-[Intuition & Effort](#intuition--effort)
8
12
-[Proposals](#proposals)
9
-
-[[Goal]](#goal)
13
+
-[Goal](#goal)
10
14
11
15
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
12
16
13
17
## Why?
14
18
15
-
## Proposals
19
+
### DOM Structure
20
+
21
+
In traditional UI libraries, developers are required to memorize or copy and paste specific various brittle HTML structures to use components. The developer should be focused on a higher level of describing features.
22
+
23
+
#### A Moving Target
24
+
25
+
These structures are often required for the component to work correctly. This makes them brittle and a common source of bugs. This is only exacerbated by the fact that different variations of the same component often require slightly different structures.
26
+
27
+
The component should own and isolate the brittle nature of required markup.
28
+
29
+
#### Ownership
16
30
17
-
### [Goal]
31
+
Developers require components to have certain styles and behaviors. Components may require a specific DOM structure to achieve those styles and behaviors. Therefore, component DOM structure is the concern and responsibility of the component, not the user.
32
+
33
+
### Intuition & Effort
34
+
35
+
When describing a component to another human we use natural language, we don't speak HTML. When defining a component via an API we should strive to use the same natural language. This frees the developer's mind to spend its effort creating actual features opposed to creating implementations of features.
36
+
37
+
Providing a high level API of natural language allows developers to use intuition and minimal effort to create features.
0 commit comments