Skip to content

feat(client): migrate to @inertiajs/react v3 - #326

Merged
antosubash merged 2 commits into
feat/inertia-v3-adapterfrom
feat/inertia-v3-client
Sep 11, 2026
Merged

antosubash merged 2 commits into
feat/inertia-v3-adapterfrom
feat/inertia-v3-client

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Moves this repo's client from @inertiajs/react 2.3.27 (npm tag legacy) to 3.7.0, on top of the v3-capable adapter in #325. Based on feat/inertia-v3-adapter so it lands second.

Spec: docs/superpowers/specs/2026-09-10-inertia-v3-adapter-design.md §8 · Plan: docs/superpowers/plans/2026-09-10-inertia-v3-adapter.md Tasks 14–16

Changes

  • Pin bump at all 16 sites — host/client_app, packages/ui peers, every module's peers, both scaffold package.json.tpls and the flat-mode _APP_NPM_DEPS dict. The regression test guarding the flat scaffold's pin now asserts ^3.. The lockfile drops 37 transitive packages (axios and lodash-es among them — v3 ships its own XHR client).
  • Persistent layouts on all 21 pages move to v3's required array form: Page.layout = [AdminLayout] (×17), [AuthenticatedLayout] (×3), [PublicLayout] (×1). Every layout already took children, so this is a direct translation.
  • Router event rename in packages/ui/src/lib/spa-links.ts: router.on('invalid', …)router.on('httpException', …).
  • Head marker in host/templates/index.html: <title inertia=""><title data-inertia="">.
  • Scaffold fix: the scaffold's index.html had no head marker at all — every scaffolded app was getting a second <title> appended and <Head title> never took effect. It gains data-inertia rather than a rename.

Found by this PR's e2e run, fixed in #325

The first e2e run failed at mount with Cannot read properties of null (reading 'component'). Inertia 3 reads the initial page only from <script data-page="app" type="application/json">; the attribute form v2 used is gone from the 3.x bundle. The adapter now emits both forms (d0936ec8 on #325) so v2 and v3 clients both work.

Verification

  • make lint green · 3024 pytest · 463 vitest · tsc clean for host and packages/ui · client build green
  • 44/44 e2e in 43.9s against the v3 client
  • Browser (Playwright): v3 client mounts with zero console errors; <Head title> sets "Welcome — SimpleModule" / "Dashboard — SimpleModule" through the new marker; PublicLayout, AuthenticatedLayout and AdminLayout array forms all render (landing hero, dashboard, admin sidebar + navigation); login → dashboard → /admin/users/ → back works and history.state.page.url is the root-relative /dashboard/ — the adapter's relative-url fix and v3's pushState together, which is what GH Host should honor X-Forwarded-Proto (proxy headers): Inertia pushState SecurityError behind a TLS-terminating proxy #223 needed.

Observation, not a regression: two Vite HMR websocket reconnect failures appeared in the dev session log; every page load and navigation succeeded regardless, and this is dev-server tooling outside the migration's scope.

Test plan

  • Reviewer confirms CI is green
  • Reviewer loads / and /admin/users/ and sees no console errors
  • Reviewer scaffolds smpy new and confirms the generated app's <title> updates per page

https://claude.ai/code/session_01CwgTb8hULSfHoW2DrFrQAW

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-10T20:48:33.243525Z 9e41012 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6825d79
Status: ✅  Deploy successful!
Preview URL: https://7d0b58de.simple-module-python.pages.dev
Branch Preview URL: https://feat-inertia-v3-client.simple-module-python.pages.dev

View logs

@antosubash
antosubash added this pull request to stack #327 September 10, 2026 20:55
@antosubash
antosubash disabled the stack merge September 10, 2026 21:02
Sixteen pin sites — host/client_app, packages/ui peers, every module's
peers, both scaffold templates and the flat-mode _APP_NPM_DEPS dict —
and the regression test that guards the flat scaffold's pin now asserts
^3. The lockfile drops 37 transitive packages, axios and lodash-es among
them, which v3 no longer needs.

Claude-Session: https://claude.ai/code/session_01CwgTb8hULSfHoW2DrFrQAW
Array-form persistent layouts on all 21 pages, the invalid ->
httpException event rename in spa-links, and data-inertia as the head
marker in the host template. The scaffold's index.html had no marker
at all — every scaffolded app was getting a second <title> appended and
losing <Head title> — so it gains data-inertia rather than a rename.

Claude-Session: https://claude.ai/code/session_01CwgTb8hULSfHoW2DrFrQAW
@antosubash
antosubash force-pushed the feat/inertia-v3-client branch from 9e41012 to 6825d79 Compare September 10, 2026 21:05
@antosubash
antosubash merged commit 42fdf8c into main Sep 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant