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

Hidden Views do not reload #1

Open
niieani opened this issue Dec 1, 2016 · 0 comments
Open

Hidden Views do not reload #1

niieani opened this issue Dec 1, 2016 · 0 comments

Comments

@niieani
Copy link
Contributor

niieani commented Dec 1, 2016

This includes Views which are conditionally hidden (e.g. with if.bind), not the ones that are simply not shown (hidden via CSS).

To reproduce:

  1. hide a View so that it's removed from the DOM
  2. change the template of that View
  3. unhide the View

The View will still contain old data, and its ViewFactory and template fragment will be out of date with the module, thus any further HMR on that Element will fail until the View is fully re-created (e.g. by switching routes).

To fix this we'll need to switch the way we traverse Controllers in search for Views matching a given template. We need to match all the Views, whether they're attached and present in the DOM or not.

If that still does not make it possible to access all the created View instances, we can think of alternative solutions, such as storing old fragments, or tracking Views with afterCreated hook and then replacing the ViewFactories in a beforeBind hook. However, this would not be a great solution because this would cause a memory-leak, as the memory consumption of the site would grow with every hot-reload of any View.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant