Diagnostics
wrapWithDiagnostics returns selected boundaries and costs. Scope events are opt-in, with no telemetry.
Core diagnostics
wrapWithDiagnostics returns the same lines plus selected UTF-16 boundaries, width, strategy, duration and balanced costs. Costs are heuristic, not grammatical ground truth.
import { wrapWithDiagnostics } from '@oddmash/juliya';
const { lines, diagnostics } = wrapWithDiagnostics(text, { width, measure });Inspect scope options
Pass an opt-in onDecision callback to mountJuliyaScope for mount, update, exclusion and teardown decisions. The sources map identifies the winning library, scope, rule, CSS or attribute option. Use onDiagnostic on DOM and React controllers for measurement availability, canvas-function reuse, actual inline-plan reuse, font/resize invalidation and computed plan details. Protected inline code reports fallback; plans represent computed boundaries, not actual CSS lines. Callback errors are isolated; original text is not logged or sent automatically.
import { mountJuliyaScope } from '@oddmash/juliya/dom';
const scope = mountJuliyaScope(root, { include: ['p'] }, {
onDecision: (_, event) => { if (event.status === 'updated') console.debug(event.options, event.sources); },
onDiagnostic: (_, event) => console.debug(event),
});