Skip to content

feat(runtime-web): buildGrid() — metadata-driven grid columns at runtime#40

Merged
dmealing merged 2 commits into
mainfrom
feat/runtime-web-build-grid
Jun 17, 2026
Merged

feat(runtime-web): buildGrid() — metadata-driven grid columns at runtime#40
dmealing merged 2 commits into
mainfrom
feat/runtime-web-build-grid

Conversation

@dmealing

Copy link
Copy Markdown
Member

What

Adds buildGrid() to @metaobjectsdev/runtime-web: the runtime twin of the tanstackGrid() codegen. It builds grid columns + config by walking a loaded MetaObject's fields and views at runtime — no code generation.

  • Honors a dataGrid layout (@columns / @pageSize / default sort / @filterable) when present; otherwise falls back to all fields, so it works for any object.
  • Mirrors the columns-file codegen derivation (humanized headers, the field's view subtype as the cell-renderer hint) so a runtime-built grid matches a generated one.
  • Browser-safe: depends only on @metaobjectsdev/metadata.

Why

MetaObjects' thesis is "one model, two delivery modes — generate the code, or drive behavior live from the model." The grid has been codegen-only; this is the first building block of the runtime delivery mode.

Scope

This is Slice 1's column builder only — a tested utility, not yet a turnkey runtime grid. The full runtime grid (metadata-driven list endpoint + useMetaGrid hook wired to <EntityGrid>, then the form/validation write-path) is designed in docs/superpowers/specs/2026-06-16-runtime-metadata-grid-slice1-design.md and built in later slices. Including the spec here documents the program.

Tests

  • 3 new tests (no-layout → all fields; dataGrid drives columns/sort/pageSize; generic on a different Invoice object).
  • Full runtime-web suite green (33/33); typecheck clean.

🤖 Generated with Claude Code

dmealing and others added 2 commits June 16, 2026 23:23
The runtime twin of the tanstackGrid() codegen: builds grid columns + config by
walking a loaded MetaObject's fields and views at runtime, with no code
generation. Honors a dataGrid layout (@columns/@pageSize/sort/@filterable) when
present, else falls back to all fields, so it works for any object. Mirrors the
columns-file codegen derivation (humanized headers, view-subtype cell hint).

3 tests; full runtime-web suite green (33/33), typecheck clean. First step of the
runtime metadata-driven grid program (see docs/superpowers/specs/2026-06-16-…).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Design for the first vertical slice (list + sort + pagination, no codegen): a
generic metadata-driven Fastify list endpoint + a useMetaGrid hook feeding the
existing <EntityGrid>, proven by running the metadata endpoint against the same
api-contract-conformance corpus the generated routes pass (codegen ≡ metadata,
a third conformance lane). Decomposes the larger runtime-UI program (read path =
grid; write path = forms + validation + writes endpoint).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dmealing
dmealing merged commit ea2b9e9 into main Jun 17, 2026
29 checks passed
@dmealing
dmealing deleted the feat/runtime-web-build-grid branch June 17, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant