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
-**JS pages**: exported vars → page.vars.js → postVars
1445
1445
-**postVars** - Post-processing function that can modify variables based on all resolved data
1446
1446
1447
+
### Watch Mode Flow
1448
+
1449
+
Watch mode (`domstack watch` / `DomStack.watch()`) performs an initial build using watch-mode esbuild (stable, non-hashed output filenames) and then keeps the site up to date as files change.
1450
+
1451
+
#### File change decision tree
1452
+
1453
+
When a file changes under `src`, the chokidar watcher applies this decision tree (first match wins):
1454
+
1455
+
| File pattern | Action |
1456
+
|---|---|
1457
+
|`global.vars.*`| Full page rebuild (all pages) |
1458
+
|`esbuild.settings.*`| Restart esbuild context + full page rebuild |
1459
+
|`markdown-it.settings.*`| Rebuild `.md` pages only |
1460
+
| Layout file | Rebuild pages using that layout |
1461
+
| Dep of a layout | Rebuild pages using any affected layout |
1462
+
| Page file or `page.vars.*`| Rebuild that page + all `postVars` pages |
1463
+
|`*.template.*`| Rebuild that template only |
1464
+
| Layout CSS/client JS | esbuild watches these itself; its `onEnd` triggers a full page rebuild |
1465
+
| (no match) | Skip |
1466
+
1467
+
File additions and deletions always trigger a **full structural rebuild**: re-run `identifyPages`, restart the esbuild context, rebuild all pages, and rebuild the watch maps.
cpx watchers handle static asset copying independently and do not trigger page rebuilds.
1474
+
1475
+
#### `postVars` contagion
1476
+
1477
+
Pages that export a `postVars` function depend on other pages' resolved data. After each full (unfiltered) page build, domstack records which pages used `postVars`. When any page file or vars file subsequently changes, those `postVars` pages are re-rendered alongside the changed page so their cross-page data stays current.
1478
+
1447
1479
## Roadmap
1448
1480
1449
-
`domstack` works and has a rudimentary watch command, but hasn't been battle tested yet.
1450
-
If you end up trying it out, please open any issues or ideas that you have, and feel free to share what you build.
1481
+
`domstack` is working and actively developed. If you end up trying it out, please open any issues or ideas that you have, and feel free to share what you build.
1451
1482
1452
1483
Some notable features are included below, see the [roadmap](https://github.com/users/bcomnes/projects/3/) for a more in depth view of whats planned.
1453
1484
@@ -1488,6 +1519,7 @@ Some notable features are included below, see the [roadmap](https://github.com/u
1488
1519
-[x] markdown-it.settings.ts support
1489
1520
-[x] page-worker.worker.ts page worker support
1490
1521
-[x]`page.md` page support
1522
+
-[x] Progressive watch rebuilds (only rebuild affected pages on change)
0 commit comments