Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix skipped children on stream reset #3070

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

SteffenDE
Copy link
Collaborator

When fixing stream limits I added a component restore functionality, but this was only working with LiveComponent that were skipped and only if they were the direct stream children. It could still happen that nested elements inside the stream child were skipped and not restored.

This PR solves this by storing all stream child elements children with a PHX_MAGIC_ID and restoring them later in case they were skipped.

When fixing stream limits I added a component restore functionality,
but this was only working with LiveComponent that were skipped and only
if they were the direct stream children. It could still happen that
nested elements inside the stream child were skipped and not restored.

This commit solves this by storing all stream child elements children
with a PHX_MAGIC_ID and restoring them later in case they were skipped.
@chrismccord chrismccord merged commit 1a75fe6 into phoenixframework:main Feb 1, 2024
5 checks passed
@chrismccord
Copy link
Member

❤️❤️❤️🐥🔥

SteffenDE added a commit to SteffenDE/phoenix_live_view that referenced this pull request Feb 11, 2024
This is a followup to phoenixframework#3070 and phoenixframework#3035.

When adjusting the stream component restore functionality in phoenixframework#3070, I
accidentally broke live components in streams, but the tests did not
detect this because they only checked the id of the stream items and not
their content. Therefore, this commit also adjusts the tests.

Another problem that was introduced in phoenixframework#3035 by not leaving re-inserted
items in the DOM is that nested streams inside live components inside
streams would not be restored properly. This commit addresses this by
recursively running morphdom on the restored stream items.
chrismccord pushed a commit that referenced this pull request Feb 14, 2024
This is a followup to #3070 and #3035.

When adjusting the stream component restore functionality in #3070, I
accidentally broke live components in streams, but the tests did not
detect this because they only checked the id of the stream items and not
their content. Therefore, this commit also adjusts the tests.

Another problem that was introduced in #3035 by not leaving re-inserted
items in the DOM is that nested streams inside live components inside
streams would not be restored properly. This commit addresses this by
recursively running morphdom on the restored stream items.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants