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-jsYou may also remove the following files if you have them:
- app/Console/Commands/GenerateZiggyRoutes.php
- config/inertia.phpAPI 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.phptoresources/application/root.blade.php- Replacing the
@inertiadirective with@hybridly
- Replacing the
- Moving
resources/js/app.jstoresources/application/main.ts- Replacing the
createInertiaAppinitialization function withinitializeHybridly
- Replacing the
- Moving
HandleInertiaRequests.phptoHandleHybridRequests.php - Replacing
Inertia::renderandinertiacalls withhybridlyorviewones - Replacing
router.*orInertia.*calls with our similar navigation syntax - Adapting
useFormusage with our own form syntax - Replacing
<Head>component with@unhead/vue'suseHead