Releases: inertiajs/inertia-phoenix
Version 2.6.0
Added
- Add
inertia_scroll/2function to support infinite scroll pagination. Automatically configures merge behavior and extracts pagination metadata for the client-sideInfiniteScrollcomponent. IncludesInertia.ScrollMetadataprotocol for extensible pagination library support (#63). - Add
inertia_once/2function to support once props, which are cached on the client-side and reused across page navigations. Supportsfresh,until, andasoptions for controlling refresh behavior, expiration, and custom keys (#62). - Create an
assets/js/pagesdirectory in the Igniter install task and fix the documentation (#57).
Fixed
- Properly camelize keys in
deferredPropsmetadata whencamelize_propsis enabled.
Full Changelog: v2.5.1...v2.6.0
Version 2.5.1
Fixed
- Treat Igniter as an optional dependency in the
mix inertia.installtask definition. Previously, compilation would fail if Igniter was not installed.
Full Changelog: v2.5.0...v2.5.1
Version 2.5.0
Version 2.4.0
Added
- Add
inertia_errors/1test helper to fetch Inertia errors (#43).
Version 2.3.0
Added
- Add a
force_inertia_redirectplug function to instruct the client-side to always perform a full browser redirect when a redirect response is sent (#35).
Changed
- Define an
Inertia.Errorsprotocol with default implementations forEcto.ChangesetandMap.
Version 2.2.0
Added
- Add
preserve_casehelper to prevent auto-camelization of specified prop keys. - Add
Inertia.Controller.inertia_response?/1helper to determine if a response is Inertia-rendered.
Fixed
- Ensure prop keys are compared in the proper casing (for partial reloads) when
camelize_propsis enabled. - Fix prop resolution for deferred/optional props.
Version 2.1.0
Fixed
- Include new Inertia v2 attributes in the initial page object (
mergeProps,deferredProps,encryptHistory,clearHistory). - Mark internal component functions in
Inertia.HTMLas private.
Version 2.0.0
Added
- Add support new Inertia.js v2.0.0.
- Add
encrypt_historyfunction to instruct the client-side to encrypt the history entry. - Add
clear_historyfunction to instruct the client-side to clear history. - Add
inertia_optionalfunction, to replace the now-deprecatedinertia_lazyfunction. - Add
inertia_mergefunction to instruct the client-side to merge the prop value with existing data. - Add
inertia_deferfunction to instruct the client-side to fetch the prop value immediately after initial page load.
- Add
- Add helpers for testing Inertia-based controller responses via the
Inertia.Testingmodule. - Add a
camelize_propsglobal config option and acamelize_propsfunction (to use on a per-request basis) to automatically convert prop keys from snake case to camel case. - Accept an
ssroption on therender_inertiafunction.
Changed
- Update Phoenix LiveView to v1.0.
- The errors serializer (for
Ecto.Changesetstructs) 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 for errors serializer
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 for errors serializer
Now, the serializer simply takes the first error message and returns it under the field name, without any added suffix:
{
"name": "is too long"
}Fixed
- Allow for external redirects from
PUT/PATCH/DELETErequests (#22) - Camelize prop names inside lists (e.g.
assign_prop(:items, [%{item_name: "..."}])).
Deprecated
- The
inertia_lazy/1function has been deprecated in favor ofinertia_optional/1
Version 1.0.0-beta.2
Features
- Accept a
ssroption on therender_inertiafunction.
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/DELETErequests (#22)
Features
Support new Inertia v2 mechanics π. There are no breaking changes required to support v2, only new features:
- Add
encrypt_historyfunction to instruct the client-side to encrypt the history entry. - Add
clear_historyfunction to instruct the client-side to clear history. - Add
inertia_optionalfunction, to replace the now-deprecatedinertia_lazyfunction. - Add
inertia_mergefunction to instruct the client-side to merge the prop value with existing data. - Add
inertia_deferfunction 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.Testingmodule. - Added a
camelize_propsglobal config option and acamelize_propsfunction (to use on a per-request basis) to automatically convert prop keys from snake case to camel case.
Deprecations
- The
inertia_lazy/1function has been deprecated in favor ofinertia_optional/1