Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[2.0.0] - Unreleased
A rewrite implementing the Inertia.js v3 protocol. See the upgrade guide for migration instructions.
Added
inertiaapplication component (Manager), bootstrapped automatically through composerextra.bootstrap- Inertia v3 page object:
sharedProps,deferredProps,mergeProps,prependProps,deepMergeProps,matchPropsOn,onceProps,scrollProps,rescuedProps,flash,encryptHistory,clearHistory,preserveFragment - Prop types:
Inertia::optional(),defer()(with groups and rescue),always(),merge()/deepMerge()(withprepend(),append()andmatchOn()),once(),scroll(), plusProvidesInertiaProperties/ProvidesInertiaProperty - Recursive prop resolution with nested special props and dot-notation partial reloads (
onlyandexcept) Inertia::withErrors()with error bags,Inertia::flash(),Inertia::back(),Inertia::shareOnce()- History encryption (
encryptHistory(),clearHistory()) andpreserveFragment() - Request lifecycle handling: asset version checks (GET only),
Vary: X-Inertia,303after PUT/PATCH/DELETE, fragment redirects viaX-Inertia-Redirect, redirect back for empty responses, Yii AJAX redirect (X-Redirect) fix - CSRF protection for the Inertia HTTP client (
XSRF-TOKENcookie /X-XSRF-TOKENheader) - Automatic
JsonParserregistration for JSON form submissions Vitehelper for manifest and dev server (HMR, React refresh, CSP nonces), withthrowOnMissingManifestfor test environments without a frontend build- Server-side rendering through
Ssr\HttpGateway(production server and Vite dev server), with path exclusions Inertia::app()andInertia::ssrHead()root view helpers,stubs/inertia.php- Documentation site at https://crenspire.github.io/yii2-inertia/ (guides and API reference)
- Example application rewritten for Inertia v3, React 19, Vite 8 and Tailwind CSS 4
- Test suite covering the protocol, lifecycle, Vite and SSR; CI on PHP 8.1–8.5 with lowest and highest dependencies
Changed
- Requires
yiisoft/yii2~2.0.55 - Initial page data is embedded in a
<script type="application/json">element Inertia::version()is a setter only; useInertia::getVersion()(always a string)- Default asset version is the hash of the Vite manifest
- The
inertia()helper is now a global function - Inertia JSON responses are encoded by the adapter (
$response->datais a string)
Removed
ViewRenderer(did not compile and could not be selected by Yii's renderer lookup)InertiaResponseconfig/inertia.php(was never loaded)
Fixed
- Query string duplicated in the page URL
TypeErrorwhen the version callback returned an integer- Props serialized differently on the first visit and on Inertia visits; closures encoded as
{} - Partial reloads ignoring the component name
- Asset version mismatches returning
409for non-GET requests - Composer installation and CI (missing asset-packagist repository, plugin permissions, test bootstrap, lint step that could not fail)
1.0.0
- Initial release