Skip to content

Migrate to Inertia.js v3 (useHttp replaces fetch/axios)#34

Draft
gutobenn wants to merge 4 commits intomainfrom
inertia-v3-migration
Draft

Migrate to Inertia.js v3 (useHttp replaces fetch/axios)#34
gutobenn wants to merge 4 commits intomainfrom
inertia-v3-migration

Conversation

@gutobenn
Copy link
Copy Markdown
Member

@gutobenn gutobenn commented Mar 31, 2026

Closes #29

Summary

  • Upgrades inertiajs/inertia-laravel from v2 to v3.0.1 and @inertiajs/react from v2 to v3.0.1
  • Upgrades React from v18 to v19 (required by Inertia v3)
  • Replaces all 31 fetch() calls and 1 axios call across 8 files with Inertia v3's useHttp hook
  • Removes axios dependency entirely (Inertia v3 ships a built-in XHR client), reducing bundle size by ~35 kB
  • Fixes Inertia v3 breaking changes (<title data-inertia>, ResolvedComponent type for page resolution)

Test plan

  • npm run build passes (TypeScript + Vite)
  • php artisan test --compact passes (146 tests)
  • Edit and save a customer (ActiveCustomers/Show — 18 converted calls)
  • Edit and save a prospect (Prospects/Show — 7 converted calls)
  • View email panel on a customer/prospect (EmailActivityPanel + EmailDetailModal)
  • Regenerate an invoice PDF and resend email (AccountsReceivable/Index)
  • Update admin settings and email templates
  • Change prospect status from list view (Prospects/Index)
  • Create a new prospect/customer (useForm paths — unaffected)
  • Navigate between pages (Link/router — unaffected)

@gutobenn gutobenn self-assigned this Mar 31, 2026
gutobenn added 3 commits April 1, 2026 23:12
# Conflicts:
#	claude.md
#	composer.json
#	composer.lock
#	package-lock.json
#	package.json
#	resources/js/Components/EmailActivityPanel.tsx
#	resources/js/Components/EmailDetailModal.tsx
#	resources/js/Pages/AccountsReceivable/Index.tsx
#	resources/js/Pages/ActiveCustomers/Show.tsx
#	resources/js/Pages/Admin/EmailTemplates.tsx
#	resources/js/Pages/Admin/Settings.tsx
#	resources/js/Pages/Prospects/Index.tsx
#	resources/js/Pages/Prospects/Show.tsx
#	resources/js/app.tsx
#	resources/js/types/global.d.ts
composer.lock needed inertia-laravel v3 and package-lock.json
needed to match the merged package.json dependencies.
- Format app.tsx with Prettier
- Publish Inertia config with correct Pages path (uppercase P)
  to fix test failures on case-sensitive filesystems (Linux CI)
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.

Migrate to Inertia 3.0 (to replace fetch() calls)

1 participant