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

Preserving component's state #11

Open
mgechev opened this issue Dec 22, 2015 · 3 comments
Open

Preserving component's state #11

mgechev opened this issue Dec 22, 2015 · 3 comments

Comments

@mgechev
Copy link
Owner

mgechev commented Dec 22, 2015

No description provided.

@mgechev mgechev mentioned this issue Dec 22, 2015
2 tasks
@frederikschubert
Copy link

I think that inputs, outputs and methods should not be transferred from the old component to the new one. So this leaves only the internal state of the component and I am not sure if we should persist this. Because it could lead to a state in the component that cannot be recreated by using either the old or the new implementation.
A (silly) example:
A component has a counter that starts with 0 and is incremented by 2 by a click event. After a 2 clicks the component gets reloaded and the counter is now incremented by 3. After one more click the component is now in a state (7) that is not reachable from the old or the new implementation.
This could be very difficult to debug and can only be fixed by doing a page reload.

Also when the refactoring is done the overall state of the application stays the same and only the subtrees of components that depend on the changed component will loose their state.

@mgechev
Copy link
Owner Author

mgechev commented Dec 23, 2015

We can take a look at preserving the state from one more perspective - we need to keep the element injectors which are instantiated for the individual directives.

AFAIK they are stored in the AppView(s). This implies that the AppView needs to be restored once the application has been loaded.

@mgechev
Copy link
Owner Author

mgechev commented Mar 16, 2016

@frederikschubert last night I spend a few hours preserving the instantiated dependencies for static injectors. I have some progress there, next goal is to refactor, provide dynamic injector support + component state preservation.

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

2 participants