Skip to content

Release 5.0.0-next.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 16 Jun 10:41
· 7 commits to 4.x since this release
Immutable release. Only release title and notes can be modified.

v5.0.0-next.0

⚠️ Pre-release. This is the first preview of the v5 line, published under the
npm next tag. latest still resolves to the stable 4.x line.
Install with npm i @adonisjs/inertia@next.

v5 brings @adonisjs/inertia onto Inertia 3 (the latest line) and removes the
bundled Vite plugin in favor of the new @adonisjs/vite serverEntrypoints.

💥 Breaking changes

1. Inertia 3 client is now required

The adapter targets @inertiajs/core 3.4.0. Client peer dependencies moved to
^3.4.0, which in turn requires React 19 / Vue 3.5 (Svelte 5).

  • Initial page data is now emitted in a <script type="application/json"> element
    instead of a data-page attribute on the root node. Handled automatically by
    the @inertia Edge tag — no change needed unless you hand-wrote the payload.
  • clearHistory / encryptHistory are now omitted from the page object unless
    true (the client defaults both to false).
  • Inertia 3's own client-side breaking changes apply to your app code: the
    inertia:invalid / inertia:exception events were renamed to
    inertia:httpException / inertia:networkError; router.cancel()
    router.cancelAll(); the progress-bar exports were removed; React layouts can
    no longer be arrow functions; and Axios / qs / lodash-es are no longer
    bundled with the client.

2. The @adonisjs/inertia/vite plugin has been removed

SSR is now driven by @adonisjs/vite v6's serverEntrypoints. The
@adonisjs/inertia/vite export no longer exists, and the ssr.bundle config
option was removed — ssr.entrypoint is the single source of truth (it must also
be listed under serverEntrypoints so it gets bundled for production).

✨ Features

  • Page props may now return null (#89).

🐛 Fixes

  • Deferred mergeable props no longer run their compute() on standard visits.

📦 Migration guide

  1. Upgrade Vite and Inertia to their latest versions.
  2. Install the prereleases:
    npm i @adonisjs/inertia@next @adonisjs/vite@next
    npm i @inertiajs/react@^3.4.0   # or @inertiajs/vue3@^3.4.0
  3. Move SSR to serverEntrypoints in vite.config.ts — there is no Inertia
    Vite plugin anymore:
      import { defineConfig } from 'vite'
      import react from '@vitejs/plugin-react'
      import adonisjs from '@adonisjs/vite/client'
    - import inertia from '@adonisjs/inertia/vite'
    
      export default defineConfig({
        plugins: [
          react(),
    -     inertia({ ssr: { enabled: false, entrypoint: 'inertia/ssr.tsx' } }),
    -     adonisjs({ entrypoints: ['inertia/app.tsx'], reload: ['resources/views/**/*.edge'] }),
    +     adonisjs({
    +       entrypoints: ['inertia/app.tsx'],
    +       serverEntrypoints: ['inertia/ssr.tsx'],
    +       reload: ['resources/views/**/*.edge'],
    +     }),
        ],
      })
  4. Drop ssr.bundle from config/inertia.ts if present — keep only
    ssr.entrypoint (and make sure that file is in serverEntrypoints above).
  5. Apply the Inertia 3 client changes in your front-end entrypoints (event
    renames, router.cancelAll(), progress, non-arrow React layouts) per the
    Inertia v3 upgrade guide.

🚧 Not yet implemented

This prerelease ships v3 compatibility; the v3-only protocol features are still
on the roadmap and not yet available: rescued deferred props, fragment-preserving
redirects, shared-props tracking, once props, keyed/directional & infinite-scroll
merges, multiple errors per field, and first-class flash. Nested / dot-notation
prop resolution (deferred/merge at any depth, dotted partial-reload keys) is also
not yet supported — props resolve at the top level only.

Full diff: v4.2.0...v5.0.0-next.0