@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.
- package/MIGRATION_ROADMAP.md +13 -0
- package/PERFORMANCE.md +48 -0
- package/README.md +1 -1
- package/RELEASES.md +71 -0
- package/docs/next-architecture/README.md +2 -2
- package/docs/next-architecture/compiler-current-architecture.md +19 -17
- package/docs/next-architecture/goal-a-compiler-foundation.md +15 -18
- package/docs/next-architecture/versioning.md +2 -2
- package/framework/README.md +8 -4
- package/framework/build.mjs +90 -401
- package/framework/compiler/descriptor-session.mjs +11 -2
- package/framework/compiler/effect-analysis.mjs +89 -0
- package/framework/compiler/ir/module-ir.mjs +7 -1
- package/framework/compiler/list-runtime-codegen.mjs +95 -0
- package/framework/compiler/param-codegen.mjs +72 -0
- package/framework/compiler/route-capability-planner.mjs +35 -0
- package/framework/compiler/runtime-codegen.mjs +146 -0
- package/framework/compiler/worker-compiler.mjs +12 -6
- package/framework/core.d.ts +41 -24
- package/framework/core.mjs +2 -1
- package/package.json +1 -1
package/framework/core.d.ts
CHANGED
|
@@ -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
|
}>
|
package/framework/core.mjs
CHANGED
|
@@ -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
|
-
|
|
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,
|