Expand description
Inertia.js protocol v1.3 adapter for Purwa (first-party; no third-party Inertia crate).
§MVP (Sprint 6)
InertiaRequestextractor: readsX-Inertia, version, and partial-reload headers.InertiaRequest::respond: returns JSON for Inertia visits or an HTML skeleton for the first full-page load (embeds the page object in a<script type="application/json">).- 409 Conflict on GET when
X-Inertia-Versiondiffers from the server asset version (purwa_core::InertiaSection::asset_version), withX-Inertia-Locationset for a full reload. - Partial reloads:
X-Inertia-Partial-Componentmust match the rendered component; thenX-Inertia-Partial-Exceptwins overX-Inertia-Partial-Data;errorsis always included. SharedProps+shared::ensure_shared_propsmiddleware merge props into every page.
Vite + Svelte: use vite_manifest for full-page <script> / <link> tags and
InertiaRenderContext::html_body_injection in InertiaRequest::respond.
Errors (Sprint 10): InertiaRequest::respond_purwa_error renders purwa_core::PurwaError as the shared INERTIA_ERROR_COMPONENT page (e.g. Pages/Error.svelte).
Re-exports§
Modules§
- headers
- Inertia request/response header names (protocol v1.3).
- shared
- Per-request shared props merged into every Inertia page object.
- vite_
manifest - Parse Vite/Rollup
manifest.jsonand emit<script>/<link>tags for full-page HTML.
Structs§
- Inertia
Render Context - Request-scoped values for
InertiaRequest::respond(keeps the handler signature small). - Inertia
Request - Parsed Inertia-related headers for one request.
Constants§
- INERTIA_
ERROR_ COMPONENT - Default Svelte page name for
InertiaRequest::respond_purwa_error.