WORK-388
Setting up your dashboard 0 entities found · 9/32 branches scanned
ID:WORK-388Status:ready

Data-bound sandbox core

SPEC-093 core — the build-time data channel from the registry into a sandbox. The registry's third render target (HTML via collection, SVG via aggregate, arbitrary client-side here). Independent of the SPEC-092 track: flat/tree shapes work over the page/pageTree data that exists today.

Priority:highComplexity:complexMilestone:v0.21.0Source:SPEC-093
changeset-release/main View source

Criteria completion

Criteria completion: 0 of 4 (0%) checked; tracking started on Jun 11, no incremental history yet0%25%50%75%100%Jun 11Jun 15

Tracking started Jun 11 — check back for trends.

Branches 4
History 3
  1. 92c8f1b
    Content editedby Claude
    feat(sandbox): data-bound sandboxes — registry → window.RF_DATA (WORK-38
  2. 7d00ec5
    Created (ready)by github-actions[bot]
  3. 5a2b530
    Content editedby Claude
    plan: v0.21.0 work breakdown — SPEC-092 + SPEC-093 (WORK-383..390)

Decisions (locked)

  • Binding: a data attribute carrying a SPEC-070 field-match query (+ optional data-fields projection, data-shape). Resolved at build by a step sibling to collection-resolve.
  • Injection: an inline <script type="application/json"> is the canonical transport (handles large payloads; data-attributes don't), exposed to the iframe as a frozen global window.RF_DATA, alongside the existing design-token/theme globals. Reuses the proven token-injection rail in behaviors/.../sandbox.ts.
  • Shapes (this item): flat (entity array) and tree (nest by parentUrl). graph is WORK-390.
  • Fallback is mandatory and authored for v0.21.0 (auto-fallback deferred): a data-bound sandbox with no authored collection/aggregate fallback warns.
  • Bounded payload: a configurable cap (records/bytes) — exceed → warn + truncate.

Acceptance Criteria

  • A sandbox accepts data (+ data-fields, data-shape=flat|tree); the query resolves at build to a projected, serialisable result injected as window.RF_DATA + the JSON <script>.
  • Works across both the html adapter and the sveltekit renderer (the injected data survives serialization — follow the design-token rail).
  • Payload over the cap warns and truncates; a data-bound sandbox without an authored fallback warns.
  • Tests for resolve, projection, both shapes, the cap, and the fallback warning.

References

  • SPEC-093 · ADR-017 · packages/behaviors/src/elements/sandbox.ts · packages/runes/src/collection-resolve.ts