Releases: inertiajs/inertia-phoenix
Version 1.0.0-beta.1
Breaking Changes
The errors serializer (for Ecto.Changeset
structs) has been adjusted to better align with the behavior in the Laravel adapter in cases when there are multiple validation errors for a single field.
Old Behavior
Previously, the serializer would include each error under a separate key, with a [0]
index suffix, like this:
{
"name[0]": "is too long",
"name[1]": "is not real"
}
While this retains maximal information about all the errors for a field, in practice it's difficult to target the right error records for display in the UI.
New Behavior
Now, the serializer simply takes the first error message and returns it under the field name, without any added suffix:
{
"name": "is too long"
}
Bug Fixes
- Allow for external redirects from
PUT
/PATCH
/DELETE
requests (#22)
Features
Support new Inertia v2 mechanics 🎉. There are no breaking changes required to support v2, only new features:
- Add
encrypt_history
function to instruct the client-side to encrypt the history entry. - Add
clear_history
function to instruct the client-side to clear history. - Add
inertia_optional
function, to replace the now-deprecatedinertia_lazy
function. - Add
inertia_merge
function to instruct the client-side to merge the prop value with existing data. - Add
inertia_defer
function to instruct the client-side to fetch the prop value immediately after initial page load.
This version also includes some new features:
- Helpers for testing Inertia-based controller responses via the
Inertia.Testing
module. - Added a
camelize_props
global config option and acamelize_props
function (to use on a per-request basis) to automatically convert prop keys from snake case to camel case.
Deprecations
- The
inertia_lazy/1
function has been deprecated in favor ofinertia_optional/1
Version 0.10.0
Bug Fixes
- Remove unsupported dot-notation in partial requests (related to inertiajs/inertia-laravel#641)
Version 0.9.0
Bug Fixes
- Fix improper elimination of nested props when using only partials
Version 0.8.0
Features
- Support unicode props (by using the
binary
flag on Node function calls)
Version 0.7.0
Bug Fixes
- Fix exception when assigning structs as prop values (like
DateTime
)
Version 0.6.0
Bug Fixes
- Prevent overly greedy empty object elimination (#14)
Version 0.5.0
- Assign errors via an
assign_errors
helper (#10) - Preserve assigned errors across redirects (#10)
- Set up external redirects properly for Inertia requests (#11)
- Pass CSRF tokens via cookies (#12)
- Forward flash contents across forced refreshes (#13)
- Automatically pass Phoenix flash data via the
flash
prop
Version 0.4.0
Version 0.3.0
- Add
raise_on_ssr_failure
configuration
Version 0.2.0
- Add SSR support
- Add
<.inertia_head>
component for rendering head elements provided by SSR