create-hozu 0.4.1 → 0.4.2
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/package.json +1 -1
- package/skill/reference.md +8 -3
package/package.json
CHANGED
package/skill/reference.md
CHANGED
|
@@ -41,9 +41,11 @@ export default implement<typeof Copy>(({ el, props, emit, signal }) => {
|
|
|
41
41
|
return { update(next) { props = next } }
|
|
42
42
|
})
|
|
43
43
|
```
|
|
44
|
-
`load`: `'eager' | 'visible' | 'idle'`; `wraps: true` keeps the children as server HTML.
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
`load`: `'eager' | 'visible' | 'idle'`; `wraps: true` keeps the children as server HTML.
|
|
45
|
+
**Serving them is a separate step.** Run `npm install @hozu/bundle`, then pass `widgets: await bundleWidgets(build)`
|
|
46
|
+
to `createServer` in `serve.ts` (and to `exportStatic`). Without it the server refuses to start; `hozu build` bundles
|
|
47
|
+
widgets itself. HZ029 is a client module that does not bundle. A library's own CSS goes in `app.css`
|
|
48
|
+
(`@import "leaflet/dist/leaflet.css";`), and a map or chart host needs a height class (`h-96`).
|
|
47
49
|
|
|
48
50
|
## Forms without JavaScript
|
|
49
51
|
A submit whose payload reads only `ui.dom.form('name')`, literals, context, params and search also works without JS
|
|
@@ -70,6 +72,9 @@ Every mutation also has the framework error `Invalid` = `{ message, fields }`: o
|
|
|
70
72
|
- `project({ notFound: route, error: route })` renders those pages for 404 / 500.
|
|
71
73
|
- A view listed with a machine on several pages, in the same order, stays mounted when links move between them
|
|
72
74
|
(see `patterns.md`).
|
|
75
|
+
- **JS per page is derived:** a page loads the client only when a machine-bound node renders on it. An island
|
|
76
|
+
inside `ui.each`, `ui.if`, `when` or a query branch loads it only on pages where it renders; `hozu plan <route>`
|
|
77
|
+
says `always` or `only when rendered`. Do not add views or flags to avoid JS.
|
|
73
78
|
|
|
74
79
|
## Sessions
|
|
75
80
|
- **Start from the scaffold:** `hozu add feature notes --page / --with auth` writes `features/account`
|