React source ingestion
Supported unaliased named hooks and default, namespace, or named Fragment imports compile without loading React.
REACT-SOURCE MIGRATION PREVIEW
Kudzu can now ingest supported conventional React imports as migration source, pre-render complete HTML, and emit only the direct DOM behavior each route actually uses.
THE NEW INPUT
import React, { useState } from "react"
export default function Header() {
const [open, setOpen] = useState(false)
return <React.Fragment>
<button onClick={() => setOpen(!open)}>
{open ? "Close" : "Menu"}
</button>
{open && <nav>Navigation</nav>}
</React.Fragment>
}Functions, props, fragments, named hooks, conditions, and ordinary event handlers.
Supported React imports become compile-time APIs. Components do not survive as a browser tree.
Static routes ship no JavaScript. Interactive routes ship only their direct DOM capabilities.
WHAT LANDED
Supported unaliased named hooks and default, namespace, or named Fragment imports compile without loading React.
Function components, props, children, nested conditions, and handlers retain their familiar TSX structure.
Analyzable selectors, positional keys, sibling child maps, nested rows, local state, refs, and effects specialize directly.
Accepted React import syntax does not make a static route interactive or add a client runtime.
Generated modules are checked for runtime React references; side-effect imports fail with a source location.
State, attributes, conditional DOM, effects, and event handlers ship only when the route uses them.
CURRENT BOUNDARY
Aliased hooks, React.useState, memo, useMemo, useCallback, React classes, React Router, Next-specific components, and React UI packages remain unsupported.
A real migration should reduce its first blocker to a fixture, then extend the compiler one proven pattern at a time.
UPGRADE
npm install @kudzujs/core@^0.7.0New Kudzu code should still import from @kudzujs/core. Retaining react imports is for migrations where minimizing source edits matters.