-
Notifications
You must be signed in to change notification settings - Fork 879
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
Correct polyfill-support styling issues #2002
Conversation
Fixes #2000: ShadyCSS's styleElement is now called before firstUpdate/update so that code in these methods can properly assume styling (including shimmed custom properties) has fully applied. Fixes #2001: Late added styles are now retained in templates. This behavior is consistent with what happened in Lit 1 and we're electing not to change it so that users that may be relying on this (admittedly weird and not well supported) behavior are not broken.
🦋 Changeset detectedLatest commit: 5251e3b The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultslit-element-list
render
update
update-reflect
lit-html-kitchen-sink
render
update
nop-update
lit-html-repeat
render
update
lit-html-template-heavy
render
update
reactive-element-list
render
update
update-reflect
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -145,12 +145,11 @@ interface PatchableReactiveElement extends HTMLElement { | |||
this: PatchableReactiveElement, | |||
changedProperties: unknown | |||
) { | |||
const isFirstUpdate = !this.hasUpdated; | |||
didUpdate.call(this, changedProperties); | |||
// Note, must do first update here so rendering has completed before | |||
// calling this and styles are correct by updated/firstUpdated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is pretty ambiguous; what does "first update" refer to (and why is the comment valid both before and after this change)?
Fixes #2000: ShadyCSS's styleElement is now called before firstUpdate/update so that code in these methods can properly assume styling (including shimmed custom properties) has fully applied.
Fixes #2001: Late added styles are now retained in templates. This behavior is consistent with what happened in Lit 1 and we're electing not to change it so that users that may be relying on this (admittedly weird and not well supported) behavior are not broken.