-
Notifications
You must be signed in to change notification settings - Fork 8
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
Destroy and reinitialize only changed components #8
Comments
Yes, this is in my roadmap. There are a couple of things to be considered here such as managing the reinstantiated view and content children. I will rename the issue and add it as a feature request. |
I did some work on this and my current state can be seen here. |
Since keeping the component's state is a core problem lets open a separate issue for discussion. |
I have mostly implemented the component-scoped reload here but I have a problem with the change detection. The CD only runs for the changed component but not for its parent, so the component's inputs are not refreshed. |
Right now the hot loading works by (re)loading the app's root component using the
DynamicComponentLoader
, i.e. reinitializing the whole application every time a component/template/style is updated.This could become a problem as the application grows larger. I know that by using patterns like flux or redux the view of the application can be reinitialized just by persisting the state before the application gets reinitialized. But for people who do not use such patterns the hot-loader could be more helpful if only those components (and thus their children) would be reloaded that changed.
I haven't fully understood the inner workings of how Angular instantiates components and their respective views but I think one API one could use for this could be the
AppViewManager
. If this was possible then there would also be the possibility to transfer some of the state of the old component to the updated component. I think that this could provide an even smoother developer experience.The text was updated successfully, but these errors were encountered: