v0 · Developer Preview Frond is under active development. APIs may change between releases.

Tags and diagnostics

A tag names the kind of node. It is half the node’s identity and the label that appears in diagnostics.

Tags

Create a tag with Frond.tag(value).

tag: Frond.tag("resources/profile"),

The value must be a non-empty string with no whitespace. Use stable, path-like names — resources/profile, services/auth-session — that read well grouped in a list. The tag is part of the node id, so renaming it changes the identity of every node built from the spec. See Identity and keys.

Labels and ids

A node surfaces in two forms:

FormShapeExample
Node idtag:keyresources/profile:v1:{"userId":"u_42"}
Diagnostics labelkind:tagresource:resources/profile

The label carries the kind, which is why the kind is worth setting even though it does not change behavior.

Snapshots

A node snapshot is the inspectable state of one node. Each carries:

FieldDescription
tag, kind, key, labelIdentity and naming.
statusUnwired, Invalid, or Wired with a run state of idle, pending, ready, or error.
resultValidityCurrent, Stale, or Expired.
operationThe running operation, if any.
operationFailureThe last operation failure.
liveDemandWhether the node is live, and its sources.

Snapshots are passive — reading one never starts work or creates liveness demand.

Report sinks

The runtime emits events for readiness, operations, validity changes, eviction, liveness, and failures. Attach a sink to receive them. Frond.Diagnostics.createRuntimeReportSink turns raw events into readable reports.

import * as Frond from "@frondruntime/core";

const runtime = Frond.createRuntime({
  sinks: [
    Frond.Diagnostics.createRuntimeReportSink({
      name: "console",
      handleReport: ({ report }) => {
        console.log(report);
      },
    }),
  ],
});

Frond.Diagnostics also exposes createErrorReport for projecting a single failure and serializeCauseChain for flattening an Effect cause into readable frames. See Error projection.


Next: React provider — the provider and hooks in depth.