feat(runtime-web): buildGrid() — metadata-driven grid columns at runtime#40
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
buildGrid()to@metaobjectsdev/runtime-web: the runtime twin of thetanstackGrid()codegen. It builds grid columns + config by walking a loadedMetaObject's fields and views at runtime — no code generation.dataGridlayout (@columns/@pageSize/ default sort /@filterable) when present; otherwise falls back to all fields, so it works for any object.columns-filecodegen derivation (humanized headers, the field's view subtype as the cell-renderer hint) so a runtime-built grid matches a generated one.@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 +
useMetaGridhook wired to<EntityGrid>, then the form/validation write-path) is designed indocs/superpowers/specs/2026-06-16-runtime-metadata-grid-slice1-design.mdand built in later slices. Including the spec here documents the program.Tests
dataGriddrives columns/sort/pageSize; generic on a differentInvoiceobject).runtime-websuite green (33/33); typecheck clean.🤖 Generated with Claude Code