-
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
Adds optional error callback to customElement
decorator; provides define
helper
#4461
base: main
Are you sure you want to change the base?
Conversation
Adds an optional `onError` callback to handle an exception generated by define.
🦋 Changeset detectedLatest commit: b82e78e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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
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
|
The size of lit-html.js and lit-core.min.js are as expected. |
--- | ||
'@lit/reactive-element': patch | ||
'lit': patch | ||
'lit-element': patch | ||
--- |
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.
This is a new feature so maybe it warrants a minor bump rather than patch?
--- | |
'@lit/reactive-element': patch | |
'lit': patch | |
'lit-element': patch | |
--- | |
--- | |
'@lit/reactive-element': minor | |
'lit': minor | |
'lit-element': minor | |
--- |
* @param onError | ||
* @returns void | ||
*/ | ||
export const define = ( |
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.
This could be used by users that aren't using the decorator but they'd have to import it from lit/decorators/custom-element.js
or lit/decorators.js
.
Would it maybe make sense to move define
, warn
, and warnPackabeVErsion
to a separate submodule like @lit/reactive-element/define.js
, which will be mirrored in lit-element
and lit
?
Fixes #4455.
customElements
decorator.define
helper with an optional error callback for javascript use.warn
error callback which issues aconsole.warn
warnPackageVersion
error callback which issues aconsole.warn
when an incompatible package and/or version is defined.error
,tagName
, andconstructor
whencustomElements.deine
fails; providing any error callback catches the define exception.