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
Here's a rundown of the latest changes, improvements, and bug fixes that will make your coding experience smoother and more delightful. Let's dive in! 🚀
-
Improvement: Keep original structure of
__changed__
We've spruced up theforce_assign
function to better handle change tracking for nested structures. Now it stores the current value in thechanged
map only if it's a list or map, preserving the original value. For non-collection types, a default value oftrue
is set, making change tracking a breeze. Tests have been updated to keep everything in sync. 🌟 -
Improvement: Keep values of composite types in
__changed__
Tuples are now part of the gang! We've expanded change tracking to include tuples in the__changed__
map, joining lists and maps. This ensures comprehensive monitoring of changes in composite types, making sure nothing slips through the cracks. 🎉 -
Improvement: Update changelog
Our CHANGELOG.md got a makeover! It now includes updates on error messages, slot option validations, and a bunch of bug fixes. From stream items to Safari quirks, we've tackled them all. Plus, there's a heads-up on the deprecation of thename
attribute inPhoenix.Component.dynamic_tag/1
. Keep your eyes peeled fortag_name
! 📝 -
Bugfix: Fix typo in
attach_hook/4
doc
We squashed a tiny typo in theattach_hook/4
documentation. Now it reads "you may not be interested in" instead of "on," making the docs grammatically sound. Because every little bit counts! 🐞 -
Bugfix: Fix typo
Another typo bites the dust! In theforce_assign
function comments, "tiple" has been corrected to "tuple," ensuring clarity and precision in describing composite types. Code readability is key! 🔍
Enjoy the enhancements and happy coding! 💻✨
Included Commits
This commit addresses a minor typographical error in the documentation for the attach_hook/4
function within the Phoenix.LiveView
module. The change corrects the phrase "you may not be interested on" to "you may not be interested in," enhancing the clarity and grammatical accuracy of the documentation.
The commit includes a single addition and deletion, resulting in two changes to the text. This correction is part of an ongoing effort to maintain high-quality documentation within the codebase, ensuring that developers have clear and precise guidance when working with the Phoenix LiveView framework.
Files changed
- lib/phoenix_live_view.ex
This commit modifies the force_assign
function in the lib/phoenix_live_view/utils.ex
file to enhance how it handles change tracking for nested structures. The changes include adjusting the logic to store the current value in the changed
map only if it is a list or a map, thereby ensuring that the original value is preserved. Additionally, the function now sets a default value of true
for non-collection types, streamlining the tracking of changes.
In the accompanying test file, test/phoenix_component_test.exs
, the tests have been updated to reflect the new logic in force_assign
. The __changed__
map entries for existing and non-existing keys have been modified from nil
to true
, indicating that any changes to these keys should be tracked as significant alterations. This ensures that the tests remain consistent with the updated behavior of change tracking in the LiveView framework.
Files changed
- lib/phoenix_live_view/utils.ex
- test/phoenix_component_test.exs
This commit enhances the change tracking functionality in the Phoenix.LiveView
framework by updating the __changed__
map to include tuples as a recognized composite type. By doing so, it allows for more comprehensive nested change tracking, ensuring that any changes to composite types—specifically lists, maps, and now tuples—are properly monitored.
The modifications were made in the lib/phoenix_live_view/utils.ex
file, where the force_assign
function was updated to check for tuples in addition to lists and maps. The use of put_new
remains crucial, as it preserves the original values from the assigns rather than any intermediate changes that may occur. This change is referenced in issue #3392, indicating its relevance in ongoing development discussions.
Files changed
- lib/phoenix_live_view/utils.ex
This commit addresses a minor typographical error in the comment section of the force_assign
function within the Phoenix.LiveView.Utils
module. The change corrects the word "tiple" to "tuple," ensuring that the comment accurately describes the composite types being referenced, which include lists, maps, and tuples.
The modification involves one addition and one deletion, resulting in a clearer and more precise comment that aids in understanding the function's purpose and behavior. Overall, the commit enhances code readability without altering any functionality.
Files changed
- lib/phoenix_live_view/utils.ex
The recent commit updates the CHANGELOG.md file to reflect several enhancements, bug fixes, and deprecations in the codebase. Notably, it introduces a more informative error message for invalid target inputs in the JS.dispatch/2
function and validates slot options to prevent common typos. The commit also addresses multiple bug fixes, including issues with stream items not reapplying JavaScript commands after a disconnect, unnecessary remounts during navigation, and problems with character composition mode in Safari. Additionally, it resolves an error related to socket redirection and an issue with the morphdom library affecting DOM manipulation.
Furthermore, the commit includes a deprecation notice for the name
attribute of Phoenix.Component.dynamic_tag/1
, recommending the use of tag_name
instead. Overall, these updates aim to improve error handling, enhance functionality, and streamline the development experience by addressing existing bugs and deprecating outdated features.
Files changed
- CHANGELOG.md