-
Notifications
You must be signed in to change notification settings - Fork 889
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] New queryAssignedNodes API and deprecate current API #2338
Conversation
🦋 Changeset detectedLatest commit: ef9216d 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
|
ad439fc
to
b3dae4b
Compare
107cad6
to
02641bc
Compare
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.
Transformer part of this LGTM, great stuff!
property: ts.ClassElement, | ||
decorator: ts.Decorator | ||
) { | ||
if (this.legacyVisitor.visit(litClassContext, property, decorator)) { |
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.
Clever!
…ecated legacy API. This brings the queryAssignedNodes API to a symmetry with the @queryAssignedElements API.
Minor refactoring has been done so that the legacy assignedNodes visitor can be run ahead of the extended queryAssignedElementsVisitor which was slightly refactored.
79db184
to
3a71b8d
Compare
3a71b8d
to
cc0295c
Compare
Do our docs not show overloads, or do they not show deprecated overloads? |
packages/reactive-element/src/decorators/query-assigned-nodes.ts
Outdated
Show resolved
Hide resolved
packages/reactive-element/src/decorators/query-assigned-nodes.ts
Outdated
Show resolved
Hide resolved
packages/reactive-element/src/decorators/query-assigned-nodes.ts
Outdated
Show resolved
Hide resolved
Our generated API documentation does not show overloads. |
Also removed the object creation and destructuring method of normalizing arguments.
930952a
to
ef9216d
Compare
Addresses: #2332 and #2171
Following the inclusion of queryAssignedElements, this change adds a new API and deprecates the old
@queryAssignedNodes
API.Note the new
queryAssignedNodes
options does not includeselector
. If usingselector
please use@queryAssignedElements
.@queryAssignedNodes('', false, '.item')
is functionally identical to@queryAssignedElements({slot: '', flatten: false, selector: '.item'})
or@queryAssignedElements({selector: '.item'})
.Features
@queryAssignedElements
.@queryAssignedNodes
supports both APIs.queryAssignedNodes
visitor refactored slightly so that it continues to work on legacy documentation examples.queryAssignedElements
visitor refactored so it can be easily extended. It works almost exactly the same asqueryAssignedElements
but withassignedNodes
method and the generated selector modified.@queryAssignedElements
and@queryAssignedNodes
.Testing
Manual testing screenshots on Lit.dev API
Screenshots showing the fixed
@queryAssignedElements
and@queryAssignedNodes
generated API.