-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allow late upgrading of bound elements #2653
Comments
+1. In 🎅's lazy loading system, we had to use |
👍 oh this would be magical ✨ |
yeah very much want this! |
👍 |
+1. Couple of observations. Reference plunker: http://plnkr.co/edit/4WEsWabS3nNSacyimwst
Update: After spending two more days on this, I found that the properties were updating from parent to lazy loaded element. However the local dom and child elements of the lazy loaded element were not getting the updated properties. I was able to resolve this by adding |
When using async HTML imports I encountered this issue too. I have tried to dig into the code to develop a solution, but sadly it is not clear enough where the issue is and how it can be solved. |
Currently elements that are bound (i.e. have data pushed to them by their host) must be upgraded prior to data propagation. This is because the act of upgrading installs accessors on the element via its prototype, which may be shadowed by data values propagated to the instance earlier by the host.
This is typically not an issue when an element imports all of its dependencies before registering, which guarantees that when a host stamps its template, the children upgrade prior to the host pushing its data.
However, to support lazy upgrade use cases, elements would need to support reading instance values for properties with accessors, deleting the instance values, and passing them into the initial configuration / setters. This should likely be an option via an attribute (e.g.
late-bind
) so that all instances aren't taxed with this extra processing.The text was updated successfully, but these errors were encountered: