@wcstack/devtools 1.30.0 → 1.32.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/dist/index.d.ts CHANGED
@@ -148,6 +148,18 @@ type DevtoolsEventLike = {
148
148
  readonly type: "state:watch-fired";
149
149
  readonly stateName: string;
150
150
  readonly path: string;
151
+ } | {
152
+ readonly type: "state:path-unresolved";
153
+ readonly source: "binding" | "watch";
154
+ readonly stateName: string;
155
+ readonly path: string;
156
+ readonly missingSegment: string;
157
+ } | {
158
+ readonly type: "state:binding-apply-error";
159
+ readonly stateName: string;
160
+ readonly path: string;
161
+ readonly bindingType: string;
162
+ readonly error: unknown;
151
163
  } | {
152
164
  readonly type: "propagation:suppressed";
153
165
  readonly reason: "confirmation" | "visited-edge";
@@ -227,7 +239,7 @@ interface IDevtoolsHookRegistryLike {
227
239
 
228
240
  /** 予約 state 名 prefix(protocol §5)。この prefix の要素・イベントは常に除外 */
229
241
  declare const RESERVED_STATE_NAME_PREFIX = "wcs-devtools";
230
- type TimelineKind = "write" | "batch" | "command" | "event" | "element-registered" | "element-unregistered" | "watch-error" | "watch-chain-limit" | "propagation-suppressed" | "propagation-coalesced" | "propagation-hop-limit" | "contract-drift";
242
+ type TimelineKind = "write" | "batch" | "command" | "event" | "element-registered" | "element-unregistered" | "watch-error" | "watch-chain-limit" | "path-unresolved" | "binding-apply-error" | "propagation-suppressed" | "propagation-coalesced" | "propagation-hop-limit" | "contract-drift";
231
243
  interface ITimelineEntry {
232
244
  readonly seq: number;
233
245
  readonly time: number;
package/dist/index.esm.js CHANGED
@@ -808,6 +808,38 @@ class DevtoolsCore {
808
808
  });
809
809
  return;
810
810
  }
811
+ case "state:path-unresolved": {
812
+ if (this.isHiddenStateName(event.stateName)) {
813
+ return;
814
+ }
815
+ // ランタイムは warn で続行する(既存ページを止めないため)。lint を
816
+ // 走らせていない相手には、ここが「配線が死んでいる」唯一の可視面になる。
817
+ this._appendTimeline({
818
+ sourceId,
819
+ kind: "path-unresolved",
820
+ stateName: event.stateName,
821
+ label: event.path,
822
+ detail: `${event.source}: "${event.missingSegment}" is not declared`,
823
+ subscriberCount: null,
824
+ });
825
+ return;
826
+ }
827
+ case "state:binding-apply-error": {
828
+ if (this.isHiddenStateName(event.stateName)) {
829
+ return;
830
+ }
831
+ // 隔離された適用失敗。bindingType を detail 先頭に置くのは、構造
832
+ // (for / if)の失敗と値の失敗で影響範囲が違うため。
833
+ this._appendTimeline({
834
+ sourceId,
835
+ kind: "binding-apply-error",
836
+ stateName: event.stateName,
837
+ label: event.path,
838
+ detail: `${event.bindingType}: ${formatError(event.error)}`,
839
+ subscriberCount: null,
840
+ });
841
+ return;
842
+ }
811
843
  case "propagation:suppressed": {
812
844
  // two-way エコーの辺単位抑止。state 名を持たない(node+member が主語)
813
845
  // ため hidden 判定はここでは行わない。
@@ -1820,6 +1852,14 @@ class WcsDevtools extends HTMLElement {
1820
1852
  ? "a $watch threw; the runtime isolated it (console.error only)"
1821
1853
  : "a $watch write chain hit the depth limit and was cut off";
1822
1854
  }
1855
+ // 配線の死(解決しないパス)と隔離された適用失敗も、ランタイムが console に
1856
+ // 出すだけで続行する = 見ていなければ気づけない種類なので warn に乗せる。
1857
+ if (entry.kind === "path-unresolved" || entry.kind === "binding-apply-error") {
1858
+ kind.classList.add("warn");
1859
+ kind.title = entry.kind === "path-unresolved"
1860
+ ? "a wired path does not resolve on the state; its updates are dropped"
1861
+ : "a binding threw while applying; the runtime isolated it (console.error only)";
1862
+ }
1823
1863
  // 伝播の打ち切りと契約 drift も「黙って起きる異常」なので warn に乗せる。
1824
1864
  // suppressed / coalesced は定常動作(エコー抑止・合流)のため通常表示。
1825
1865
  if (entry.kind === "propagation-hop-limit" || entry.kind === "contract-drift") {