@iterant/site-runtime 3.8.2 → 3.9.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.
@@ -50,7 +50,7 @@ runtime and says so.
50
50
 
51
51
  <!-- generated: available libraries -->
52
52
 
53
- _Generated from package.json by scripts/generate-kit-table.mjs. Runtime 3.8.2._
53
+ _Generated from package.json by scripts/generate-kit-table.mjs. Runtime 3.9.0._
54
54
 
55
55
  **Toolchain** (this package owns the version; do NOT declare these):
56
56
 
@@ -617,13 +617,27 @@ The layout preloads the upright latin face of each named family and nothing
617
617
  else. Every face stays in the `@font-face` block, so the browser still fetches a
618
618
  slanted or extended-latin one the moment a glyph needs it.
619
619
 
620
- **`src/site-config.ts` is watched.** Astro restarts its dev server on its own
621
- config file, `package.json` and the tsconfig sources, and on nothing else, so a
622
- family added to `SITE_CONFIG.fonts` would be rendered by the layout while Astro
623
- had never resolved it. The preset adds the file to `settings.watchFiles`
624
- (`site-config-watch`), which makes the change restart the server and reach the
625
- font declarations. A repo that keeps its site config elsewhere passes
626
- `iterantStarter({ siteConfigPath })`.
620
+ **`src/site-config.ts` is watched in list mode.** Astro restarts its dev server
621
+ on its own config file, `package.json` and the tsconfig sources, and on nothing
622
+ else, so a family added to `SITE_CONFIG.fonts` would be rendered by the layout
623
+ while Astro had never resolved it. The preset adds the file to
624
+ `settings.watchFiles` (`site-config-watch`), which makes the change restart the
625
+ server and reach the font declarations. A repo that keeps its site config
626
+ elsewhere passes `iterantStarter({ siteConfigPath })`.
627
+
628
+ **Under `fonts: "catalog"` the preset registers no restart watch on it; Vite
629
+ still watches it as a source module.** Every
630
+ family is declared at boot, so a family written into `SITE_CONFIG.fonts` after
631
+ that is one Astro already resolved, and the layout picks it up on the first
632
+ render after the module's hot update has been processed. The site config is then outside the Astro
633
+ config's import graph too, since the config no longer reads it, so no write of
634
+ it restarts the server. That is the mode the platform's own starters run: the
635
+ direction pick writes the file on every first build, and the restart it used to
636
+ cause cost 11.7s of preview outage, ending in a re-attach the customer saw as
637
+ the waking card (measured 2026-09-12). The boot pays 6.3s of font resolution
638
+ instead of 1.2s on a cold tree, and nothing on a tree whose `.astro/fonts` cache
639
+ came with it and whose metadata is under seven days old (Astro refreshes the
640
+ metadata after that, through the cache's own files).
627
641
 
628
642
  ### The browser floor
629
643
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iterant/site-runtime",
3
- "version": "3.8.2",
3
+ "version": "3.9.0",
4
4
  "type": "module",
5
5
  "description": "The platform layer every Iterant brand site runs on: content grammar, collection schemas, SEO head and JSON-LD, layout core, Astro config preset, dev integrations and the verify gates.",
6
6
  "scripts": {
@@ -89,6 +89,11 @@ const FONT_SUBSETS: NonEmpty<string> = ["latin", "latin-ext"];
89
89
  * render a face Astro never resolved. `site-config-watch` makes that restart
90
90
  * happen, and these eleven make it unnecessary for the common pick.
91
91
  *
92
+ * `"catalog"` takes the other road: with every family declared, nothing the
93
+ * platform writes into SITE_CONFIG.fonts can name a face Astro did not resolve,
94
+ * so the site config leaves the dev server's restart list entirely and a
95
+ * direction pick reaches the page as a hot update instead of a reboot.
96
+ *
92
97
  * A name the catalog does not carry is skipped rather than declared: Astro's
93
98
  * `<Font>` throws on a CSS variable no family registered, and the layout reads
94
99
  * the same catalog to decide what to render.
@@ -163,9 +168,12 @@ export interface IterantStarterOptions {
163
168
  */
164
169
  fonts?: readonly string[] | "catalog";
165
170
  /**
166
- * The repo's site config module, relative to the project root. Watched, so a
167
- * change to `SITE_CONFIG.fonts` restarts the dev server and reaches the font
168
- * declarations; the preset does not import the file, it only names it.
171
+ * The repo's site config module, relative to the project root. In list mode
172
+ * it is watched, so a change to `SITE_CONFIG.fonts` restarts the dev server
173
+ * and reaches the font declarations; the preset does not import the file, it
174
+ * only names it. Under `fonts: "catalog"` the preset registers no restart
175
+ * watch on it (Vite still watches it as a module), because every
176
+ * family is already declared.
169
177
  */
170
178
  siteConfigPath?: string;
171
179
  /**
@@ -226,8 +234,16 @@ export function iterantStarter({
226
234
  newFileReload(),
227
235
  // Dev-only: restart signals, the content re-arm, and the dev-state probe.
228
236
  devServerSignals({ pagesDir, chromeDir }),
229
- // Restart the dev server when the site config the fonts come from changes.
230
- siteConfigWatch(siteConfigPath),
237
+ // Restart the dev server when the site config the fonts come from changes,
238
+ // in list mode alone. The watch exists for one reason: the preset turns
239
+ // SITE_CONFIG.fonts into font declarations once, at server start, so a
240
+ // family added to that list after boot would render a face Astro never
241
+ // resolved. `"catalog"` declares every family up front, which answers the
242
+ // same question without a restart, and the restart is not free: every first
243
+ // build writes src/site-config.ts on the direction pick, and that cost 11.7s
244
+ // of preview outage, with a `preview.upstream-error` and a re-attach the
245
+ // customer sees as the waking card (measured 2026-09-12, run 10).
246
+ ...(fonts === "catalog" ? [] : [siteConfigWatch(siteConfigPath)]),
231
247
  ];
232
248
 
233
249
  const fontFamilies = catalogFontFamilies(fonts);