Migrating to v0.32¶
Litestar Vite v0.32.0 unifies the SSR and fragment IPC transport layer, upgrades the minimum Vite peer dependency to Vite 7+, and consolidates AsyncAPI 3.0 schema ownership on litestar-asyncapi.
Lockstep Python & npm Version Upgrade¶
Always upgrade the Python litestar-vite package and the npm litestar-vite-plugin package together so .litestar.json bridge contracts match:
SSR Transport Simplification¶
Prior to 0.32.0, Inertia SSR spawned a standalone HTTP server (node ssr.js listening on port 13714) and polled a /health endpoint. In 0.32.0, SSR uses two zero-configuration IPC transports:
- Development (
dev_mode=True):TCPStreamIPCTransportconnects directly to Vite's/__litestar_ssr__endpoint (ModuleRunner). No separate SSR server port or build is required in development. - Production (
dev_mode=False):StdioIPCTransportstreams newline-delimited JSON overstdin/stdoutpipes to a managed worker subprocess.
Removed SSR Configuration Fields¶
| Pre-0.32 Field | 0.32.0 Replacement |
|---|---|
InertiaSSRConfig(url="http://127.0.0.1:13714/render") |
Removed — Dev uses Vite's hotfile (/__litestar_ssr__); production uses StdioIPCTransport (InertiaSSRConfig.command / RuntimeConfig.ssr_command). |
InertiaSSRConfig(auto_start=True) |
Removed — Worker lifecycle is managed automatically by InertiaPlugin.lifespan(). |
InertiaSSRConfig(health_check=True) |
Removed — SSRCircuitBreaker tracks worker health per IPC call without HTTP polling. |
InertiaSSRConfig(enabled=True, timeout=2.0, fallback_to_client=True) |
Supported — Configure enabled, timeout, target_selector, command, cwd, fallback_to_client, and circuit_breaker_*. |
Dual-Mode SSR Entrypoint¶
Update your SSR entrypoint so it both exports default function render(page) (consumed by Vite's ModuleRunner in development) and calls startSsrWorker({ render }) (consumed by StdioIPCTransport in production):
import { createInertiaApp } from "@inertiajs/react";
import ReactDOMServer from "react-dom/server";
import { resolvePageComponent } from "litestar-vite-plugin/inertia-helpers";
import { startSsrWorker } from "litestar-vite-plugin/ssr-worker";
export default function render(page: unknown) {
return createInertiaApp({
page: page as never,
render: ReactDOMServer.renderToString,
resolve: (name: string) =>
resolvePageComponent(
`./pages/${name}.tsx`,
import.meta.glob("./pages/**/*.tsx", { eager: true }),
),
setup: ({ App, props }: { App: any; props: any }) => <App {...props} />,
});
}
startSsrWorker({ render });
AsyncAPI Channel Codegen¶
In 0.32.0, TypeGenConfig(generate_channels=True) requires a registered litestar_asyncapi.AsyncAPIPlugin on your Litestar application (uv add "litestar-vite[asyncapi]"):
litestar-asyncapiowns AsyncAPI 3.0 schema extraction across WebSockets,ChannelsPlugin, and SSE routes.litestar_vite.codegennormalizes the exportedasyncapi.jsondocument (normalize_asyncapi_document) and generatessrc/generated/channels.ts.