# Changelog ## Backwards incompatible changes for 1.0 LiveView 1.0 removes the client-based `phx-feedback-for` annotation for showing and hiding input feedback, such as validation errors. This has been replaced by `Phoenix.Component.used_input?/2`, which handles showing and hiding feedback using standard server rendering. A backwards-compatible shim can be used to maintain `phx-feedback-for` in your existing applications: 1. Save the [`phx_feedback_dom.js` shim](https://gist.github.com/chrismccord/c4c60328c6ac5ec29e167bb115315d82) to your local `assets/js/phx_feedback_dom.js`. 2. Import it into your `assets/js/app.js`. 3. Add a new `dom` option to your `LiveSocket` constructor, or wrap the existing value: ```javascript import {Socket} from "phoenix"; import {LiveSocket} from "phoenix_live_view" import phxFeedbackDom from "./phx_feedback_dom" let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content"); let liveSocket = new LiveSocket("/live", Socket, { params: {_csrf_token: csrfToken}, dom: phxFeedbackDom({}) }) ``` Additionally, the `phx-page-loading` attribute has been removed in favor of using the `page_loading: true` option to `Phoenix.LiveView.JS.push/2` as needed. ### Migrating from phx-feedback-for While we provide [a shim for existing applications](https://gist.github.com/chrismccord/c4c60328c6ac5ec29e167bb115315d82) relying on phx-feedback-for, you might want to migrate to the new approach. The following guides you through the necessary changes assuming a project generated with a recent (Phoenix 1.7), but pre LiveView 1.0 version of the phx generators. For more general use cases, please also have a look at the documentation for [`used_input?/1`](https://hexdocs.pm/phoenix_live_view/1.0.0/Phoenix.Component.html#used_input?/1). First, ensure that you are using the latest versions of `:phoenix_ecto` and `:phoenix_html`. At the time of writing: ```elixir {:phoenix_ecto, "~> 4.5"}, {:phoenix_html, "~> 4.1"}, ``` #### Core components 1. Adjust the core components to omit the `phx-feedback-for` attribute and the `phx-no-feedback` classes. This shows one example for the textarea input, but there are more cases that need to be adjusted accordingly: ```diff def input(%{type: "textarea"} = assigns) do ~H""" -
+
<.label for={@id}><%= @label %>