@tenphi/cookbook 0.24.0 → 0.25.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.
@@ -49,10 +49,12 @@ rejects the TypeScript 7 API. Runtime compilation and lint parsing are separate.
49
49
 
50
50
  The reference build enforces separate limits for initial page JavaScript,
51
51
  lazy search assets, font files, images, and extracted Tasty CSS. A default guide
52
- currently loads about 9 KB of first-party JavaScript initially; search is lazy.
52
+ currently loads about 22 KB of first-party JavaScript initially (about 10 KB
53
+ gzipped), including Astro's built-in hover prefetching; search and the client
54
+ router remain lazy. The initial JavaScript budget is 24 KiB.
53
55
  The checked reference output contains about 73 KB of fonts, 66 KB of images and
54
- icons, and a 189 KB shared stylesheet. The guide's first-party HTML, CSS, and
55
- initial JavaScript total about 33 KB when gzipped. Actual network transfers vary
56
+ icons, and a 181 KB shared stylesheet. The guide's first-party HTML, CSS, and
57
+ initial JavaScript total about 40 KB when gzipped. Actual network transfers vary
56
58
  with hosting compression and caching. `node scripts/check-reference-budgets.mjs`
57
59
  prints current raw budgets and the gzip estimate; neither includes external
58
60
  analytics.
@@ -33,6 +33,25 @@ scroll resets to the top on page changes, including Back and Forward; links with
33
33
  fragments still navigate to their heading. The current page and its ancestors
34
34
  update from the destination markup. Mobile navigation and other open panels close.
35
35
 
36
+ Cookbook enables Astro's built-in hover prefetching by default. Hovering over or
37
+ focusing an internal link for about 80 ms downloads the destination HTML in the
38
+ background. Moving across links briefly does not prefetch them, and repeated
39
+ links to the same page share a prefetch. When the browser reports data-saving
40
+ mode or a slow connection, Astro waits for tap intent instead.
41
+
42
+ Prefetching warms the browser's HTTP cache. Static hosting should send cache
43
+ headers such as `Cache-Control` or `ETag` so navigation can reuse the response;
44
+ uncacheable responses may still be downloaded again on click. Browser and private
45
+ session policies can also limit cache reuse. Destination stylesheets remain part
46
+ of the router's preparation before the page swap.
47
+
48
+ Set `prefetch: false` in `astro.config.mjs` to disable page prefetching while
49
+ retaining client navigation. Cookbook preserves any explicit Astro `prefetch`
50
+ configuration, including `prefetchAll: false` for selective prefetching. For a
51
+ single link, use `data-astro-prefetch="false"` to opt out or
52
+ `data-astro-prefetch` to opt in. See [Astro's prefetch guide](https://docs.astro.build/en/guides/prefetch/)
53
+ for the supported strategies.
54
+
36
55
  Search keeps its query and loaded engine between pages in the same language,
37
56
  and closes when a result is followed. Language changes initialize the translated
38
57
  search interface. External links, downloads, modified clicks, and links marked
@@ -41,8 +60,9 @@ use normal document navigation.
41
60
 
42
61
  Custom browser scripts should attach behavior through custom-element lifecycle
43
62
  callbacks or initialize on `astro:page-load`; bundled scripts are not rerun on
44
- every client navigation. The router and appearance initialization belong to the common page shell
45
- and remain available with replacement Header, Head, and PageFrame components.
63
+ every client navigation. The router and appearance initialization belong to the
64
+ common page shell and remain available with replacement Header, Head, and
65
+ PageFrame components.
46
66
 
47
67
  ## Search
48
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/cookbook",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Repository-native static documentation for Astro",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -68,8 +68,8 @@
68
68
  "author": "Andrey Yamanov",
69
69
  "license": "MIT",
70
70
  "dependencies": {
71
- "@tenphi/docs": "0.24.0",
72
- "@tenphi/renderer": "0.24.0"
71
+ "@tenphi/docs": "0.25.0",
72
+ "@tenphi/renderer": "0.25.0"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "astro": "^7.3.2"