Skip to content

Kudzu 0.7.16 - Build-time lazy state

Choose a tag to compare

@bunzzeok bunzzeok released this 03 Aug 00:17
· 47 commits to main since this release

Kudzu 0.7.16 accepts the common React-shaped useState(() => initialValue) form when the initializer directly returns a serializable literal, lowering it into existing compiler-owned state with no browser component runtime.

New in 0.7.16

  • Anonymous synchronous zero-argument lazy initializers may directly return primitive, plain-object, or array literals.
  • Ordinary, repeated, imported, conditional, and keyed-row state reuse existing ownership paths.
  • Conditional remount recreates fresh serialized object or array state instead of restoring stale data.
  • React migration imports and direct @kudzujs/core imports receive the same behavior and TypeScript inference.
  • Dynamic calls, captures, parameters, async or generator functions, named function expressions, and multi-statement bodies fail with source-located diagnostics.
  • Static routes remain JavaScript-free; lazy initializer functions are absent from generated browser modules.

Boundary

Kudzu evaluates no arbitrary user code at build time. Lazy useReducer initialization and dynamic state factories remain unsupported.

Upgrade

npm install @kudzujs/core@^0.7.16

The matching project generator is create-kudzu@0.1.71.