We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
phoenix_live_view changelog
Hey there, awesome developers! We've got some exciting updates and fixes to share with you. Check out the latest highlights below to see what's new and improved in our project. 🚀
New Features
- Release 1.0.0-rc.1: 🎉 Big milestone alert! We've rolled out version 1.0.0-rc.1, bringing a bunch of updates, bug fixes, and new features. This release marks a significant step towards our full version 1.0.0, enhancing performance and functionality across the board.
Improvements
-
Form Bindings Guide Update: We've updated the 'Form bindings' guide to set the form/changeset action to a conventional name, unrelated to database operations. This change uses the new
:action
option added in v1.0, aligning the code with best practices and ensuring consistency. 📚 -
Using form/3 with Inputs Inside and Outside the Form: Now you can use
form/3
with inputs both inside and outside the form element, addressing issue #3170. This enhancement improves form handling flexibility in Phoenix LiveView applications. 📝
Bugfixes
-
Check asyncFilter on Blur: Fixed issue #3194 by ensuring asyncFilter is checked on blur. We've also added an end-to-end test to ensure the event isn't sent to the wrong LiveView when submitting a form with debounce blur. 🐛
-
Named Form Inputs with put_submitter/2: Resolved the issue with named form inputs and
put_submitter/2
. Improvements include better handling of named inputs and removing some hacky comparisons. 🛠️ -
Wait for Transitions Before Determining cids_destroyed: Addressed issue #3139 by waiting for pending transitions to complete before determining if component IDs (cids) should be destroyed. This fix ensures more accurate and reliable cid destruction. ⏳
Changelog Update
- Changelog Enhancements: We've updated the changelog with several enhancements and bug fixes, including warnings for rendering an input named "id," allowing form recovery in nested LiveViews, and fixing warnings on Elixir 1.17. Also included are fixes for input tracking on checkboxes, resolving race conditions, and addressing page reload issues when disconnecting LiveSocket with Bandit. 📜
We hope these updates make your development experience even better. Keep coding and stay awesome! ✨
Included Commits
This commit updates the code example in the 'Form bindings' guide to set the form/changeset action to a conventional name unrelated to database operations, as recommended in the documentation. The code example, which was over 4 years old, now uses the new :action
option that was added to to_form
in version 1.0 of the software. This change aligns the code with best practices and ensures consistency with other parts of the documentation.
The commit modifies the form-bindings.md
file, with 1 addition and 2 deletions, resulting in a total of 3 changes. By updating the action name and utilizing the new :action
option, the code example in the guide now reflects the latest recommendations and improvements in the software. This update aims to enhance clarity and maintain consistency across the documentation, ultimately improving the user experience for developers using the Phoenix framework.
Files changed
- guides/client/form-bindings.md
This commit allows for the use of form/3 with inputs both inside and outside the form element, addressing issue #3170. The changes include modifications to the Phoenix.LiveViewTest.ClientProxy module, specifically adjusting the maybe_values function to handle different types of elements within a form. This change enables the extraction of values from named form fields and child fields, ensuring that the correct values are submitted when the form is filled out.
Additionally, the commit includes modifications to the Phoenix.LiveView.ElementsTest and Phoenix.LiveViewTest.ElementsLive modules to test the functionality of named forms. The test cases validate the submission of named form fields, ensuring that the correct values are captured and submitted when the form is rendered. Overall, this update enhances the flexibility and functionality of form handling within Phoenix LiveView applications.
Files changed
- lib/phoenix_live_view/test/client_proxy.ex
- test/phoenix_live_view/integrations/elements_test.exs
- test/support/live_views/elements.ex
This commit addresses issue #3139 by ensuring that the system waits for pending transitions to complete before determining if the component IDs (cids) have been added back to the DOM. Previously, the system would attempt to destroy cids immediately, potentially causing issues if the cids were added back during a transition. By implementing a check to see if the cids were added back before destroying them, the system can now accurately determine which cids should be destroyed.
The changes made in this commit involve modifying the View
class in view.js
to include a callback function that waits for pending transitions to complete before checking if the cids should be destroyed. This ensures that the system accurately determines which cids have been added back to the DOM and prevents premature destruction of cids. Overall, this fix improves the reliability and accuracy of cid destruction in the system.
Files changed
- assets/js/phoenix_live_view/view.js
This commit addresses issue #3194 by checking asyncFilter on blur in the DOM.js file and adding an e2e test for the same issue. The changes include modifying the event listener for blur in the DOM.js file to include a check for asyncFilter before executing the callback function. Additionally, a new test file, test/e2e/tests/issues/3194.spec.js, was added to test that the event is not sent to the wrong LiveView when submitting a form with debounce blur.
Furthermore, a new module, Phoenix.LiveViewTest.E2E.Issue3194Live, was added to handle the specific behavior related to issue #3194. This module includes functions to mount the LiveView, render the form with specific attributes, and handle events like submit and validate. Additionally, a nested module, OtherLive, was defined within Issue3194Live to render another LiveView component.
Files changed
- assets/js/phoenix_live_view/dom.js
- test/e2e/test_helper.exs
- test/e2e/tests/issues/3194.spec.js
- test/support/e2e/issues/issue_3194.ex
This commit addresses the issue of using named form inputs with put_submitter/2 in Phoenix Live View. The changes include fixing the function select_node_from_list, extracting select_node_by_text and filtered_fields, and making it clearer that named inputs are used separately. The commit also removes the form name/id comparison, which was considered hacky. Various changes were made to the client_proxy.ex file, including adding select_node_from_list, refining select_node_by_text, and updating the logic for handling named form inputs.
Additionally, the integrations/elements_test.exs file was modified to test the functionality of named forms with a submitter button. The test confirms that the named form submits the correct values, including the button value. The elements.ex file in the support/live_views directory was also updated to include a button element with a form attribute for testing purposes.
Files changed
- lib/phoenix_live_view/test/client_proxy.ex
- test/phoenix_live_view/integrations/elements_test.exs
- test/support/live_views/elements.ex
This commit updates the changelog with a list of changes made to the codebase. The changes include enhancements such as warning when rendering an input named "id," allowing form recovery to work on forms in nested LiveViews, and fixing warnings on Elixir 1.17. Bug fixes were also implemented, such as fixing used input tracking on checkboxes and hidden inputs, resolving a race condition when destroying Live Components, and fixing a page reload issue when disconnecting LiveSocket if using Bandit. Additionally, deprecations were made, including deprecating live_flash
in favor of Phoenix.Flash.get
.
Furthermore, enhancements were made to warn on mismatched client and server versions, fix nested LiveView within streams becoming empty when reset, and address errors related to phx-mounted
firing twice. Additionally, fixes were implemented for updated form values not being sent in some circumstances when phx-trigger-action is used and for phx-viewport bindings when the html or body element has an overflow property.
Files changed
- CHANGELOG.md
In this commit, version 1.0.0-rc.1 is being released. Several files have been modified as part of this release, including assets/package.json, CHANGELOG.md, mix.exs, mix.lock, package.json, and various phoenix_live_view files in the priv/static directory. These modifications likely include updates, bug fixes, or new features that are being introduced in this release. The changes made to these files are essential for the proper functioning and improvement of the project.
Overall, this commit signifies a significant milestone in the project's development, as it marks the release of version 1.0.0-rc.1. The modifications made to various files indicate that updates and improvements have been implemented, which will likely enhance the performance and functionality of the project. This release is a step towards achieving stability and readiness for a full version 1.0.0 release in the near future.
Files changed
- CHANGELOG.md
- assets/package.json
- mix.exs
- mix.lock
- 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