@uniweb/runtime 1.5.6 → 1.5.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/runtime",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Minimal runtime for loading Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -44,7 +44,7 @@
44
44
  "esbuild": "^0.21.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.27.0 || ^0.28.0",
45
45
  "vite": "^7.3.1",
46
46
  "vitest": "^4.1.7",
47
- "@uniweb/build": "1.20.4"
47
+ "@uniweb/build": "1.20.8"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^19.0.0",
@@ -59,7 +59,8 @@ import { pageIcons, dataIcons, iconRequests } from './page-icons.js'
59
59
  * (`page-icons.js`). They are not entries of the list this returns. A caller with its own
60
60
  * answer for icons says `false`; a static build says `true`, beside the site-wide prefetch.
61
61
  * @returns {Promise<Array<{ config: Object, outcome: 'fetched'|'failed'|'skipped', data: *, meta?: Object, error?: string }>>}
62
- * one entry per request the render will make, keyed downstream by `deriveCacheKey(config)`.
62
+ * one entry per request the render will make, keyed downstream by `deriveCacheKey(config)`, and
63
+ * in the order of those keys.
63
64
  * ⛔ The page's data and nothing else: a host counts this list to decide how long to keep the
64
65
  * page, so one more entry shortens its life, and one that fails can end it.
65
66
  */
@@ -110,7 +111,7 @@ export async function loadPageData({ website, route, fetch, dev = false, locale
110
111
  defaultFetcher: createDefaultFetcher({ basePath: website.config?.base || '', dev, fetch }),
111
112
  })
112
113
 
113
- /** One entry per request, in the order they were first asked for. */
114
+ /** One entry per request, its first answer, by its key. */
114
115
  const entries = new Map()
115
116
  const record = (request, entry) => {
116
117
  const key = deriveCacheKey(request)
@@ -167,5 +168,10 @@ export async function loadPageData({ website, route, fetch, dev = false, locale
167
168
  // only icons the graph holds, waits for nothing more.
168
169
  if (askIcons) await askIcons(dataIcons([...entries.values()].map((entry) => entry.data)))
169
170
 
170
- return [...entries.values()]
171
+ // ⭐ IN THE ORDER OF THEIR KEYS, never the order the answers came in, which is the network's or
172
+ // the disk's. A page's HTML carries this list, so in arrival order two builds of one site wrote
173
+ // different bytes for the same pages (176 files in one project, 2026-11-10), and a deploy sent
174
+ // them again. Nothing reads the order: `hydrateDataStore` files each entry under its key, and the
175
+ // record index keeps a record's brief and its whole apart (`DataStore#upsertRecord`).
176
+ return [...entries].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)).map(([, entry]) => entry)
171
177
  }