@ai-matrx/content-ir-react 0.12.6 → 0.13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0 — 2026-09-30
4
+
5
+ - **Settling repaints every block that waited on it.** THE COLD-VERDICT RULE
6
+ holds a block whose kind the resolver cannot answer while its tier is
7
+ unsettled. `ensureWarm` settling (a landed list, empty or not, or retries
8
+ exhausted) and the first `ingestDbRows` that settles the tier now bump the
9
+ epoch and call EVERY per-kind listener. Before, only kinds that gained rows
10
+ were told, so a waiting block for any other kind kept its pre-settle
11
+ rendering (raw JSON in hosts that drew it) until something unrelated
12
+ re-rendered it.
13
+ - **A single-kind fetch always answers its waiters.** `requestComponent` now
14
+ bumps that kind when its fetch misses or fails too (a landing already did).
15
+
16
+ ### Consumer action
17
+
18
+ - A host that holds a completed block on a loader while `hasSettled()` is
19
+ false may now rely on the per-kind repaint (`subscribeKind` /
20
+ `getKindVersion`) to release it — no polling, no timer.
21
+
22
+ ## 0.12.7
23
+
24
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
25
+ `git diff npm/content-ir-react/v0.12.6..npm/content-ir-react/v0.12.7 -- apps/shared/content-ir-react`).
26
+ No source changes intended and no consumer action required.
27
+
3
28
  ## 0.12.6
4
29
 
5
30
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -268,6 +268,7 @@ var ComponentResolver = class {
268
268
  * key wins: rows arrive is_default-first / sort_order-asc from the source.
269
269
  */
270
270
  ingestDbRows(rows) {
271
+ const wasSettled = this.hasSettled();
271
272
  const changedKinds = /* @__PURE__ */ new Set();
272
273
  for (const row of rows) {
273
274
  const key = keyOf(row.kind, row.platform, row.role);
@@ -280,6 +281,27 @@ var ComponentResolver = class {
280
281
  for (const kind of changedKinds) this.bumpKind(kind);
281
282
  this.notifyChanged();
282
283
  }
284
+ if (!wasSettled && this.hasSettled()) this.notifySettled();
285
+ }
286
+ /**
287
+ * Mark the tier settled. THE COLD-VERDICT RULE held every block whose kind
288
+ * the tier could not answer; settling changes that verdict for ALL of them,
289
+ * so the flip bumps the epoch and calls every per-kind listener (as a
290
+ * wholesale replace does). Before 0.13.0 a settle notified only kinds that
291
+ * gained rows, and a waiting block for any other kind kept its pre-settle
292
+ * rendering until something unrelated re-rendered it.
293
+ */
294
+ markSettled() {
295
+ const wasSettled = this.hasSettled();
296
+ this.settled = true;
297
+ if (!wasSettled) this.notifySettled();
298
+ }
299
+ notifySettled() {
300
+ this.epoch += 1;
301
+ for (const set of this.kindListeners.values()) {
302
+ for (const listener of set) listener();
303
+ }
304
+ this.notifyChanged();
283
305
  }
284
306
  /**
285
307
  * Refresh landing point: REPLACE the db tier wholesale (same
@@ -376,6 +398,7 @@ var ComponentResolver = class {
376
398
  return;
377
399
  }
378
400
  this.coldInFlight.add(flightKey);
401
+ const versionBefore = this.kindVersions.get(kind) ?? 0;
379
402
  void (async () => {
380
403
  try {
381
404
  this.ingestColdRows(await loadForKind(kind, platform));
@@ -391,6 +414,9 @@ var ComponentResolver = class {
391
414
  });
392
415
  } finally {
393
416
  this.coldInFlight.delete(flightKey);
417
+ if ((this.kindVersions.get(kind) ?? 0) === versionBefore) {
418
+ this.bumpKind(kind);
419
+ }
394
420
  }
395
421
  })();
396
422
  }
@@ -432,7 +458,7 @@ var ComponentResolver = class {
432
458
  if (!this.warmPromise) {
433
459
  this.warmPromise = loadAll().then((rows) => {
434
460
  this.ingestDbRows(rows);
435
- this.settled = true;
461
+ this.markSettled();
436
462
  this.warmFailures = 0;
437
463
  if (this.warmRetryTimer) {
438
464
  clearTimeout(this.warmRetryTimer);
@@ -450,7 +476,7 @@ var ComponentResolver = class {
450
476
  this.warmFailures += 1;
451
477
  const delay = WARM_RETRY_DELAYS_MS[this.warmFailures - 1] ?? null;
452
478
  if (delay === null) {
453
- this.settled = true;
479
+ this.markSettled();
454
480
  } else if (!this.warmRetryTimer) {
455
481
  this.warmRetryTimer = setTimeout(() => {
456
482
  this.warmRetryTimer = null;