-
Notifications
You must be signed in to change notification settings - Fork 1k
[labs/analyzer] Handle class private fields in LitElement analysis #4746
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
Conversation
🦋 Changeset detectedLatest commit: 9b67740 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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
Resultsthis-change
render
update
update-reflect
this-change, tip-of-tree, previous-release
render
update
nop-update
this-change, tip-of-tree, previous-release
render
update
this-change, tip-of-tree, previous-release
render
update
update-reflect
|
74d318f to
22cbf71
Compare
22cbf71 to
c9c5011
Compare
|
The size of lit-html.js and lit-core.min.js are as expected. |
|
|
||
| for (const prop of propertyDeclarations) { | ||
| if (!ts.isIdentifier(prop.name)) { | ||
| if (!ts.isIdentifier(prop.name) && !ts.isPrivateIdentifier(prop.name)) { |
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.
@kevinpschaaf questions on this function, or you remember: it's named getProperties(), but only returns the reactive properties. 1) Should it be renamed? 2) Since reactive properties are kind of an implementation detail, and a getter/setter pair or different decorator could make a property reactive... are we handling those cases, or should we even distinguish reactive properties from others? Is this to do something else like find attributes?
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.
Yeah, iirc this was properties in the @property sense? The term field is used in the code to refer to generic fields. But yeah could rename to getReactiveProperties().
I think these would be used to determine the attributes for e.g. CEM (I see there's still a TODO in there), but also in the Angular wrapper to wrap them with @Input().
Fixes #4745
This change allows private fields to be handled, but because they're not likely to be reactive properties, they're effectively ignored in this code path.