@kudzujs/core 0.8.20 → 0.8.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,6 +131,46 @@ export type ListDescriptor = {
131
131
  valueSeed?: Record<string, string | number | boolean | null>
132
132
  }
133
133
 
134
+ export interface RouteIR {
135
+ version: 1
136
+ states: Array<{ slot: number; id: string; name: string; initialValue: unknown; lifetime?: "layout" | "route"; internal?: true }>
137
+ params: Array<{ name: string; id: string }>
138
+ searchParams: Array<{ name: string; id: string }>
139
+ searchParamsWritable: boolean
140
+ events: Array<{
141
+ event: string
142
+ commands?: Array<[string, string, unknown]>
143
+ native?: { module: string; handler: string; states: Record<string, string>; scope: Record<string, unknown> }
144
+ }>
145
+ effects: Array<{
146
+ module: string
147
+ handler: string
148
+ states: Record<string, string>
149
+ scope: Record<string, unknown>
150
+ lifetime?: "layout" | "route"
151
+ dependencies?: string[]
152
+ dependencyExpressions?: unknown[]
153
+ dependencyStates?: Record<string, string>
154
+ itemDependencies?: string[]
155
+ listState?: string
156
+ cleanup?: true
157
+ owner?: string
158
+ list?: true
159
+ }>
160
+ bindings: Array<{
161
+ target: string
162
+ state?: string
163
+ module?: string
164
+ handler?: string
165
+ states?: Record<string, string>
166
+ scope?: Record<string, unknown>
167
+ scopeStates?: Record<string, string>
168
+ scopeBindings?: Record<string, unknown>
169
+ }>
170
+ conditions: Array<Record<string, unknown>>
171
+ lists: ListDescriptor[]
172
+ }
173
+
134
174
  export function renderPage<Props = Record<string, never>>(
135
175
  component: (props: Props) => unknown | Promise<unknown>,
136
176
  metadata?: PageMetadata,
@@ -146,28 +186,5 @@ export function renderPage<Props = Record<string, never>>(
146
186
  hasListStyles: boolean
147
187
  hasStateSeed: boolean
148
188
  handlerModules: string[]
149
- plan: {
150
- states: Array<{ id: string; name: string; initialValue: unknown; lifetime?: "layout" | "route"; internal?: true }>
151
- params: Array<{ name: string; id: string }>
152
- searchParams: Array<{ name: string; id: string }>
153
- searchParamsWritable: boolean
154
- events: Array<{
155
- event: string
156
- commands?: Array<[string, string, unknown]>
157
- native?: { module: string; handler: string; states: Record<string, string>; scope: Record<string, unknown> }
158
- }>
159
- effects: Array<{ module: string; handler: string; states: Record<string, string>; scope: Record<string, unknown>; lifetime?: "layout" | "route"; dependencies?: string[]; itemDependencies?: string[]; listState?: string; cleanup?: true; owner?: string; list?: true }>
160
- bindings: Array<{
161
- target: string
162
- state?: string
163
- module?: string
164
- handler?: string
165
- states?: Record<string, string>
166
- scope?: Record<string, unknown>
167
- scopeStates?: Record<string, string>
168
- scopeBindings?: Record<string, unknown>
169
- }>
170
- conditions: Array<Record<string, unknown>>
171
- lists: ListDescriptor[]
172
- }
189
+ plan: RouteIR
173
190
  }>
@@ -527,7 +527,8 @@ export async function renderPage(component, metadata = {}, props = {}, layout) {
527
527
  hasStateSeed: initialState.length > 0,
528
528
  handlerModules: [...renderContext.handlerModules],
529
529
  plan: {
530
- states: Object.entries(renderContext.states).map(([id, state]) => ({ id, ...state })),
530
+ version: 1,
531
+ states: Object.entries(renderContext.states).map(([id, state], slot) => ({ slot, id, ...state })),
531
532
  params: renderContext.paramEntries,
532
533
  searchParams: renderContext.searchParamEntries,
533
534
  searchParamsWritable: renderContext.searchParamsWritable,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kudzujs/core",
3
- "version": "0.8.20",
3
+ "version": "0.8.22",
4
4
  "description": "HTML-first TSX framework with synchronous state semantics and no virtual DOM",
5
5
  "type": "module",
6
6
  "license": "MIT",