create-foldkit-app 0.23.2 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/examples.js +6 -0
- package/package.json +1 -1
- package/templates/base/AGENTS.md +2 -0
package/dist/examples.js
CHANGED
|
@@ -12,6 +12,7 @@ export const EXAMPLE_VALUES = [
|
|
|
12
12
|
'charting',
|
|
13
13
|
'routing',
|
|
14
14
|
'route-transitions',
|
|
15
|
+
'view-transitions',
|
|
15
16
|
'interrupting-commands',
|
|
16
17
|
'query-sync',
|
|
17
18
|
'snake',
|
|
@@ -95,6 +96,11 @@ export const examples = [
|
|
|
95
96
|
title: 'route-transitions',
|
|
96
97
|
description: 'Live transition log with entry, exit, and stayed navigation policies',
|
|
97
98
|
},
|
|
99
|
+
{
|
|
100
|
+
value: 'view-transitions',
|
|
101
|
+
title: 'view-transitions',
|
|
102
|
+
description: 'Shared-element morphs and direction-aware route animations via the View Transitions API',
|
|
103
|
+
},
|
|
98
104
|
{
|
|
99
105
|
value: 'interrupting-commands',
|
|
100
106
|
title: 'interrupting-commands',
|
package/package.json
CHANGED
package/templates/base/AGENTS.md
CHANGED
|
@@ -56,6 +56,8 @@ Every view receives `h`, the typed Html builder, as its last parameter (`view: (
|
|
|
56
56
|
|
|
57
57
|
Keys are for mapped list items only: key each row by a stable Model identifier (`h.keyed('li')(item.id, [], [...])`), never by array position, and never derive a key from displayed data. Never key branches; the build gives each view function's output its own identity, so branch switches replace DOM automatically. When switching an inline same-tag ternary must reset DOM state, extract each arm into its own named view function.
|
|
58
58
|
|
|
59
|
+
Omit the children argument when an element has none: `h.div([h.Class('divider')])`, never `h.div([h.Class('divider')], [])`. The same holds for `keyed`: `h.keyed('li')(key, [attrs])`, never `h.keyed('li')(key, [attrs], [])`. Attributes stay required on element builders, so `h.div([])` is an element with neither. Sibling elements that end up at different arities are expected and fine; void elements like `h.img` have always read that way.
|
|
60
|
+
|
|
59
61
|
### Commands
|
|
60
62
|
|
|
61
63
|
Define a Command with `Command.define(name, { args, messages, execute })`; omit `args` when the Command takes none. Assign definitions to PascalCase constants. Never inline in pipe chains. Name the effect `execute` performs, not the later Model transition caused when update handles its result: a timer that only waits before update starts a dismissal is `WaitBeforeDismissal`, not `DismissAfter`. Commands catch all errors via `Effect.catch(() => Effect.succeed(FailedX(...)))` so side effects never crash the app. Definitions live colocated with the update function that returns them.
|