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
[reactive-element] Only use symbol keys for properties added as private storage. #3693
Conversation
🦋 Changeset detectedLatest commit: 4f9ce3c The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
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
|
I think if we do this it'll be a breaking change, since we don't call I'm actually ok with this as part of dropping IE11 support though, but we need to do that with a new major release in mind, and pull all being changes into Google one-by-one. |
@bicknellr let's do this as part of 3.0. Can you rebase onto the 3.0 branch? I could take the PR over too. |
… as keys to avoid conflicts.
…a known property name.
…`__`-prefixed property.
31ed9e9
to
4f9ce3c
Compare
SGTM, rebased. |
@@ -50,20 +52,18 @@ export function query(selector: string, cache?: boolean) { | |||
configurable: true, | |||
}; | |||
if (cache) { | |||
const key = typeof name === 'symbol' ? Symbol() : `__${name}`; | |||
const key = DEV_MODE | |||
? Symbol(`${String(name)} (@query() cache)`) |
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.
For already Symbol-keyed properties, this would give the property a "name" of something like "Symbol(Symbol()) (@query() cache)"
. I think that's probably fine, and we can change if someone complains.
Thanks @bicknellr ! |
Fixes #3690.