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

[lit-next] Add dev mode warning for shadowed reactive fields #1357

Closed
sorvell opened this issue Oct 8, 2020 · 1 comment
Closed

[lit-next] Add dev mode warning for shadowed reactive fields #1357

sorvell opened this issue Oct 8, 2020 · 1 comment
Assignees

Comments

@sorvell
Copy link
Member

sorvell commented Oct 8, 2020

Description

Use of class fields continues to be an annoying foot-gun for Lit users, see lit/lit-element#855. While we could "fix" the elements, it would incur a significant performance penalty. This is due to needing to call delete and this putting the object into dictionary mode at least in V8.

However, elements with masked properties can be non-functional in pretty unintuitive ways. We can at least mitigate developer confusion by producing a good error message in dev mode. This would involve iterating over properties when updating is enabled and doing a hasOwnProperty check and producing an error.

Acceptance criteria

PR landed.

@sorvell
Copy link
Member Author

sorvell commented Dec 8, 2020

Fixed via #1375

@sorvell sorvell closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant