Skip to content

Conversation

@sorvell
Copy link
Member

@sorvell sorvell commented Mar 12, 2019

Fixes #594. Ensures an early access of updateComplete will not complete before the element has first updated (at connection time).

Steven Orvell added 2 commits March 11, 2019 18:12
…ack`

Fixes #594. Ensures an early access of `updateComplete` will not complete before the element has first updated (at connection time).
@sorvell sorvell added this to the 2.0.x milestone Mar 12, 2019
Copy link
Member

@kevinpschaaf kevinpschaaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

this._hasConnectedResolver();
this._hasConnectedResolver = undefined;
} else {
this.requestUpdate();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary here is we're considering the fact that requestUpdate was called every connection a bug, since the intention of this code was only to ensure a "request if not yet requested" one time on boot-up.

If users depend on tree-state in render(), they should manually requestUpdate in connectedCallback to ensure render is called when the tree state changes.

Copy link
Contributor

@justinfagnani justinfagnani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you file a documentation bug too? The update lifecycle docs lack some detail around this, even before the change.

@sorvell
Copy link
Member Author

sorvell commented Mar 14, 2019

Filed #614.

@sorvell sorvell merged commit 5b21b7e into master Mar 14, 2019
@sorvell sorvell deleted the early-request-update branch March 14, 2019 18:30
@oravecz
Copy link

oravecz commented Jun 20, 2019

Small issue.

// will exist. If so, resolve it to complete the update, otherwise
// requestUpdate.

The comment that was left in the connectedCallback function still refers to the call to requestUpdate even after the function was removed.

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.

updateComplete should not resolve until the element has connected

5 participants