page.mdx 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. export const metadata = { title: "Changelog" }
  2. # Changelog
  3. Notable changes and updates to json-render.
  4. ## v0.4.0
  5. February 2026
  6. ### New: Custom Schema System
  7. Create custom output formats with `defineSchema`. Each renderer now defines its own schema, enabling completely different spec formats for different use cases.
  8. ```typescript
  9. import { defineSchema } from "@json-render/core";
  10. const mySchema = defineSchema((s) => ({
  11. spec: s.object({
  12. pages: s.array(s.object({
  13. title: s.string(),
  14. blocks: s.array(s.ref("catalog.blocks")),
  15. })),
  16. }),
  17. catalog: s.object({
  18. blocks: s.map({ props: s.zod(), description: s.string() }),
  19. }),
  20. }), {
  21. promptTemplate: myPromptTemplate,
  22. });
  23. ```
  24. ### New: Component Slots
  25. Components can now define which slots they accept. Use `["default"]` for regular children, or named slots like `["header", "footer"]` for more complex layouts.
  26. ```typescript
  27. const catalog = defineCatalog(schema, {
  28. components: {
  29. Card: {
  30. props: z.object({ title: z.string() }),
  31. slots: ["default"], // accepts children
  32. description: "A card container",
  33. },
  34. Layout: {
  35. props: z.object({}),
  36. slots: ["header", "content", "footer"], // named slots
  37. description: "Page layout with header, content, footer",
  38. },
  39. },
  40. });
  41. ```
  42. ### New: AI Prompt Generation
  43. Catalogs now generate AI system prompts automatically with `catalog.prompt()`. The prompt includes all component definitions, props schemas, and action descriptions - ensuring the AI only generates valid specs.
  44. ```typescript
  45. import { defineCatalog } from "@json-render/core";
  46. import { schema } from "@json-render/react/schema";
  47. const catalog = defineCatalog(schema, {
  48. components: { /* ... */ },
  49. actions: { /* ... */ },
  50. });
  51. // Generate system prompt for AI
  52. const systemPrompt = catalog.prompt();
  53. // Use with any AI SDK
  54. const result = await streamText({
  55. model: "claude-haiku-4.5",
  56. system: systemPrompt,
  57. prompt: userMessage,
  58. });
  59. ```
  60. ### New: @json-render/remotion
  61. Generate AI-powered videos with Remotion. Define video catalogs, stream timeline specs, and render with the Remotion Player.
  62. ```tsx
  63. import { Player } from "@remotion/player";
  64. import { Renderer, schema, standardComponentDefinitions } from "@json-render/remotion";
  65. const catalog = defineCatalog(schema, {
  66. components: standardComponentDefinitions,
  67. transitions: standardTransitionDefinitions,
  68. });
  69. <Player
  70. component={Renderer}
  71. inputProps={{ spec }}
  72. durationInFrames={spec.composition.durationInFrames}
  73. fps={spec.composition.fps}
  74. compositionWidth={spec.composition.width}
  75. compositionHeight={spec.composition.height}
  76. />
  77. ```
  78. Includes 10 standard video components (TitleCard, TypingText, SplitScreen, etc.), 7 transition types, and the ClipWrapper utility for custom components.
  79. ### New: SpecStream
  80. SpecStream is json-render's streaming format for progressively building specs from JSONL patches. The new compiler API makes it easy to process streaming AI responses.
  81. ```typescript
  82. import { createSpecStreamCompiler } from "@json-render/core";
  83. const compiler = createSpecStreamCompiler<MySpec>();
  84. // Process streaming chunks
  85. const { result, newPatches } = compiler.push(chunk);
  86. setSpec(result); // Update UI with partial result
  87. ```
  88. ### Improved: Dashboard Example
  89. The dashboard example is now a full-featured accounting dashboard with:
  90. - Persistent SQLite database with Drizzle ORM
  91. - RESTful API for customers, invoices, expenses, accounts
  92. - Draggable widget reordering
  93. - AI-powered widget generation with streaming
  94. - Real data binding to database records
  95. ### Improved: Documentation
  96. - Interactive playground for testing specs
  97. - New guides: Custom Schema, Streaming, Code Export
  98. - Full API reference for all packages
  99. - Integration guides: A2UI, AG-UI, Adaptive Cards, OpenAPI
  100. ### Breaking Changes
  101. - `UITree` type renamed to `Spec`
  102. - Schema is now imported from renderer packages (`@json-render/react`) not core
  103. - `defineCatalog` now requires a schema as first argument
  104. ---
  105. ## v0.3.0
  106. January 2026
  107. Internal release with codegen foundations.
  108. - Added `@json-render/codegen` package (spec traversal and JSX serialization)
  109. - Configurable AI model via environment variables
  110. - Documentation improvements and bug fixes
  111. *Note: Only @json-render/core was published to npm for this release.*
  112. ---
  113. ## v0.2.0
  114. January 2026
  115. Initial public release.
  116. - Core catalog and spec types
  117. - React renderer with contexts for data, actions, visibility
  118. - AI prompt generation from catalogs
  119. - Basic streaming support
  120. - Dashboard example application