Skip to content

Releases: inertiajs/inertia-phoenix

Version 2.6.0

16 Jan 00:02

Choose a tag to compare

Added

  • Add inertia_scroll/2 function to support infinite scroll pagination. Automatically configures merge behavior and extracts pagination metadata for the client-side InfiniteScroll component. Includes Inertia.ScrollMetadata protocol for extensible pagination library support (#63).
  • Add inertia_once/2 function to support once props, which are cached on the client-side and reused across page navigations. Supports fresh, until, and as options for controlling refresh behavior, expiration, and custom keys (#62).
  • Create an assets/js/pages directory in the Igniter install task and fix the documentation (#57).

Fixed

  • Properly camelize keys in deferredProps metadata when camelize_props is enabled.

Full Changelog: v2.5.1...v2.6.0

Version 2.5.1

29 Jun 12:38

Choose a tag to compare

Fixed

  • Treat Igniter as an optional dependency in the mix inertia.install task definition. Previously, compilation would fail if Igniter was not installed.

Full Changelog: v2.5.0...v2.5.1

Version 2.5.0

26 Jun 16:41

Choose a tag to compare

What's Changed

  • feat: Add inertia_deep_merge method for handling complex data merges in responses by @bjufre in #54
  • Add Inertia.install mix task for Phoenix integration by @mbuhot in #51

New Contributors

Full Changelog: v2.4.0...v2.5.0

Version 2.4.0

25 Apr 13:13

Choose a tag to compare

Added

  • Add inertia_errors/1 test helper to fetch Inertia errors (#43).

Version 2.3.0

28 Feb 14:34

Choose a tag to compare

Added

  • Add a force_inertia_redirect plug function to instruct the client-side to always perform a full browser redirect when a redirect response is sent (#35).

Changed

  • Define an Inertia.Errors protocol with default implementations for Ecto.Changeset and Map.

Version 2.2.0

01 Feb 14:38

Choose a tag to compare

Added

  • Add preserve_case helper to prevent auto-camelization of specified prop keys.
  • Add Inertia.Controller.inertia_response?/1 helper to determine if a response is Inertia-rendered.

Fixed

  • Ensure prop keys are compared in the proper casing (for partial reloads) when camelize_props is enabled.
  • Fix prop resolution for deferred/optional props.

Version 2.1.0

07 Jan 21:23

Choose a tag to compare

Fixed

  • Include new Inertia v2 attributes in the initial page object (mergeProps, deferredProps, encryptHistory, clearHistory).
  • Mark internal component functions in Inertia.HTML as private.

Version 2.0.0

21 Dec 18:16

Choose a tag to compare

Added

  • Add support new Inertia.js v2.0.0.
    • 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-deprecated inertia_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.
  • Add helpers for testing Inertia-based controller responses via the Inertia.Testing module.
  • Add a camelize_props global config option and a camelize_props function (to use on a per-request basis) to automatically convert prop keys from snake case to camel case.
  • Accept an ssr option on the render_inertia function.

Changed

  • Update Phoenix LiveView to v1.0.
  • 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 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 / DELETE requests (#22)
  • Camelize prop names inside lists (e.g. assign_prop(:items, [%{item_name: "..."}])).

Deprecated

  • The inertia_lazy/1 function has been deprecated in favor of inertia_optional/1

Version 1.0.0-beta.2

13 Nov 18:37

Choose a tag to compare

Version 1.0.0-beta.2 Pre-release
Pre-release

Features

  • Accept a ssr option on the render_inertia function.

Version 1.0.0-beta.1

15 Oct 13:55

Choose a tag to compare

Version 1.0.0-beta.1 Pre-release
Pre-release

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-deprecated inertia_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 a camelize_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 of inertia_optional/1