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

Ready/attached ordering #3947

Merged
merged 5 commits into from
Sep 16, 2016
Merged

Ready/attached ordering #3947

merged 5 commits into from
Sep 16, 2016

Conversation

sorvell
Copy link
Contributor

@sorvell sorvell commented Sep 13, 2016

Fixes #3933, #3930.

Ensure dom is attached after is has been readied. In Polymer 1.0, the attached call was specially deferred until after ready. Instead, we now slightly loosen the definition of ready to obviate the need for deferring attached. An element has this.root in ready and this dom fragment contains all of the the element's "readied" dom; however, it does not yet have this.shadowRoot. Directly after calling ready the content of this.root is added to this.shadowRoot and then this.root is set to the shadowRoot.

With this change we've also added an overridable _attachDom(dom) method which can be used to place an element's local dom in some other location than its shadowRoot.

This change should maintain enough of the attached guarantee that Polymer 1.x had while also naturally playing better with just directly using connectedCallback as Polymer.Element users shall do.

Ensure dom is attached after is has been readied.
@kevinpschaaf
Copy link
Member

LGTM

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

Successfully merging this pull request may close these issues.

3 participants