phoenix_live_view changelog


Here's the latest scoop on what's been happening under the hood. 🚀 We've rolled out some exciting new features, squashed pesky bugs, and made a few tweaks to keep everything running smoothly. Let's dive in!

  • New feature: Added a shiny new metadata field to the LiveSocket JavaScript interop guide! 🎉 This field allows you to send extra user-defined info along with events to the server. Check out the "Key events" section for some cool examples. This update also includes some tidying up of the docs for hooks and uploaders. Say hello to enhanced functionality and usability! 💪

  • Improvement: We’ve clarified how class and style attributes work in ~H syntax. Now, if their value is false or nil, they’ll be rendered as empty strings instead of disappearing into the void. 🪄 Plus, when class is a list, nil and false entries are tossed out like yesterday’s leftovers. 🗑️ Enjoy a clearer understanding and a smoother dev experience!

  • Bugfix: Tackled a sticky situation with live views in version 1.0.1. Sticky live views no longer receive a URL upon joining, as they're not mounted at the router. 🛠️ This fix includes some updates to integration tests and tweaks to several files, ensuring everything runs like a well-oiled machine. Kudos to Steffen Deusch for co-authoring this fix!

  • Improvement: Released version 1.0.2 with updates to package.json, package-lock.json, and various static files. These changes hint at some nifty enhancements or bug fixes to keep the Live View functionality top-notch. 📦

  • Improvement: Updated a bunch of static assets related to Phoenix Live View, including JavaScript files and their source maps. These updates aim to boost performance and compatibility, ensuring you’re working with the latest and greatest. 🚀

  • Chore: Bumped ex_doc from 0.35.1 to 0.36.1 and earmark_parser from 1.4.41 to 1.4.42. 📚 These updates are all about keeping things fresh and shiny, with a focus on documentation tools and libraries. Better docs, better dev life! 🌟

That's all for now, folks! Stay tuned for more updates and keep on coding. 💻✨

Included Commits

2025-01-04T16:53:52 See commit

This commit clarifies the behavior of the class and style attributes in the Phoenix framework's ~H syntax, addressing issue #3602. It specifies that when using these attributes, if their value is false or nil, they will be rendered as empty strings rather than omitted entirely. This distinction allows for rendering optimizations while maintaining the same visual effect in HTML output.

Additionally, the commit reinforces the processing of the class attribute when provided as a list, noting that individual elements are treated as separate classes, with nil and false entries being discarded. Overall, the changes aim to enhance the understanding of how these attributes function within the framework, thereby improving the developer experience.

Files changed

  • lib/phoenix_component.ex
2025-01-04T19:53:55 See commit

This commit updates the JavaScript interop guide by adding a mention of the new metadata field for LiveSocket. The metadata field allows users to send additional user-defined information along with events to the server, enhancing the functionality of event handling in LiveView applications. This new feature is detailed in the "Key events" section of the bindings guide, providing users with practical examples of its implementation.

In addition to the new metadata entry, the commit also includes minor formatting adjustments and clarifications to existing sections, such as the descriptions for hooks and uploaders. The overall goal of these changes is to improve the documentation and usability of LiveSocket's JavaScript interop capabilities, thereby facilitating better integration and interaction between client and server components within LiveView applications. The commit effectively closes issue #3609.

Files changed

  • guides/client/js-interop.md
2025-01-09T16:41:18 See commit

The commit marks the release of version 1.0.2 and includes modifications across several key files in the project. Notably, the package.json and package-lock.json files have been updated, likely to reflect changes in dependencies or versioning. Additionally, the CHANGELOG.md has been modified to document this release and its changes.

Further updates have been made to various static files related to Phoenix Live View, including different JavaScript formats such as CommonJS, ESM, and minified versions. These changes suggest enhancements or bug fixes to the Live View functionality, ensuring that users have access to the latest improvements in the framework.

Files changed

  • CHANGELOG.md
  • assets/package-lock.json
  • assets/package.json
  • mix.exs
  • package.json
  • priv/static/phoenix_live_view.cjs.js
  • priv/static/phoenix_live_view.esm.js
  • priv/static/phoenix_live_view.js
  • priv/static/phoenix_live_view.min.js
2025-01-09T16:42:36 See commit

This commit updates the ex_doc dependency in the project's mix.lock file from version 0.35.1 to 0.36.1. The change involves modifying the version number and its associated hash, ensuring that the project utilizes the latest features and improvements provided by the new version of ex_doc. Additionally, the earmark_parser dependency has also been updated from version 1.4.41 to 1.4.42, which is likely a minor update that could include bug fixes or enhancements.

Overall, the commit reflects a routine maintenance effort to keep the project's dependencies up to date, specifically focusing on documentation generation tools and their associated libraries. By updating these packages, the project benefits from any improvements or fixes that have been introduced in the newer versions, contributing to better documentation quality and potentially enhancing the development experience.

Files changed

  • mix.lock
2025-01-09T17:01:20 See commit

This commit addresses a bug related to "sticky" live views in version 1.0.1 of the Phoenix LiveView framework. The fix ensures that sticky live views do not receive a URL upon joining, as they are not mounted at the router. This change is documented in the changelog and is accompanied by updates to integration tests to reflect the new behavior. The commit also modifies the live_socket.js, channel.ex, and session.ex files to implement the necessary logic for handling sticky live views correctly.

Additionally, the changes include updates to the mount function for sticky live views, ensuring they are properly marked as :not_mounted_at_router. This adjustment prevents the on_mount hooks from being incorrectly called during connected mounts. The commit was co-authored by Steffen Deusch and includes modifications across several files to improve the handling of live sessions and enhance overall stability in the framework.

Files changed

  • CHANGELOG.md
  • assets/js/phoenix_live_view/live_socket.js
  • lib/phoenix_live_view/channel.ex
  • lib/phoenix_live_view/session.ex
  • test/e2e/support/issues/issue_3047.ex
  • test/e2e/support/issues/issue_3496.ex
2025-01-09T17:01:52 See commit

The commit primarily involves updates to several static assets related to the Phoenix Live View framework. The files modified include various JavaScript files and their corresponding source maps, specifically the CommonJS, ES Module, and minified versions.

These changes likely reflect improvements or bug fixes to the Live View functionality, enhancing performance or compatibility within the application. The updates ensure that the latest features and optimizations are available for developers utilizing these assets in their projects.

Files changed

  • priv/static/phoenix_live_view.cjs.js
  • priv/static/phoenix_live_view.cjs.js.map
  • priv/static/phoenix_live_view.esm.js
  • priv/static/phoenix_live_view.esm.js.map
  • priv/static/phoenix_live_view.js
  • priv/static/phoenix_live_view.min.js