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

Force assign ID on LiveComponents to re-render during :phoenix_live_reload #3320

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonklein
Copy link

Live reloading does not currently work with live_components, as described in phoenixframework/phoenix_live_reload#162.

This PR adds support for live reloading of live_components by force re-assigning the live component’s ID field when processing the :phoenix_live_reload message.

I’m not familiar enough with the LiveView internals to know if this is the correct approach, but it’s working well for me in testing - please let me know if there’s a better way to accomplish this.

@SteffenDE SteffenDE requested a review from chrismccord July 27, 2024 10:10
@josevalim
Copy link
Member

FWIW, I have been talking to @chrismccord about supporting a new strategy which is basically rebuilding the page but without doing a full navigation. Regarding the patch above, I think it will call the update callback, which we probably don't want to? We probably need to change the Diff module and simply ask them to be re-rendered again?

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