-
Notifications
You must be signed in to change notification settings - Fork 879
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
Expand jsdoc documentation for reactive-element and lit-element. #2161
Conversation
🦋 Changeset detectedLatest commit: b036fd2 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
|
441c10a
to
6b6b0c1
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.
Nice docs!
Link thing is optional -- maybe something we should do as a search/replace across everything.
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.
LGTM. Added a few minor suggestions.
Co-authored-by: Arthur Evans <arthure@google.com>
@@ -759,11 +759,15 @@ export abstract class ReactiveElement | |||
private __updatePromise!: Promise<boolean>; | |||
|
|||
/** | |||
* Internal flag marking a pending update. |
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.
Authors can definitely read this flag. It might be handy in custom getUpdateComplete
implementations... so maybe instead of "Internal" just say that it's true if there's a pending update as a result of a requestUpdate()
call and it should only be read.
* @category updates | ||
*/ | ||
isUpdatePending = false; | ||
|
||
/** | ||
* Is set to `true` after the first update. Required for compatibility with |
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.
I'd remove the "required for..." and just say "The element cannot assume..."
@@ -817,6 +821,9 @@ export abstract class ReactiveElement | |||
} | |||
|
|||
/** | |||
* Registers a `ReactiveController` to participate in the element's reactive update cycle. | |||
* The element automatically calls into any registered controllers during its | |||
* lifecycle callbacks. |
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.
Add "If the element is connected when addController()
is called, the controller's hostConnected()
callback will be immediately called.
0bb10db
to
2986806
Compare
Is this ok to merge with the failing tests? None of them seem related to jsdocs? |
The changeset failure is because there's no changeset. Might actually make sense here, since it is a change to the distributed package, and a changeset will signal that there is a pending change that hasn't been released yet, and eventually make its way into the CHANGELOG. You can use I think the Sauce tests always fail, something has been up with those for weeks. IE11 busted? Not sure. |
Just something general like "Additional documentation on Lit APIs" or something seems fine. |
Context
Add some documentation for some public undocumented methods in lit-element and reactive-element. Addresses github issue: #1883
How
Used lit.dev documentation to guide the jsdocs, and addressed some class members that had no documentation on the lit.dev/docs/api pages.
Added some documentation for previously undocumented:
LitElement.connectedCallback()
LitElement.disconnectedCallback()
ReactiveElement.hasUpdated
ReactiveElement.addController
ReactiveElement.removeController
Testing
Tested with mouse over in VsCode.
Thank you!