phoenix_live_view changelog


Hey there, awesome developers! 🎉 We've got some exciting updates and improvements to share with you. Here's a rundown of the latest changes that are sure to make your coding experience even better:

  • Improvement: LazyHTML Takes the Stage! 🌟
    We're switching things up by introducing LazyHTML as the new HTML engine for LiveViewTest. Say goodbye to Floki and hello to modern CSS selector features, like :is() and :has(), thanks to LazyHTML's lexbor library base. This change is mostly backward compatible, but if you're using Floki-specific selectors, you'll need to tweak your test code. Bonus: LazyHTML is faster and reduces memory allocation, which means your tests will run like a dream. 🚀

  • Improvement: Docs Get a Makeover! 📚
    We've spruced up the documentation by removing mentions of the phx-page-loading attribute. Now, you can manage page loading events with Phoenix.LiveView.JS.push/3 and the page_loading: true option. This change is all about keeping things fresh and up-to-date, so your docs reflect the latest and greatest practices. Big shoutout to Steffen Deusch for the co-authoring magic! ✨

  • Bugfix: Typo Takedown! 🔍
    We squashed a pesky typo in the LiveViewTest docs. The phrase "along with some with hidden input values" is now crystal clear as "along with some hidden input values." It's a small change, but it makes a big difference in readability. Keep those docs pristine, folks! 📝

These updates are all about enhancing your coding journey, so dive in and enjoy the improved performance, functionality, and documentation. Happy coding! 🎈

Included Commits

2025-04-04T09:18:13 See commit

This commit addresses a minor typo in the documentation for the LiveViewTest module within the Phoenix LiveView framework. Specifically, it corrects the phrase "along with some with hidden input values" to "along with some hidden input values," enhancing clarity and accuracy in the documentation.

The changes were made in the live_view_test.ex file, where one word was removed and another added to improve the readability of the text. Overall, this update contributes to maintaining high-quality documentation for users of the Phoenix LiveView framework.

Files changed

  • lib/phoenix_live_view/test/live_view_test.ex
2025-04-04T11:04:05 See commit

This commit focuses on updating the documentation to remove references to the phx-page-loading attribute, reflecting changes in the handling of page loading events within the framework. The modifications include updates to the bindings guide, syncing changes guide, and view tests, ensuring that the documentation accurately represents the current implementation. Specifically, the commit transitions from using the phx-page-loading attribute to using the Phoenix.LiveView.JS.push/3 method with the page_loading: true option for managing page loading events.

Additionally, the changes in the test files demonstrate the removal of the phx-page-loading attribute from form elements, reinforcing the updated approach to managing loading states. The commit was co-authored by Steffen Deusch, highlighting collaborative efforts in maintaining the documentation and codebase. Overall, this update aims to streamline the documentation and align it with the latest coding practices within the framework.

Files changed

  • assets/test/view_test.js
  • guides/client/bindings.md
  • guides/client/syncing-changes.md
2025-04-04T14:25:05 See commit

This commit introduces the use of LazyHTML in the testing infrastructure of Phoenix.LiveView, as part of the upcoming version 1.1. LazyHTML offers a more efficient HTML parsing mechanism by keeping the HTML document in memory and converting it to a tree lazily, which reduces memory allocation. This change is expected to improve performance, as demonstrated in Livebook, where the test suite execution time decreased from approximately 9 seconds to 7 seconds. Additionally, LazyHTML supports more query selectors and behaves more similarly to actual browsers, enhancing the testing experience.

The commit includes several modifications across various files, such as updates to the test scripts, proper management of the lazy cache, and the addition of new test files for the LazyHTML integration. Co-authored by Jonatan Kłosko and José Valim, the changes reflect a significant enhancement to the LiveView testing framework, paving the way for improved performance and functionality in future applications that adopt LazyHTML.

Files changed

  • .github/single-file-samples/test.exs
  • lib/phoenix_live_view/test/client_proxy.ex
  • lib/phoenix_live_view/test/diff.ex
  • lib/phoenix_live_view/test/dom.ex
  • lib/phoenix_live_view/test/live_view_test.ex
  • lib/phoenix_live_view/test/tree_dom.ex
  • mix.exs
  • mix.lock
  • test/phoenix_component/components_test.exs
  • test/phoenix_component/declarative_assigns_test.exs
  • test/phoenix_live_view/integrations/elements_test.exs
  • test/phoenix_live_view/integrations/layout_test.exs
  • test/phoenix_live_view/integrations/live_components_test.exs
  • test/phoenix_live_view/integrations/live_view_test.exs
  • test/phoenix_live_view/integrations/navigation_test.exs
  • test/phoenix_live_view/integrations/nested_test.exs
  • test/phoenix_live_view/integrations/params_test.exs
  • test/phoenix_live_view/integrations/stream_test.exs
  • test/phoenix_live_view/integrations/update_test.exs
  • test/phoenix_live_view/router_test.exs
  • test/phoenix_live_view/test/diff_test.exs
  • test/phoenix_live_view/test/dom_test.exs
  • test/phoenix_live_view/test/tree_dom_test.exs
  • test/support/live_views/elements.ex
2025-04-10T09:50:17 See commit

This commit updates the changelog for LiveView version 1.1, highlighting the transition from Floki to LazyHTML as the HTML engine utilized by LiveViewTest. LazyHTML, which is based on the lexbor library, supports modern CSS selector features such as :is() and :has(), enabling more robust element targeting in tests. The change is largely backward compatible; however, users relying on Floki-specific selectors like fl-contains and fl-icontains will need to adjust their test code, particularly if they used the phx.gen.auth generator in Phoenix versions prior to 1.8. The recommended alternative is to utilize the text_filter option in the element/3 function.

Additionally, the commit notes enhancements such as whitespace normalization in text filters and improved error handling for duplicate DOM or LiveComponent IDs in LiveViewTest. Overall, this update aims to streamline testing processes and encourage the adoption of modern CSS features while maintaining compatibility with existing test setups.

Files changed

  • CHANGELOG.md