@uniweb/core 0.29.5 → 0.29.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/core",
3
- "version": "0.29.5",
3
+ "version": "0.29.7",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
package/src/data-paths.js CHANGED
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * ⚠️ `<name>` IS A QUERY'S NAME. `/data/<name>.json` is a named query's
6
6
  * MATERIALIZATION — the answer when no host declares a live lane — and never the
7
- * definition of anything. The records themselves live in `entities/{schema}/`,
8
- * and `records.yml` decides which of them are published.
7
+ * definition of anything. The records themselves are the files in
8
+ * `records/{schema}/` — every file there is one.
9
9
  *
10
10
  * Why this module exists. The path `/data/<name>.json` was a bare string
11
11
  * literal in six places across three packages: the build wrote it
@@ -204,6 +204,27 @@ export default class FetcherDispatcher {
204
204
  return this._dataStore.get(key)
205
205
  }
206
206
 
207
+ /**
208
+ * ⭐ FILE AN ANSWER SOMEONE ELSE FETCHED, under the key THIS dispatcher will look for it.
209
+ *
210
+ * A build and a host both arrive with answers in hand — baked into a payload, or fetched by a
211
+ * data step — and the only thing that makes them findable is being filed where `peek` looks.
212
+ *
213
+ * ⛔ That is not `deriveCacheKey` for every request, and a caller cannot know which ones.
214
+ * A fetcher may declare its own `cacheKey` — the documented case is a request whose identity
215
+ * depends on state its address does not carry — and the site chooses which key goes to which
216
+ * transport. So the derivation has exactly one home, this class (see the header), and hydrating
217
+ * by hand files a keyed transport's answer where nothing looks: measured 2026-09-20, every page
218
+ * of such a site prerendered empty and the browser refetched it, with no error anywhere.
219
+ *
220
+ * @param {Object} request - the resolved config the answer belongs to
221
+ * @param {{ data: *, meta?: Object }} entry - the answer, in the shape `peek` returns
222
+ * @param {Object} [ctx] - `{ website }`, for the site's transport selection
223
+ */
224
+ hydrate(request, entry, ctx = {}) {
225
+ this._dataStore.set(this._cacheKey(this._selectFetcher(request, ctx), request), entry)
226
+ }
227
+
207
228
  /**
208
229
  * The record held under an identity, if any, with its depth — the entity
209
230
  * store asks this before fetching a detail record, so a record already held