# Changelog ## 0.20.17 (2024-06-21) ### Bug fixes * Fix formatter adding newlines in script tags ## 0.20.16 (2024-06-20) ### Bug fixes * Fix bug introduced in 0.20.15 causing incorrect patching on form elements when awaiting acknowledgements ## 0.20.15 (2024-06-18) ### Enhancements * Warn when rendering an input named "id" * Warn on mismatched client and server versions * Allow form recovery to work on forms in nested LiveViews * Allow using form/3 with inputs outside the form * Allow setting page title to an empty string * Fix warnings on Elixir 1.17 ### Bug fixes * Fix attributes of existing stream items not being updated on reset * Fix nested LiveView within streams becoming empty when reset * Fix `phx-mounted` firing twice, first on dead render, then on live render, leading to errors when a LiveComponent has not yet mounted * Fix `JS.toggle_class` error when used with a transition * Fix phx-debounce=blur incorrectly sending change event to the next page in some cirumstances * Fix race condition when destroying Live Components while transitions are still running * Fix page reload when disconnecting LiveSocket if using Bandit * Fix formatter changing `<%` to `<%=` when it shouldn't * Fix updated form values not being sent in some circumstances when phx-trigger-action is used * Fix phx-viewport bindings when html or body element has overflow property ### Deprecations * Deprecate `live_flash` in favor of `Phoenix.Flash.get` * Deprecate `push_redirect` in favor of `push_navigate` ### Removal of previously deprecated functionality * `phx-capture-click` has been removed (deprecated in 0.17.0) * `live_component/2` and `live_component/3` helpers (not the function component) have been removed ## 0.20.14 (2024-03-13) ### Bug fixes * Fix warning caused by optional Floki dependency ## 0.20.13 (2024-03-12) ### Bug fixes * Fix LiveComponent rendering bug causing elements to disappear when a LiveComponent child is removed and added back by the server ### Enhancements * Warn when accessing the socket in a function passed to assign_async / start_async ## 0.20.12 (2024-03-04) ### Enhancements * Phoenix LiveView requires Elixir v1.13+ ### Bug fixes * Do not send Telemetry metadata as Logger event, this avoids the metadata from being accidentally copied to other processes * Ensure LiveViewTest does not crash on IDs with foreign characters, such as question marks * Fix a bug where LiveViewTest could not perform a connected mount on a page with certain streams ## 0.20.11 (2024-02-29) ### Bug fixes * Fix auto uploads with invalid entries incorrectly proceeding with a form submit instead of halting, causing entries in progress errors * Fix auto upload entries failing to be uploaded on submit after moving into a valid state, such as falling within `max_entries` * Fix TagEngine clause warning ## 0.20.10 (2024-02-28) ### Bug fixes * Fix cancelled uploads being re-added * Fix form submits for previously submitted invalid upload entries causing errors instead of preflighted new upload entries * Fix HTML formatter not respecting phx-no-format for script tags ### Enhancements * Add additional HEEx debug annotations for the caller locations of function component invocations * Abandon form recovery if recovery event fails ## 0.20.9 (2024-02-19) ### Bug fixes * Fix error in LiveViewTest when a `phx-update="ignore"` container is added dynamically to the DOM ## 0.20.8 (2024-02-19) ### Bug fixes * Fix live uploader issue when a form contained more than one `<.live_file_input>` * Fix phx-remove on re-added stream items trigging the remove when it should not * Fix js error attempting to re-order an element that does not exist in the DOM ### Enhancements * Align LiveViewTest with JavaScript DOM patching behavior for phx-update="ignore" when updating attributes in LiveViewTest ## 0.20.7 (2024-02-15) ### Bug fixes * Fix phx-skip containers leaking into DOM on first patch in some cases (#3117) * Fix phx-feedback-for failing to be properly updated in some cases (#3122) ## 0.20.6 (2024-02-14) ### Bug fixes * Fix stream items being excluded in LiveViewTest * Fix stream items failing to properly update nested streams or LiveComponents * Fix debounce/blur regression causing unexpeted events to be sent ## 0.20.5 (2024-02-08) ### Deprecations * Deprecate `phx-feedback-group` introduced in the previous release, the goal is to move feedback handling into Elixir and out of the DOM ### Bug fixes * Fix blur event on phx-debounce being dispatched incorrectly * Fix `open_browser` not working on WSL for project under UNIX file systems * Match browser stream insert ordering behavior in `LiveViewTest` * Fix `phx-click-away` not working when element is partially hidden * Fix `phx-feedback-for` classes not being applied in some cases * Fix form submitter failing to be sent as key/value pair in some cases * Fix null form reference causing errors on some DOM patches ## 0.20.4 (2024-02-01) ### Bug fixes * Fix phx-remove on sticky LiveViews * Fix phx-disabled-with not restoring button disabled state on empty diff acknowledgement * Fix stream reset not ordering items correctly * Send `{:shutdown, :cancel}` to `handle_async/3` on `cancel_async` * Prevent events from child LiveViews from bubbling up to root LiveView when child is not mounted yet * Fix `phx-mounted` being called twice for stream items * Never move existing stream items if they already exist (use stream_delete and then stream_insert instead) * Fix live component rendering breaking when the server adds a component back that was pruned by the client (#3026) * Allow redirect from upload progress callback * Fix nested components getting skipped when resetting a stream * Fix nested components getting skipped in LiveComponents * Fix stream limits not being applied correctly when bulk inserting * Fix click-away being called incorrectly on form submits * Fix inconsistencies between LiveViewTest and browser stream implementations * Fix phx-feedback-for being reapplied when there are multiple inputs with the same name * Ensure phx-update="ignore" behaves consistently: updates from the server to the element's content and attributes are ignored, *except for data attributes* ### Enhancements * Add `JS.toggle_class` * Add `JS.toggle_attribute` * Force update select options when the options changed from the server while a select has focus * Introduce `phx-feedback-group` for handling feedback for composite input groups * Add `validate_attrs` to slots * Support `phx-viewport` bindings in scrollable containers * Perform client redirect when trying to live nav from dead client to avoid extra round trip * Allow regular buttons with name/value attributes to send form events and adjusted dynamic form documentation to reflect this * Allow form attribute on `live_file_input` ### Removal of previously deprecated functionality * `live_component/2` and `live_component/3` helpers (not the function component) have been removed ## 0.20.3 (2024-01-02) ### Bug fixes * Fix phx-viewport bindings failing to fire after navigation * Preserve order of appended items in stream in `LiveViewTest` * Fix order of items on client when resetting a stream to existing set of items ### Enhancements * Support `JS.push` from dead views ## 0.20.2 (2023-12-18) ### Bug fixes * Fix JavaScript error when submitting a form that has in progress uploads * Fix JS command `:target` failing to work when used as phx-submit or phx-change with a selector-based target * Fix `JS.focus()` failing to focus negative tabindex * Fix `LiveViewTest` failing to remove items after stream reset * Fix `phx-window-blur` and `phx-window-focus` events not firing * Fix SVG anchor links throwing errors when clicked ### Enhancements * Speed up DOM patching performance 3-30x 🔥 * Support `handle_async` lifecycle callback * Extend visibility checks for phx-click-away to better handle whether an element is visible in the viewport or not * Allow `JS.patch` and `JS.navigate` to be tested with `render_click` * Support `:supervisor` option to `assign_async` and `start_async` ### Deprecations * Deprecate `phx-update="append"` and `phx-update="prepend"` in favor of `phx-update="stream"` ## 0.20.1 (2023-10-09) ### Bug fixes * Fix error with live uploads `auto_upload: true` when a file fails to preflight * Fix error with live uploads where an early exit can cause a map key error * Fix match error on live navigation when reconnecting from client ### Enhancements * Support new `meta()` method on File/Blob sublcasses on JavaScript client to allow the client to pass arbitrary metadata when using `upload/uploadTo` from hook. The `%UploadEntry{}`'s new `client_meta` field is populated from this information. * Improve void tagging and error messages ## 0.20.0 (2023-09-22) ### Deprecations * Deprecate the `~L` sigil in favor of `~H` * Deprecate `preload/1` in LiveComponent in favor of `update_many/1` * Deprecate `live_component/2-3` in favor of `<.live_component />` * Deprecate `live_patch` in favor of `<.link patch={...} />` * Deprecate `live_redirect` in favor of `<.link navigate={...} />` * Deprecate `live_title_tag` in favor of `<.live_title />` ### Backwards incompatible changes * Remove previously deprecated `render_block/2` in favor of `render_slot/2` * Remove previously deprecated `live_img_preview/2` in favor of `<.live_img_preview />` * Remove previously deprecated `live_file_input/2` in favor of `<.live_file_input />` ### Bug fixes * Fix uploads with `auto_upload: true` failing to propagate errors when any individual entry is invalid * Fix uploads with `auto_upload: true` failing to auto upload valid entries errors when any individual entry is invalid * Fix error on form recovery with `auto_upload: true` * Fix issue on form recovery where hidden inputs would be selected by mistake * Fix form recovery when phx-change is a JS command * Fix stream reset on nested live components with nested streams * Fix window location resetting to null when using nested LiveView on connection error * Fix anchors within contenteditable causing LiveSocket disconnects ### Enhancements * Add heex debug annotations via `config :phoenix_live_view, debug_heex_annotations: true`, which provides special HTML comments that wrap around rendered components to help you identify where markup in your HTML document is rendered within your function component tree * Add `assign_async`, `start_async`, `<.async_result>` and, `AsyncResult` for declaratively handling async operations in a LiveView or LiveComponent. * Supporting passing `@myself` for `Phoenix.LiveView.send_update/3` * Support change tracking on Access.get * Allow overriding `id` of `<.live_img_preview>` ## 0.19.5 (2023-07-19) ### Backwards incompatible changes * The `close/1` callback of `Phoenix.LiveView.UploadWriter` is now `close/2` with the close reason passed as the second argument. * The `write_chunk` callback of `Phoenix.LiveView.UploadWriter` must now return the updated writer state when an error occurs. Instead of `{:error, reason}`, return `{:error, reason, new_state}`. ### Enhancements * Pass close reason to `Phoenix.LiveView.UploadWriter` close. * Dispatch `phx:navigate` window events when LiveView changes the history state ### Bug fixes * Call `Phoenix.LiveView.UploadWriter` close callback when LiveView goes down or connection is lost * Fix JS.patch to a Phoenix router scope with `:host` causing errors * Fix immediate navigation after patch not updating URL * Fix stream reset on nested streams inside live components causing nested stream children to be removed ## 0.19.4 (2023-07-10) ### Enhancements * Introduce `Phoenix.LiveView.UploadWriter` ## 0.19.3 (2023-06-21) ### Bug fixes * Fix `push_event` inside component update not being sent in some cases * Bring back accidentally deprecated `upload_errors/1` ## 0.19.2 (2023-06-12) ### Bug fixes * Fix issue when `` is used ## 0.19.1 (2023-06-06) ### Enhancements * Allow `accept` attribute on `<.live_file_input>` to override default values ### Bug fixes * Fix issue causing anchor clicks to disconnect LV when they were already handled via `preventDefault()` by other scripts ## 0.19.0 (2023-05-29) ### Backwards incompatible changes * Drop support for passing an id to the `phx-feedback-for` attribute. An input name must be passed instead. * Remove previously deprecated `let` attribute. Use `:let` instead * Remove previously deprecated `<%= live_img_preview(entry) %>`. Use `<.live_img_preview entry={entry} />` instead * Remove previously deprecated `<%= live_file_input(upload) %>`. Use `<.live_file_input upload={upload} />` instead * Remove previously deprecated `<%= live_component(Component) %>`. Use `<.live_component module={Component} id=\"hello\" />` instead * Don't convert underscores to dashes automatically when rendering HTML attributes. Use dashes or underscores where appropriate instead. ### Enhancements * Support stream resets with bulk insert operations * Support ordered inputs within `inputs_for`, to pair with Ecto's new `sort_param` and `drop_param` casting * Send form phx-value's on form events ### Deprecations * Deprecate passing `:dom_id` to `stream/4` in favor of `stream_configure/3` * Deprecate `render_block/2` in favor of `render_slot/2` * Deprecate `<%= live_img_preview(entry, opts) %>`. Use `<.live_img_preview entry={entry} {opts} />` * Deprecate `<%= live_file_input(upload, opts) %>`. Use `<.live_file_input upload={upload} {opts} />` * Deprecate stateless LiveComponent in favor of function components or in favor of `<.live_component id={...} />` (note the `id` is required) ### Bug fixes * Fix LiveView disconnects when clicking a `download` link * Fix stream deletes not being sent on nested for comprehensions * Fix `phx-disconnected` bindings not firing on mount failures * Support form recovery on forms with only hidden inputs ## 0.18.18 (2023-03-16) ### Bug fixes * Allow `:live_action` to be assigned in a component * Only filter internal function component attributes in `assigns_to_attributes` * Only include submitter with name ### Enhancements * Add `JS.exec` command for executing commands defined on other element attributes ## 0.18.17 (2023-03-09) ### Bug Fixes * Fix callbacks like `handle_info` failing to be invoked in development after a code change with the Phoenix code reloader ### Enhancements * Support [`submitter`](https://developer.mozilla.org/en-US/docs/Web/API/SubmitEvent/submitter) on form submit events. * Avoid compile-time dependency for `attr` when referencing structs * Validate reserved assigns. Attempting to assign `:uploads`, `:streams`, `:live_action`, `:socket`, `:myself` will now raise in LiveView and LiveComponent ## 0.18.16 (2023-02-23) ### Enhancements * Support streams in Live Components * Optimize plug error translation when a Plug.Exception is raised over connected LiveView ### Bug Fixes * Fix formatter issues when there are multiple HTML comments ## 0.18.15 (2023-02-16) ### Bug Fixes * Fix `JS.transition` applying incorrect classes ### Enhancements * Reset phx-feedback-for errors on `type="reset"` inputs and buttons ## 0.18.14 (2023-02-14) ### Bug Fixes * Fix LiveViewTest failing to find main live view ## 0.18.13 (2023-02-10) ### Enhancements * Improve error message when failing to use Phoenix.Component ## 0.18.12 (2023-02-10) ### Enhancements * Introduce streams for efficiently handling large collections * Allow replies from `:handle_event` lifecycle hooks * Add `<.inputs_for>` component to `Phoenix.Component` * Support replies on lifecycle `:handle_event` hooks ### Bug Fixes * Fix change tracking when re-assigning a defaulted attribute to same default value * Fix upload drag and drop failing to worka after using file select dialog * Fix form recovery when form's first input is phx-change ## 0.18.11 (2023-01-19) ### Bug Fixes * Fix socket unloading connection for forms that have defaulted prevented ## 0.18.10 (2023-01-18) ### Bug Fixes * Fix svg tags with href incorrectly unloading socket on click * Fix form submits with `target="_blank"` incorrectly unloading socket on submit ## 0.18.9 (2023-01-17) ### Bug Fixes * Fix regular form submits failing to be dispatched ## 0.18.8 (2023-01-16) ### Enhancements * Restore scroll position on back when previous navigation was live patch ### Bug Fixes * Fix live layout not being applied until connected render ## 0.18.7 (2023-01-13) ### Bug Fixes * Fix live layout not being applied when passed to `:live_session` during disconnect render * Fix external anchor clicks and links with hashes incorrectly unloading socket ## 0.18.6 (2023-01-09) ### Bug Fixes * Fix external anchor click unloading on external click ## 0.18.5 (2023-01-09) ### Bug Fixes * Fix external anchor click unloading socket ## 0.18.4 (2023-01-05) ### Enhancements * Support string upload name to support dynamically generated `allow_upload`'s ### Bug Fixes * Fix nested LiveView race condition on live patch causing nested child to skip updates in some cases * Fix browser history showing incorrect title when using live navigation with `@page_title` * Fix undefined _target param when using `JS.push` for form changes * Fix `phx-no-feedback` missing from inputs added after a form submit * Fix `phx-disconnected` events firing when navigating away or submitting external forms ## 0.18.3 (2022-10-26) ### Enhancements * Add `embed_templates` to `Phoenix.Component` for embedding template files as function components * Raise on global slot attributes ### Bug Fixes * Fix bug on slots when passing multiple slot entries with mix if/for syntax ## 0.18.2 (2022-10-04) ### Bug Fixes * Fix match error when defining `:values` before `:default` * Allow tuples in external redirects * Fix race condition on dispatching click away when enter is pressed * Fix formatter breaking inline blocks when surrounded by text without whitespace ### Enhancements * Add `intersperse` component for rendering a separator between an enumerable ## 0.18.1 (2022-09-28) ### Bug Fixes * Fix phx-loading class being applied to dead views * Fix `<.live_img_preview />` causing invalid attribute errors on uploads * Do not fire phx events when element is disabled ### Enhancements * Support `:include` option to extend global attributes on a case-by-case basis * Warn when accessing a variable binding defined outside of `~H` ## 0.18.0 (2022-09-20) LiveView v0.18 includes a major new feature in the form of declarative assigns with new `attr` and `slot` APIs for specifying which attributes a function component supports, the type, and default values. Attributes and slots are compile-time verified and emit warnings (requires Elixir v1.14.0+). v0.18 includes a number of new function components which replace their EEx expression counterparts `<%= ... %>`. For example, `live_redirect`, `live_patch`, and Phoenix.HTML's `link` have been replaced by a unified `Phoenix.Component.link/1` function component: <.link href="https://myapp.com">my app <.link navigate={@path}>remount <.link patch={@path}>patch Those new components live in the `Phoenix.Component` module. `Phoenix.LiveView.Helpers` itself has been soft deprecated and all relevant functionality has been migrated. You must `import Phoenix.Component` where you previously imported `Phoenix.LiveView.Helpers` when upgrading. You may also need to `import Phoenix.Component` where you also imported `Phoenix.LiveView` and some of its functions have been moved to `Phoenix.Component`. Additionally, the special `let` attribute on function components have been deprecated by a `:let` usage. ### Deprecations - `live_redirect` - deprecate in favor of new `<.link navigate={..}>` component of `Phoenix.Component` - `live_patch` - deprecate in favor of new `<.link patch={..}>` component of `Phoenix.Component` - `push_redirect` - deprecate in favor of new `push_navigate` function on `Phoenix.LiveView` ### Enhancements - [Component] Add declarative assigns with compile-time verifications and warnings via `attr`/`slot` - [Component] Add new attrs `:let` and `:for`, and `:if` with HTML tag, function component, and slot support. We still support `let` but the formatter will convert it to `:let` and soon it will be deprecated. - [Component] Add `dynamic_tag` function component - [Component] Add `link` function component - [Component] Add `focus_wrap` function component to wrap focus around content like modals and dialogs for accessibility - [Logger] Add new LiveView logger with telemetry instrumentation for lifecycle events - [JS] Add new JS commands for `focus`, `focus_first`, `push_focus`, and `pop_focus` for accessibility - [Socket] Support sharing `Phoenix.LiveView.Socket` with regular channels via `use Phoenix.LiveView.Socket` - Add `_live_referer` connect param for handling `push_navigate` referal URL - Add new `phx-connected` and `phx-disconnected` bindings for reacting to lifecycle changes - Add dead view support for JS commands - Add dead view support for hooks ### Bug fixes - Fix external upload issue where listeners are not cleaned up when an external failure happens on the client - Do not debounce `phx-blur` ## 0.17.12 (2022-09-20) ### Enhancements - Add support for upcoming Phoenix 1.7 flash interface ## 0.17.11 (2022-07-11) ### Enhancements - Add `replaceTransport` to LiveSocket ### Bug fixes - Cancel debounced events from firing after a live navigation event - Fix hash anchor failing to scroll to anchor element on live navigation - Do not debounce `phx-blur` events ## 0.17.10 (2022-05-25) ### Bug fixes - [Formatter] Preserve single quote delimiter on attrs - [Formatter] Do not format inline elements surrounded by texts without whitespaces - [Formatter] Keep text and eex along when there isn't a whitespace - [Formatter] Fix intentional line breaks after eex expressions - [Formatter] Handle self close tags as inline - [Formatter] Do not format inline elements without whitespaces among them - [Formatter] Do not format when attr contenteditable is present ### Enhancements - [Formatter] Introduce special attr phx-no-format to skip formatting ## 0.17.9 (2022-04-07) ### Bug fixes - Fix sticky LiveViews failing to be patched during live navigation - Do not raise on dynamic `phx-update` value ## 0.17.8 (2022-04-06) ### Enhancements - Add HEEx formatter - Support `phx-change` on individual inputs - Dispatch `MouseEvent` on client - Add `:bubbles` option to `JS.dispatch` to control event bubbling - Expose underlying `liveSocket` instance on hooks - Enable client debug by default on localhost ### Bug fixes - Fix hook and sticky LiveView issues caused by back-to-back live redirects from mount - Fix hook destroyed callback failing to be invoked for children of phx-remove in some cases - Do not failsafe reload the page on push timeout if disconnected - Do not bubble navigation click events to regular phx-click's - No longer generate `csrf_token` for forms without action, reducing the payload during phx-change/phx-submit events ## 0.17.7 (2022-02-07) ### Enhancements - Optimize nested for comprehension diffs ### Bug fixes - Fix error when `live_redirect` links are clicked when not connected in certain cases ## 0.17.6 (2022-01-18) ### Enhancements - Add `JS.set_attribute` and `JS.remove_attribute` - Add `sticky: true` option to `live_render` to maintain a nested child on across live redirects - Dispatch `phx:show-start`, `phx:show-end`, `phx:hide-start` and `phx:hide-end` on `JS.show|hide|toggle` - Add `get_connect_info/2` that also works on disconnected render - Add `LiveSocket` constructor options for configuration failsafe behavior via new `maxReloads`, `reloadJitterMin`, `reloadJitterMax`, `failsafeJitter` options ### Bug fixes - Show form errors after submit even when no changes occur on server - Fix `phx-disable-with` failing to disable elements outside of forms - Fix phx ref tracking leaving elements in awaiting state when targeting an external LiveView - Fix diff on response failing to await for active transitions in certain cases - Fix `phx-click-away` not respecting `phx-target` - Fix "disconnect" broadcast failing to failsafe refresh the page - Fix `JS.push` with `:target` failing to send to correct component in certain cases ### Deprecations - Deprecate `Phoenix.LiveView.get_connect_info/1` in favor of `get_connect_info/2` - Deprecate `Phoenix.LiveViewTest.put_connect_info/2` in favor of calling the relevant functions in `Plug.Conn` - Deprecate returning "raw" values from upload callbacks on `Phoenix.LiveView.consume_uploaded_entry/3` and `Phoenix.LiveView.consume_uploaded_entries/3`. The callback must return either `{:ok, value}` or `{:postpone, value}`. Returning any other value will emit a warning. ## 0.17.5 (2021-11-02) ### Bug fixes - Do not trigger `phx-click-away` if element is not visible - Fix `phx-remove` failing to tear down nested live children ## 0.17.4 (2021-11-01) ### Bug fixes - Fix variable scoping issues causing various content block or duplication rendering bugs ## 0.17.3 (2021-10-28) ### Enhancements - Support 3-tuple for JS class transitions to support staged animations where a transition class is applied with a starting and ending class - Allow JS commands to be executed on DOM nodes outside of the LiveView container ### Optimization - Avoid duplicate statics inside comprehension. In previous versions, comprehensions were able to avoid duplication only in the content of their root. Now we recursively traverse all comprehension nodes and send the static only once for the whole comprehension. This should massively reduce the cost of sending comprehensions over the wire ### Bug fixes - Fix HTML engine bug causing expressions to be duplicated or not rendered correctly - Fix HTML engine bug causing slots to not be re-rendered when they should have - Fix form recovery being sent to wrong target ## 0.17.2 (2021-10-22) ### Bug fixes - Fix HTML engine bug causing attribute expressions to be incorrectly evaluated in certain cases - Fix show/hide/toggle custom display not being restored - Fix default `to` target for `JS.show|hide|dispatch` - Fix form input targeting ## 0.17.1 (2021-10-21) ### Bug fixes - Fix SVG element support for `phx` binding interactions ## 0.17.0 (2021-10-21) ### Breaking Changes #### `on_mount` changes The hook API introduced in LiveView 0.16 has been improved based on feedback. LiveView 0.17 removes the custom module-function callbacks for the `Phoenix.LiveView.on_mount/1` macro and the `:on_mount` option for `Phoenix.LiveView.Router.live_session/3` in favor of supporting a custom argument. For clarity, the module function to be invoked during the mount lifecycle stage will always be named `on_mount/4`. For example, if you had invoked `on_mount/1` like so: ```elixir on_mount MyAppWeb.MyHook on_mount {MyAppWeb.MyHook, :assign_current_user} ``` and defined your callbacks as: ```elixir # my_hook.ex def mount(_params, _session, _socket) do end def assign_current_user(_params, _session, _socket) do end ``` Change the callback to: ```elixir # my_hook.ex def on_mount(:default, _params, _session, _socket) do end def on_mount(:assign_current_user, _params, _session, _socket) do end ``` When given only a module name, the first argument to `on_mount/4` will be the atom `:default`. #### LEEx templates in stateful LiveComponents Stateful LiveComponents (where an `:id` is given) must now return HEEx templates (`~H` sigil or `.heex` extension). LEEx templates (`~L` sigil or `.leex` extension) are no longer supported. This addresses bugs and allows stateful components to be rendered more efficiently client-side. #### `phx-disconnected` class has been replaced with `phx-loading` Due to a bug in the newly released Safari 15, the previously used `.phx-disconnected` class has been replaced by a new `.phx-loading` class. The reason for the change is `phx.new` included a `.phx-disconnected` rule in the generated `app.css` which triggers the Safari bug. Renaming the class avoids applying the erroneous rule for existing applications. Folks can upgrade by simply renaming their `.phx-disconnected` rules to `.phx-loading`. #### `phx-capture-click` has been deprecated in favor of `phx-click-away` The new `phx-click-away` binding replaces `phx-capture-click` and is much more versatile because it can detect "click focus" being lost on containers. #### Removal of previously deprecated functionality Some functionality that was previously deprecated has been removed: - Implicit assigns in `live_component` do-blocks is no longer supported - Passing a `@socket` to `live_component` will now raise if possible ### Enhancements - Allow slots in function components: they are marked as `<:slot_name>` and can be rendered with `<%= render_slot @slot_name %>` - Add `JS` command for executing JavaScript utility operations on the client with an extended push API - Optimize string attributes: - If the attribute is a string interpolation, such as `