Skip to content

feat(core): support nested repeats with item paths - #319

Merged
Railly merged 1 commit into
mainfrom
railly/fix-nested-repeats
Aug 13, 2026
Merged

feat(core): support nested repeats with item paths#319
Railly merged 1 commit into
mainfrom
railly/fix-nested-repeats

Conversation

@Railly

@Railly Railly commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

Adds nested repeat support by allowing { "$item": "field" } in repeat.statePath. This replaces and completes #256 on current main.

Trevin Chow (@tmchow) authored the original implementation in #256 and is credited as a co-author on the commit. This PR keeps that design while addressing current-main compatibility, validation, renderer parity, and documentation gaps.

Changes

  • add shared core helpers for resolving root and item-relative repeat paths
  • preserve all existing string statePath behavior
  • reject relative repeat paths outside an enclosing repeat scope
  • support nested repeats across React, React Native, React Email, React PDF, Image, Ink, Solid, Svelte, and Vue
  • validate nested sample state, DAG reuse, empty outer arrays, and cyclic child graphs
  • preserve repeat in all renderer schemas with a parity regression test
  • update generated prompts, package docs, web docs, and renderer skills

Example

{
  "type": "Table",
  "repeat": { "statePath": { "$item": "employees" }, "key": "id" },
  "children": ["employee-row"],
  "props": {}
}

Inside an outer repeat over /companies, this resolves to /companies/0/employees, /companies/1/employees, and so on.

Verification

  • 162 focused tests pass across core, React, and Svelte
  • affected package builds pass across core and all renderer families
  • Svelte type-check passes with 0 errors and 0 warnings
  • force-red verification confirmed the new regression tests fail without the fix
  • independent cross-model review found no blocking correctness or compatibility issues

Closes #252
Supersedes #256

Resolve nested repeat state paths consistently across every renderer, validator, schema, prompt, and documentation surface.

Fixes #252

Co-authored-by: Trevin Chow <trevin@trevinchow.com>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
json-render Ready Ready Preview Aug 13, 2026 6:13pm
json-render-chat-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-dashboard-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-game-engine-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-image-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-no-ai Ready Ready Preview Aug 13, 2026 6:13pm
json-render-react-email-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-react-pdf-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-react-three-fiber-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-remotion-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-solid-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-svelte-chat-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-svelte-demo Ready Ready Preview Aug 13, 2026 6:13pm
json-render-vue Ready Ready Preview Aug 13, 2026 6:13pm

@Railly
Railly merged commit 9f58a3c into main Aug 13, 2026
22 checks passed
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.

Nested repeat in json renderer

2 participants