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

Fix inherit from constructor chain #468

Closed

Conversation

tlouisse
Copy link
Contributor

Reference Issue

Fixes #467

Instead of checking 'current' constructor level only, this checks the whole constructor chain for static get styles. In this way, it never misses styles defined on constructors never 'ran' before (like mixins): https://stackblitz.com/edit/lit-element-request-update-bug-lspgdq?file=test.js

This could however mean that this._styles is created redundantly for constructor layers that should have the same outcome as their parents(and therefore should be able tor reuse this._styles). A code example that addresses this problem can be found here:
https://github.com/tlouisse/lit-element/blob/fix/getStylesFromConstructorChainAlternative/src/lit-element.ts#L92
But I'm not sure if this is more performant and outweighs the benefits of less code.

Let me know what you think :)

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@tlouisse tlouisse force-pushed the fix/getStylesFromConstructorChain branch from 63c9570 to 98a031e Compare January 22, 2019 16:41
@googlebot
Copy link

CLAs look good, thanks!

@tlouisse
Copy link
Contributor Author

Closing, since already fixed via #470

@tlouisse tlouisse closed this Jan 23, 2019
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.

styles are not read from the constructor chain
2 participants