Migrating from Inertia
Overview
Inertia works very similarly as Hybridly, so the migration is mostly dependency and syntax changes.
Both APIs are very similar, but you will need to rename imports, adapt to slightly different syntaxes, make a few architectural changes (mostly for front-end files), and a few other minor tweaks.
You are welcome to ask for help on our Discord server if you find any issue.
Dependency changes
We recommend cleaning up dependencies and making the obvious changes before anything else.
First, remove some Composer and npm packages:
composer remove tightenco/ziggy
composer remove inertiajs/inertia-laravel
npm uninstall \
@inertiajs/progress @inertiajs/inertia @inertiajs/inertia-vue3 \
ziggy-js @types/ziggy-js
You may also remove the following files if you have them:
- app/Console/Commands/GenerateZiggyRoutes.php
- config/inertia.php
API changes
The easiest part done, you will need to install Hybridly by following the installation guide.
The next step will be to find Inertia APIs and replace them with their Hybridly equivalents. Here's a non-exhaustive list of things to change:
- Moving
resources/views/app.blade.php
toresources/application/root.blade.php
- Replacing the
@inertia
directive with@hybridly
- Replacing the
- Moving
resources/js/app.js
toresources/application/main.ts
- Replacing the
createInertiaApp
initialization function withinitializeHybridly
- Replacing the
- Moving
HandleInertiaRequests.php
toHandleHybridRequests.php
- Replacing
Inertia::render
andinertia
calls withhybridly
orview
ones - Replacing
router.*
orInertia.*
calls with our similar navigation syntax - Adapting
useForm
usage with our own form syntax - Replacing
<Head>
component with@unhead/vue
'suseHead