@kudzujs/core 0.8.52 → 0.8.55
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 +3 -1
- package/PERFORMANCE.md +13 -1
- package/README.md +1 -1
- package/RELEASES.md +113 -0
- package/docs/next-architecture/README.md +1 -1
- package/docs/next-architecture/compiler-current-architecture.md +8 -8
- package/docs/next-architecture/large-application-ai-native-roadmap.md +3 -3
- package/docs/next-architecture/versioning.md +4 -1
- package/framework/README.md +5 -1
- package/framework/build.mjs +136 -85
- package/framework/compiler/effect-codegen.mjs +17 -17
- package/framework/compiler/param-codegen.mjs +2 -2
- package/framework/compiler/route-artifact-report.mjs +133 -0
- package/framework/compiler/runtime-codegen.mjs +1 -1
- package/framework/compiler/runtime-family-planner.mjs +48 -0
- package/framework/compiler/source-compiler.mjs +11 -10
- package/framework/compiler/worker-compiler.mjs +23 -4
- package/framework/core.d.ts +2 -0
- package/framework/core.mjs +6 -4
- package/framework/dev-server.mjs +1 -1
- package/framework/navigation-runtime.js +86 -2
- package/package.json +1 -1
package/MIGRATION_ROADMAP.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This document is the source of truth for Kudzu's product direction, architecture invariants, and future development order. Read it before extending React-shaped syntax or browser capabilities.
|
|
4
4
|
|
|
5
|
-
The executable post-`0.8.
|
|
5
|
+
The executable post-`0.8.55` compiler and large-application sequence is maintained in [`docs/next-architecture/large-application-ai-native-roadmap.md`](./docs/next-architecture/large-application-ai-native-roadmap.md). Follow its PR dependencies for implementation work; this document remains authoritative when selecting or accepting a migration capability.
|
|
6
6
|
|
|
7
7
|
[`GOAL_A.md`](./GOAL_A.md) and [`GOAL_B.md`](./GOAL_B.md) are completed capability-validation records. Their commerce and realtime dashboard fixtures prove general lifecycle, navigation, async-workflow, and Worker capabilities; they are not separate product verticals or future priority lists.
|
|
8
8
|
|
|
@@ -59,6 +59,8 @@ Do not add `getStaticProps`, request-time SSR, an SPA router, a stream runtime,
|
|
|
59
59
|
The following are available building blocks, not future vertical roadmaps:
|
|
60
60
|
|
|
61
61
|
- Async build-time components, `getStaticPaths()`, runtime path parameters, metadata, base paths, public assets, CSS, CSS Modules, and post-build hooks.
|
|
62
|
+
- Relative source CSS imports close over each page's reachable TypeScript import/re-export graph; configured styles remain explicitly global. Enhanced navigation loads destination CSS before route DOM replacement, reuses shared layout links, and removes outgoing route links.
|
|
63
|
+
- Interactive routes use deterministic signature-keyed runtime families. Equal standalone capability manifests share files, while each enhanced-navigation group unions its routes into one ESM singleton family for persistent layout state and lifecycle ownership.
|
|
62
64
|
- React import normalization for supported named/aliased hooks, direct `React.*` members, fragments, same-file `memo`, inline `useCallback`, direct intrinsic `forwardRef`, top-level `useId`, and analyzable `useMemo` expressions and collections.
|
|
63
65
|
- Function components, props, children, context, direct bindings, conditions, controlled form properties, refs, and synchronous or async handlers.
|
|
64
66
|
- `useState`, independent repeated non-keyed child state with conditional mount ownership, reduced relative-imported `useReducer`, direct dispatch specialization, and reduced Zustand-shaped shared state lowered through package-neutral shared-state/action IR and proven by migration fixtures.
|
package/PERFORMANCE.md
CHANGED
|
@@ -6,7 +6,19 @@ Reproducibility classes: `npm run benchmark`, `npm run benchmark:keyed`, `npm ru
|
|
|
6
6
|
|
|
7
7
|
The maintained 2026-08-13 comparison used Node 24.14.0 and an Intel Core i5-9500 Linux x64 host, one warm-up, and seven alternating fresh-process samples against clean `v0.8.44`. A narrow fast path skips Kudzu semantic transformation for 450 plain `.ts` modules whose runtime edges are exclusively resolvable relative TypeScript imports or exports; all other modules retain the existing transformer. Compile median fell from 2,323.9 ms to 1,413.2 ms (39.2%) and clean-build median from 3,325.3 ms to 2,382.4 ms (28.4%); every paired sample improved. Compile peak-RSS median fell from 571.2 MiB to 552.6 MiB, while build peak RSS was 570.9 MiB versus 568.8 MiB. Compiler scratch fell from 7,328,390 to 1,971,061 bytes. Both targets emitted the same 50 static HTML files, 10,980 bytes, and deploy SHA-256 `e107d78a7f55bc8a1af0ea6e53efeffa19b3d44d21c892484d103fa346e7ba7b`. This is a source-scale compiler comparison, not a cross-framework result.
|
|
8
8
|
|
|
9
|
-
## Current 0.8.
|
|
9
|
+
## Current 0.8.55 Release Snapshot
|
|
10
|
+
|
|
11
|
+
Kudzu 0.8.55 replaces site-wide runtime specialization with deterministic route or navigation-group capability families. Unrelated standalone capabilities no longer change another route's loaded runtime bytes or cache URL; no new timing claim is made.
|
|
12
|
+
|
|
13
|
+
## Maintained 0.8.54 Release Snapshot
|
|
14
|
+
|
|
15
|
+
Kudzu 0.8.54 retains esbuild output metadata and writes one compiler-scratch artifact report after bundling. Deploy runtime behavior and output selection are unchanged, and no new performance claim is made.
|
|
16
|
+
|
|
17
|
+
## Maintained 0.8.53 Release Snapshot
|
|
18
|
+
|
|
19
|
+
Kudzu 0.8.53 removes unrelated source stylesheet links from route HTML and reuses shared layout links during enhanced navigation. Static routes add no JavaScript, and no new performance claim is made.
|
|
20
|
+
|
|
21
|
+
## Maintained 0.8.52 Release Snapshot
|
|
10
22
|
|
|
11
23
|
Kudzu 0.8.52 moves proven effect-private mutable refs from component scope into existing setup-invocation closures. The refs add no serialized route scope, shared runtime, or static-sibling JavaScript; no new performance claim is made.
|
|
12
24
|
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Kudzu compiles ordinary React-shaped TypeScript and TSX into complete static HTM
|
|
|
14
14
|
|
|
15
15
|
> Experimental `0.8.x`: the compiler API and supported TSX surface may change.
|
|
16
16
|
|
|
17
|
-
**Latest release: 0.8.
|
|
17
|
+
**Latest release: 0.8.55 - Signature-keyed runtime families.** Equal standalone capability signatures reuse one runtime family, different signatures stay isolated, and enhanced-navigation groups retain one union ESM singleton for layout state and lifecycle ownership. Read the [release notes](./RELEASES.md#0855---signature-keyed-runtime-families), open the [release page](https://github.com/kudzujs/kudzu/releases/tag/v0.8.55), or follow the [architecture packet](./docs/next-architecture/README.md).
|
|
18
18
|
|
|
19
19
|
- [Documentation](https://kudzujs.cloud/docs)
|
|
20
20
|
- [Installation guide](https://kudzujs.cloud/docs#install)
|
package/RELEASES.md
CHANGED
|
@@ -1,5 +1,118 @@
|
|
|
1
1
|
# Kudzu Releases
|
|
2
2
|
|
|
3
|
+
## 0.8.55 - Signature-keyed runtime families
|
|
4
|
+
|
|
5
|
+
Kudzu 0.8.55 replaces site-wide runtime specialization with deterministic capability families loaded only by the routes that require them.
|
|
6
|
+
|
|
7
|
+
### Changed in 0.8.55
|
|
8
|
+
|
|
9
|
+
- Equal standalone CapabilityIR signatures share one runtime family under `assets/runtime/<family>/`.
|
|
10
|
+
- Different route signatures emit isolated core, binding, list, effect, native, serialization, style, and selector modules.
|
|
11
|
+
- Route-specific parameter, effect, and native entries import their assigned family directly.
|
|
12
|
+
- Artifact report v2 records exact route signatures, assigned families, emitted family requirements, handlers, Workers, styles, and chunks.
|
|
13
|
+
- Development state restoration discovers the family core module from the rendered document.
|
|
14
|
+
|
|
15
|
+
### Navigation ownership
|
|
16
|
+
|
|
17
|
+
- Every enhanced-navigation group unions its route capabilities into one family.
|
|
18
|
+
- Persistent layout state, committers, mount hooks, unmount hooks, and native listeners retain one ESM singleton identity across group navigation.
|
|
19
|
+
- Independent groups may reuse byte-identical family files while keeping their own route matcher and layout/application identity modules.
|
|
20
|
+
|
|
21
|
+
### Output
|
|
22
|
+
|
|
23
|
+
- Static routes emit no runtime family and remain zero JavaScript.
|
|
24
|
+
- An unrelated standalone route capability no longer changes another route's loaded runtime bytes or cache URL.
|
|
25
|
+
- Legacy root-level `assets/kudzu*.js` runtime files are no longer emitted.
|
|
26
|
+
- No runtime loader, hydration layer, VDOM, component tree, or SPA router is added.
|
|
27
|
+
|
|
28
|
+
### Validation
|
|
29
|
+
|
|
30
|
+
- Focused tests cover signature deduplication, distinct capability isolation, deterministic IDs, navigation unions, static exclusion, shared handler/Worker chunks, and family-aware public collisions.
|
|
31
|
+
- Existing navigation, effect, list, native, parameter, Worker, base-path, development restoration, and browser ownership journeys pass.
|
|
32
|
+
- `npm run check`, `npm test`, and `npm run test:package` pass with all 221 tests and 170 generated pages.
|
|
33
|
+
|
|
34
|
+
### Upgrade
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
npm install @kudzujs/core@^0.8.55
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 0.8.54 - Inspectable route artifact closure
|
|
41
|
+
|
|
42
|
+
Kudzu 0.8.54 projects each validated route edge through the final handler and Worker bundle graphs into one inspectable artifact contract.
|
|
43
|
+
|
|
44
|
+
### Changed in 0.8.54
|
|
45
|
+
|
|
46
|
+
- `.kudzu/kudzu-artifacts.json` records every route in deterministic order.
|
|
47
|
+
- Each route receives its exact CapabilityIR manifest, SHA-256 signature, and required runtime families.
|
|
48
|
+
- Handler entry ownership derives from retained RouteBuildRecord references rather than HTML or filename inference.
|
|
49
|
+
- Handler and Worker esbuild metafiles are followed transitively to report route-owned and shared chunks.
|
|
50
|
+
- Chunks reached by multiple routes include a sorted reverse ownership list.
|
|
51
|
+
- `afterBuild()` receives the same JSON-safe report as `artifacts`.
|
|
52
|
+
|
|
53
|
+
### Boundaries
|
|
54
|
+
|
|
55
|
+
- The report distinguishes exact route runtime requirements from the currently site-specialized runtime files.
|
|
56
|
+
- Enhanced-navigation routes still share their existing ESM singleton and lifecycle boundary.
|
|
57
|
+
- Signature-keyed runtime emission remains the next route-closure slice.
|
|
58
|
+
- No runtime loader, manifest fetch, SPA router, or browser behavior is added.
|
|
59
|
+
|
|
60
|
+
### Validation
|
|
61
|
+
|
|
62
|
+
- Focused checks cover route-only and shared handler chunks, external-import exclusion, Worker ownership, shared Worker chunks, deterministic route order, and distinct capability signatures.
|
|
63
|
+
- `npm run check`, `npm test`, and `npm run test:package` pass with all 220 tests and 169 generated pages.
|
|
64
|
+
|
|
65
|
+
### Upgrade
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm install @kudzujs/core@^0.8.54
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 0.8.53 - Route-aware CSS closure
|
|
72
|
+
|
|
73
|
+
Kudzu 0.8.53 links source styles only from routes whose reachable TypeScript graph imports them.
|
|
74
|
+
|
|
75
|
+
### Changed in 0.8.53
|
|
76
|
+
|
|
77
|
+
- Relative CSS imports follow each page's runtime import and re-export graph in deterministic source order.
|
|
78
|
+
- RouteBuildRecord receives each route's exact source stylesheet URLs instead of one site-wide CSS list.
|
|
79
|
+
- `kudzu.config styles` remains explicitly global, deduplicated, and excluded from route-managed ownership.
|
|
80
|
+
- CSS `?url` imports emit downloadable assets without creating stylesheet links.
|
|
81
|
+
- Unimported source CSS is no longer implicitly linked; applications import route/layout styles or configure true globals.
|
|
82
|
+
|
|
83
|
+
### Enhanced navigation
|
|
84
|
+
|
|
85
|
+
- Navigable documents mark route-managed source styles separately from configured global links.
|
|
86
|
+
- Destination styles load before route cleanup and DOM replacement.
|
|
87
|
+
- Shared layout stylesheet links retain URL, DOM identity, and cascade order across navigation.
|
|
88
|
+
- Outgoing route styles are removed after successful preparation.
|
|
89
|
+
- Overlapping navigation cancels and rolls back provisional stylesheet transactions without disturbing the newer route.
|
|
90
|
+
- Invalid, duplicate, cross-origin, or failed managed stylesheets fall back to native document navigation.
|
|
91
|
+
|
|
92
|
+
### Migration evidence
|
|
93
|
+
|
|
94
|
+
- The React/Vite static sibling excludes the interactive app stylesheet while retaining zero JavaScript.
|
|
95
|
+
- Independent navigation groups exclude one another's layout and route styles.
|
|
96
|
+
- A delayed stylesheet browser test verifies cancellation rollback, shared-link identity, destination activation, and outgoing-link removal.
|
|
97
|
+
- Global style fixtures prove configured source/URL deduplication, while dynamic routes now import their intended CSS explicitly.
|
|
98
|
+
- The starter imports shared CSS through its common header so both generated routes reach the style intentionally.
|
|
99
|
+
|
|
100
|
+
### Output and performance
|
|
101
|
+
|
|
102
|
+
- Route HTML omits unrelated feature CSS and its cascade effects.
|
|
103
|
+
- Static pages remain JavaScript-free; only configured enhanced-navigation routes receive managed-style reconciliation.
|
|
104
|
+
- No CSS bundler, style runtime, SPA router, or new performance claim is added.
|
|
105
|
+
|
|
106
|
+
### Validation
|
|
107
|
+
|
|
108
|
+
- `npm run check`, `npm test`, and `npm run test:package` pass with all 219 tests and 168 generated pages.
|
|
109
|
+
|
|
110
|
+
### Upgrade
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm install @kudzujs/core@^0.8.53
|
|
114
|
+
```
|
|
115
|
+
|
|
3
116
|
## 0.8.52 - Effect-private mutable refs
|
|
4
117
|
|
|
5
118
|
Kudzu 0.8.52 compiles component-authored mutable refs when one inline effect exclusively owns their complete lifecycle.
|
|
@@ -11,7 +11,7 @@ The top-level [`GOAL_A.md`](../../GOAL_A.md) and [`GOAL_B.md`](../../GOAL_B.md)
|
|
|
11
11
|
| C: state/resource model | Research only | Reduced fixtures expose a limitation |
|
|
12
12
|
| D: routing compatibility | Current behavior preserved | Revisit only with migration evidence and invariant review |
|
|
13
13
|
|
|
14
|
-
The active post-`0.8.
|
|
14
|
+
The active post-`0.8.55` implementation sequence is [`large-application-ai-native-roadmap.md`](./large-application-ai-native-roadmap.md). P0.12 validation, property-level object-state dependencies, direct three-boundary callback/ref ownership, direct primitive prop state initialization, repeated direct leaf-handler callback use, direct child callback fan-out, collision-free and private Context action setters, package-neutral shared-state/action IR, browser-only package imports and private mutable refs in owned effects, route/layout CSS closure, structural per-route capability/chunk reporting, signature-keyed runtime families, measured route-entry output optimization, and the plain TypeScript source-scale fast path are complete. Incremental source and affected-route builds are next; ResourceIR remains research for cross-owner transports and subscriptions. The plan orders compiler semantic generalization, large-application foundations, compatibility boundaries, AI tooling, and production validation without changing the invariants below.
|
|
15
15
|
|
|
16
16
|
## Required Invariants
|
|
17
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Current Compiler Architecture
|
|
2
2
|
|
|
3
|
-
This maps the current `0.8.
|
|
3
|
+
This maps the current `0.8.55` architecture, built on the completed `0.8.23` Goal A compiler foundation. File and function names are the stable references; line numbers are intentionally omitted because later work may still move code.
|
|
4
4
|
|
|
5
5
|
## Responsibility Map
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ This maps the current `0.8.52` architecture, built on the completed `0.8.23` Goa
|
|
|
19
19
|
| Main semantic analysis | [`framework/compiler/source-compiler.mjs`](../../framework/compiler/source-compiler.mjs), `createKudzuTransformer()` | Produces transformed source plus explicit component, shared-state/action, handler, binding, derived, keyed, and effect ownership results. Zustand package syntax is resolved by its adapter before generic shared-state consumers. |
|
|
20
20
|
| Component ownership analysis | [`framework/compiler/analysis/component-analysis.mjs`](../../framework/compiler/analysis/component-analysis.mjs) | Produces ComponentAnalysis v2 with ordered JSON-safe owner and specialization slots for state, setters, props, refs, IDs, direct SignalIR links, structural OwnerRefs, source-local SiteIds, and source provenance. Three direct callback/ref component boundaries specialize into the same parent signal and intrinsic ownership; Context action-private setters may remain compiler-only and receive collision-free consumer-local aliases; AST identity remains private to its source-local session. |
|
|
21
21
|
| Per-source descriptor registration | [`framework/compiler/descriptor-session.mjs`](../../framework/compiler/descriptor-session.mjs), `createSemanticArtifact()`, `createDescriptorSession()` | Keeps AST descriptors private during analysis, then finalizes ModuleIR v2 with deterministic SymbolRef, SharedStateIR, SharedActionIR, SignalIR, HandlerIR, BindingIR, DerivedIR, EffectIR, KeyedBlockIR, and ImportIR slots. One fail-closed boundary validates every source-local and component ownership edge before build-module generation. |
|
|
22
|
-
| Route artifact graph | [`framework/compiler/route-build-record.mjs`](../../framework/compiler/route-build-record.mjs), `createRouteBuildRecord()`, `planRouteArtifacts()` | Validates each rendered route's RouteIR, capabilities, entry paths, styles, and exact handler/effect references. Handler
|
|
22
|
+
| Route artifact graph | [`framework/compiler/route-build-record.mjs`](../../framework/compiler/route-build-record.mjs), `createRouteBuildRecord()`, `planRouteArtifacts()`; [`framework/compiler/route-artifact-report.mjs`](../../framework/compiler/route-artifact-report.mjs), `createRouteArtifactReport()` | Validates each rendered route's RouteIR, capabilities, entry paths, styles, and exact handler/effect references. Handler and Worker esbuild metafiles project transitive output edges back through those records into deterministic per-route capability signatures and runtime requirements plus emitted handler, Worker, stylesheet, and shared-chunk closure. |
|
|
23
23
|
| Route contract validation | [`framework/compiler/route-ir.mjs`](../../framework/compiler/route-ir.mjs), `assertRouteIR()` | Fails before artifact selection for invalid state/parameter identity, commands, native/effect captures and dependencies, reactive descriptors, conditions, keyed-list identity/ownership, marker fields, or JSON safety. Immutable in-memory contracts validate once by identity. |
|
|
24
24
|
| Command IR and codegen | [`framework/compiler/optimize/command-specialization.mjs`](../../framework/compiler/optimize/command-specialization.mjs), [`framework/compiler/ir/module-ir.mjs`](../../framework/compiler/ir/module-ir.mjs), [`framework/compiler/codegen/command-codegen.mjs`](../../framework/compiler/codegen/command-codegen.mjs) | Direct commands use the existing fast path; proven immutable state aliases and one-call local helpers specialize to the same JSON-safe command ModuleIR. Recursion, escape, mutation, and dynamic helper dispatch fail explicitly, while unrelated handlers retain native ESM. Codegen emits the existing `__kBehavior` AST and command ABI. |
|
|
25
25
|
| Source compilation | [`framework/compiler/source-compiler.mjs`](../../framework/compiler/source-compiler.mjs), `compileSource()` | Runs TypeScript with the Kudzu transformer, rejects surviving React/Router references, and returns a JSON-safe project-relative build module, component analysis, ModuleIR, optional handler module, and imported assets without filesystem writes. |
|
|
@@ -29,10 +29,10 @@ This maps the current `0.8.52` architecture, built on the completed `0.8.23` Goa
|
|
|
29
29
|
| Worker graph | [`framework/compiler/worker-compiler.mjs`](../../framework/compiler/worker-compiler.mjs) | Returns functional Worker rewrite results and JSON-safe EffectIR edges, validates relative graphs, emits content-hashed ESM, and resolves placeholders only for rendered effects. |
|
|
30
30
|
| Shared path conversion | [`framework/compiler/path-helpers.mjs`](../../framework/compiler/path-helpers.mjs) | Converts project-relative module, browser, asset, and base paths for build and development serving. |
|
|
31
31
|
| Build-time JSX execution | [`framework/core.mjs`](../../framework/core.mjs), `renderPage()` | Executes compiled pages/layouts, allocates deterministic route/layout ownership IDs, emits complete HTML, and returns RouteIR v1 plus capability facts and exact retained handler references. |
|
|
32
|
-
| Route capability projection | [`framework/compiler/route-capability-planner.mjs`](../../framework/compiler/route-capability-planner.mjs), `planRouteCapabilities()` | Validates RouteBuildRecord and RouteIR v1,
|
|
32
|
+
| Route capability projection | [`framework/compiler/route-capability-planner.mjs`](../../framework/compiler/route-capability-planner.mjs), `planRouteCapabilities()`; [`framework/compiler/runtime-family-planner.mjs`](../../framework/compiler/runtime-family-planner.mjs), `planRuntimeFamilies()` | Validates RouteBuildRecord and RouteIR v1, projects exact route CapabilityIR, deduplicates equal standalone signatures, and unions each enhanced-navigation group at one required ESM singleton boundary. |
|
|
33
33
|
| Effect entry generation | [`framework/compiler/effect-codegen.mjs`](../../framework/compiler/effect-codegen.mjs) | Generates ordinary, dependency, owned, and navigable effect entries from rendered descriptors. |
|
|
34
34
|
| Runtime generation | [`framework/compiler/runtime-codegen.mjs`](../../framework/compiler/runtime-codegen.mjs), [`framework/compiler/list-runtime-codegen.mjs`](../../framework/compiler/list-runtime-codegen.mjs), [`framework/compiler/param-codegen.mjs`](../../framework/compiler/param-codegen.mjs) | Consumes versioned contracts, specializes authored capability sources with fail-closed anchors, and returns source/define results without filesystem ownership. |
|
|
35
|
-
| Artifact emission | `framework/build.mjs` | Selects route artifacts from RouteBuildRecord edges
|
|
35
|
+
| Artifact emission | `framework/build.mjs` | Selects route artifacts from RouteBuildRecord edges, emits each distinct runtime family under `assets/runtime/<family>/`, writes route HTML in bounded batches, bundles in a project-local staging sibling, copies public subtrees without replacing generated paths, runs `afterBuild`, then promotes with rollback. Byte-identical native, parameter, and effect entries share one file only when their family imports also match. |
|
|
36
36
|
| Browser capabilities | [`framework/*.js`](../../framework/) | Small optional modules for commands, bindings, lists, effects, native handlers, serialization, parameters, and navigation; native contexts invalidate writes and refs at DOM ownership release, with no component runtime. |
|
|
37
37
|
| Opt-in navigation | [`framework/navigation-runtime.js`](../../framework/navigation-runtime.js) plus `framework/build.mjs` navigation configuration/emission | Fetches and validates complete same-origin documents, replaces only the marked route range, manages route/layout disposal, history, focus, finite prefetch retention, and native fallback. |
|
|
38
38
|
| Development serving | [`framework/dev-server.mjs`](../../framework/dev-server.mjs) and [`framework/dev-state.js`](../../framework/dev-state.js) | Rebuild/watch/SSE and response-only short-lived state restoration; failed rebuilds show the existing error overlay while preserving the previous on-disk output. |
|
|
@@ -56,11 +56,11 @@ src/pages entries + config
|
|
|
56
56
|
-> validated RouteBuildRecord per emitted route
|
|
57
57
|
-> capability facts, route entries, styles, handler/effect artifact edges
|
|
58
58
|
-> remove unrendered handlers/effects/Workers
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-> specialize and emit
|
|
59
|
+
-> planRuntimeFamilies(RouteBuildRecord[], navigation groups)
|
|
60
|
+
-> exact route signatures plus deduplicated standalone/group CapabilityIR families
|
|
61
|
+
-> specialize and emit each selected runtime family under assets/runtime/<family>/
|
|
62
62
|
-> reuse exact generated route-entry transforms within this build
|
|
63
|
-
-> write route index.html, CSS/assets, Worker graphs, and
|
|
63
|
+
-> write route index.html, CSS/assets, Worker graphs, rewrites, and per-route artifact closure into staging/scratch
|
|
64
64
|
-> copy public paths only where they do not replace generated artifacts
|
|
65
65
|
-> optional afterBuild() against staging
|
|
66
66
|
-> rollback-safe promotion to dist; recover an interrupted backup on the next admitted build after stale-lock removal
|
|
@@ -42,7 +42,7 @@ The current limiting architecture is observable in these files:
|
|
|
42
42
|
| Lists/ranges | `source-compiler.mjs`, `list-runtime.js` | Strong keyed ownership, but syntax recognition and runtime branches are list-specific and not a general range/window primitive |
|
|
43
43
|
| ModuleIR | `compiler/ir/module-ir.mjs` | Numeric slots, names, export strings, and formatted owner strings coexist; several sections are descriptive rather than authoritative inputs |
|
|
44
44
|
| RouteIR/CapabilityIR | `route-capability-planner.mjs` | Validation is shallow and capability selection is site-wide across interactive routes |
|
|
45
|
-
| Build/codegen | `framework/build.mjs`, runtime generators | Full destructive builds,
|
|
45
|
+
| Build/codegen | `framework/build.mjs`, runtime generators | Full destructive builds, source-text runtime surgery, and no route capability/chunk closure report; route CSS closure is structural |
|
|
46
46
|
| Browser lifetime | `native-runtime.js`, `effect-runtime.js`, `navigation-runtime.js` | Effects and native handlers invalidate stale writes at their existing effect or DOM ownership boundary |
|
|
47
47
|
| Compatibility | React/Router/Zustand passes plus core branches | Package-specific knowledge is not contained behind one adapter boundary |
|
|
48
48
|
| AI interface | CLI and string diagnostics | No stable diagnostic codes, semantic index, explain, fix, or migration analysis output |
|
|
@@ -383,7 +383,7 @@ After the relevant P0 foundations, investigate capabilities in this order:
|
|
|
383
383
|
3. Package-neutral shared state/actions and migration of current Zustand internals. **Completed in `0.8.50`:** Zustand source normalization produces one generic shared-state adapter descriptor; selectors and handlers register JSON-safe SharedStateIR/SharedActionIR records, handler lowering consumes package-neutral actions, and existing RouteIR, layout ownership, same-turn updates, navigation persistence, and browser output remain unchanged. Redux/RTK and public adapter APIs remain unsupported.
|
|
384
384
|
4. Browser-only package imports in owned effect/resource modules. **Completed in `0.8.51` for effects:** direct package references in inline effect setup/cleanup callbacks use existing package import records and route-owned effect ESM bundling; build-time component modules and static siblings omit the package. Helper-indirect, render-time, dynamic-import, and ResourceIR package graphs remain unsupported.
|
|
385
385
|
5. ResourceIR from at least two independent WebSocket/SSE/SDK fixtures with the same semantics. **Completed in `0.8.52` without ResourceIR for private ownership:** the E2B terminal and route-owned WebSocket fixtures lower refs used exclusively by one inline effect to invocation-private closure objects, while existing effect ownership supplies replacement, cleanup, stale setter invalidation, navigation, and BFCache disposal. ResourceIR remains unapproved and now requires independent cross-owner transport/subscription fixtures that cannot fit this narrower model.
|
|
386
|
-
6. Route/layout capability and CSS chunk closure.
|
|
386
|
+
6. Route/layout capability and CSS chunk closure. **Route/layout CSS closure completed in `0.8.53`; structural reporting completed in `0.8.54`; signature-keyed runtime emission completed in `0.8.55`:** each page's reachable TypeScript graph supplies exact stylesheet edges, and `.kudzu/kudzu-artifacts.json` follows handler and Worker metafiles transitively. Equal standalone CapabilityIR signatures now share one co-located runtime family, different signatures emit isolated files, and every enhanced-navigation group uses one union family so persistent layout state and lifecycle hooks retain a single ESM identity. Static routes emit no family, route entries import their assigned family, and unrelated route capabilities no longer change loaded runtime bytes or URLs.
|
|
387
387
|
7. Incremental source and affected-route builds.
|
|
388
388
|
8. Range ownership and virtualization only after a real data-heavy fixture establishes direct DOM limits.
|
|
389
389
|
9. Optimistic shared transactions only after independent mutation fixtures establish commit/rollback semantics.
|
|
@@ -481,4 +481,4 @@ The first comparison is Kudzu versus React + Vite using the same agent, model, t
|
|
|
481
481
|
|
|
482
482
|
## Immediate Decision
|
|
483
483
|
|
|
484
|
-
PR 1 through PR 12, the `0.8.40` property-dependency slice, the `0.8.41` and `0.8.43` direct multi-boundary callback/ref slices, the `0.8.44` Context alias slice, the `0.8.46` action-only Provider setter slice, the `0.8.47` direct primitive prop initializer slice, the `0.8.48` repeated direct leaf-handler callback slice, the `0.8.49` direct child callback fan-out slice, the `0.8.50` package-neutral shared-state/action slice, the `0.8.51` owned-effect package import slice, the `0.8.52` effect-private mutable-ref slice, and the `0.8.42` measured route-output optimization are complete. Continue
|
|
484
|
+
PR 1 through PR 12, the `0.8.40` property-dependency slice, the `0.8.41` and `0.8.43` direct multi-boundary callback/ref slices, the `0.8.44` Context alias slice, the `0.8.46` action-only Provider setter slice, the `0.8.47` direct primitive prop initializer slice, the `0.8.48` repeated direct leaf-handler callback slice, the `0.8.49` direct child callback fan-out slice, the `0.8.50` package-neutral shared-state/action slice, the `0.8.51` owned-effect package import slice, the `0.8.52` effect-private mutable-ref slice, the `0.8.53` route/layout CSS closure slice, the `0.8.54` structural per-route capability/chunk report, the `0.8.55` signature-keyed runtime families, and the `0.8.42` measured route-output optimization are complete. Continue with item 7 incremental source and affected-route builds; keep ResourceIR limited to cross-owner fixtures and do not skip directly to a public adapter/store API, router, virtualization, or unsupported ecosystem package feature.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Planned Version Sequence
|
|
2
2
|
|
|
3
|
-
This is an execution sequence, not release history. `0.8.16` through `0.8.
|
|
3
|
+
This is an execution sequence, not release history. `0.8.16` through `0.8.55` are completed scopes represented by package/release records.
|
|
4
4
|
|
|
5
5
|
Keep each patch behavior-preserving and independently reviewable. If a boundary proves inseparable, revise this plan before combining releases; do not silently broaden a patch.
|
|
6
6
|
|
|
@@ -43,6 +43,9 @@ Keep each patch behavior-preserving and independently reviewable. If a boundary
|
|
|
43
43
|
| `0.8.50` | Isolate reduced Zustand migration behind package-neutral shared-state and action IR. | Validated shared identities/actions preserve RouteIR, layout lifetime, same-turn updates, diagnostics, browser behavior, and zero store runtime. |
|
|
44
44
|
| `0.8.51` | Bundle direct browser-only package references from inline owned effect setup/cleanup callbacks. | Package code stays in referenced route effect ESM; build scratch and static siblings omit it while indirect/render-time uses fail. |
|
|
45
45
|
| `0.8.52` | Lower effect-exclusive mutable refs into setup-invocation closures. | E2B and WebSocket fixtures preserve generation, replacement, BFCache, and cleanup without captures, ResourceIR, or static-sibling JavaScript. |
|
|
46
|
+
| `0.8.53` | Close source CSS over each route's reachable TypeScript graph and reconcile managed styles during navigation. | Routes exclude unrelated CSS; destination styles load before replacement, shared layout links retain identity, and cancelled loads roll back safely. |
|
|
47
|
+
| `0.8.54` | Project per-route capability requirements and post-bundle handler/Worker chunk closure into an inspectable artifact contract. | Deterministic signatures, exact retained entries, transitive chunks, reverse shared ownership, static-route exclusion, and `afterBuild()` access pass. |
|
|
48
|
+
| `0.8.55` | Emit deduplicated signature-keyed runtime families while preserving navigation-group singleton ownership. | Equal standalone signatures share files, different signatures isolate output, grouped routes share one union family, and static routes emit no runtime. |
|
|
46
49
|
|
|
47
50
|
## Sequence Rules
|
|
48
51
|
|
package/framework/README.md
CHANGED
|
@@ -49,6 +49,8 @@ Reduced Zustand migration stores lower through package-neutral `SharedStateIR` a
|
|
|
49
49
|
- `compiler/render-control-pass.mjs`: render-function early-return and exhaustive adjacent-assignment normalization.
|
|
50
50
|
- `compiler/router-pass.mjs`: React Router import validation and native Link, pathname parameter, search parameter, and imperative navigation lowering.
|
|
51
51
|
- `compiler/route-capability-planner.mjs`: RouteIR v1 validation and pure CapabilityIR v1 projection into runtime and artifact requirements.
|
|
52
|
+
- `compiler/runtime-family-planner.mjs`: deterministic standalone capability deduplication and enhanced-navigation group unioning at the ESM singleton boundary.
|
|
53
|
+
- `compiler/route-artifact-report.mjs`: deterministic per-route capability signatures and runtime requirements plus handler, Worker, stylesheet, and transitive esbuild chunk closure reporting.
|
|
52
54
|
- `compiler/runtime-codegen.mjs`: fail-closed core, effect, binding, native, and navigation runtime generation from CapabilityIR.
|
|
53
55
|
- `compiler/list-runtime-codegen.mjs`: fail-closed keyed-list runtime generation from CapabilityIR list/effect sections.
|
|
54
56
|
- `compiler/worker-compiler.mjs`: relative TypeScript Worker candidate validation, effect rewriting, graph validation, and content-hashed ESM emission.
|
|
@@ -70,13 +72,15 @@ Reduced Zustand migration stores lower through package-neutral `SharedStateIR` a
|
|
|
70
72
|
|
|
71
73
|
Compiler ownership follows explicit stages. `build.mjs` coordinates project discovery, source compilation, RouteIR rendering, RouteBuildRecord collection, CapabilityIR planning, generator calls, and artifact emission. `compiler/normalization-pipeline.mjs` owns pass order and parent repair. The main transformer analyzes normalized source while `compiler/descriptor-session.mjs` owns one per-source semantic artifact containing HandlerIR, BindingIR, DerivedIR, KeyedBlockIR, EffectIR, and client imports. `core.mjs` emits complete HTML, RouteIR v1, and exact handler references: route-local state `slot` is an internal array reference, `id` remains the browser/DOM identity, and `name` remains readable development metadata. `compiler/route-build-record.mjs` validates structural artifact edges, and `compiler/route-capability-planner.mjs` projects CapabilityIR v1 from those records. Focused codegen modules consume IR/descriptors and return route-specific source without source analysis or filesystem ownership. The completed architecture record lives in `docs/next-architecture`; it adds no runtime or accepted syntax by itself.
|
|
72
74
|
|
|
75
|
+
`.kudzu/kudzu-artifacts.json` records each route's exact CapabilityIR signature, assigned emitted runtime family, handler, Worker, stylesheet, and transitive chunk edges. Equal standalone signatures reuse `dist/assets/runtime/<family>/`; every enhanced-navigation group intentionally shares one union family. The same JSON-safe contract is available to `afterBuild()` as `artifacts`.
|
|
76
|
+
|
|
73
77
|
New syntax support belongs in an existing pass or a focused new pass only when a reduced migration fixture proves it. Passes must preserve source-located diagnostics, avoid module-global analysis state, and expose metadata through return values rather than AST-identity side channels. Build orchestration stays in `build.mjs`; feature-specific graph validation or code generation moves under `compiler/` when it has a stable input/output boundary.
|
|
74
78
|
|
|
75
79
|
Static routes receive no browser runtime. Command routes receive `runtime.js`; dependency effects use route-specific `kudzu-deps.js` unless that route already requires shared commit hooks; runtime bracket pages using `useParams()` add one route-specific pathname matcher; reactive attributes and conditions add `binding-runtime.js`; keyed lists add `list-runtime.js`; native handlers add `native-runtime.js`; effects add `effect-runtime.js` and one route-specific entry. Generated module scripts live in the document head, so cold downloads overlap HTML transfer while standard module deferral preserves execution after parsing. A single effect with one dependency compiles to a direct runner; generic maps, sets, and ordering are reserved for larger effect graphs. Dependency commits coalesce in a microtask; affected cleanups are awaited in declaration order before replacement setups run. Document cleanup integrates with shared unmount hooks when present and otherwise disposes directly on non-persisted `pagehide`. List builds remove unused text-range, attribute, event, expression, condition, seed, and mount branches. Effect builds omit capture deserialization entirely when every effect scope is empty. Capability runtimes share state and lifecycle hooks through `shared-runtime.js`. Generated evaluators and their bundled relative TypeScript helpers live under `dist/assets/handlers/`; shared helper chunks are emitted only when multiple handler entries need them. Runtime fallback rewrites are ordered by specificity in `.kudzu/kudzu-plan.json` and passed to `afterBuild()`; exact static files take precedence in development. The dev server derives stable state identities from route-unique state variable names in each route plan; every state sharing a duplicate name is omitted. It then injects its SSE reload, short-lived full-URL-scoped logical-state snapshot, and build-error client into responses only, never into `dist/`. Snapshots are consumed even when the next page is static or broken. Reload restoration covers compatible framework state, not uncontrolled DOM state, focus, selection, or imperative mutations.
|
|
76
80
|
|
|
77
81
|
Exact relative `.worker.ts` constructors in inline effects are validated and bundled in a separate content-hashed ESM graph under `dist/assets/workers/`. Those files are referenced only by rendered effect handlers and never become document capability scripts, preloads, or window imports; unreachable source effects do not emit their Worker roots. Worker graphs allow relative TypeScript ESM runtime imports only and reject JSX, package runtime imports, import-equals declarations, dynamic imports, `require()`, and paths outside `src`. Ordinary runtime imports or re-exports of `.worker.ts` and Worker construction in imported keyed-row effects are rejected.
|
|
78
82
|
|
|
79
|
-
Page `metadata` can emit description, canonical, favicon, manifest, Open Graph, and Twitter Card tags without a client runtime.
|
|
83
|
+
Page `metadata` can emit description, canonical, favicon, manifest, Open Graph, and Twitter Card tags without a client runtime. Relative source CSS imports follow each page's reachable TypeScript graph and link only from those routes; `kudzu.config` styles remain explicitly global. Enhanced navigation loads incoming managed styles before route replacement, reuses shared links, and removes outgoing links. All styles are emitted before `afterBuild()` runs; static stylesheet links in component JSX fail compilation instead of loading from the body.
|
|
80
84
|
|
|
81
85
|
Inline SVG rendering normalizes an explicit set of common React presentation aliases before static serialization and binding descriptor creation. Reactive aliases use the existing generic `setAttribute` path. Reactive conditionals and flat intrinsic keyed lists store inert branch or row markup on SVG markers and parse it in the actual parent namespace only when replacement nodes are needed; existing condition/list ownership then handles insertion, identity, updates, and removal. Focus, keyboard, and click handlers on keyed SVG points may update parent state for an external accessible HTML tooltip, and retained handlers read the latest item after list updates. Builds without structural SVG compile out that fragment path, and static SVG adds no JavaScript. Keyed-item conditions, nested SVG lists, MathML structures, and namespaced attributes remain unsupported.
|
|
82
86
|
|