diff --git a/.changeset/big-yaks-laugh.md b/.changeset/big-yaks-laugh.md new file mode 100644 index 000000000..a59508505 --- /dev/null +++ b/.changeset/big-yaks-laugh.md @@ -0,0 +1,13 @@ +--- +'@lion/calendar': minor +'@lion/core': minor +'@lion/form-core': minor +'@lion/input': minor +'@lion/input-datepicker': minor +'@lion/overlays': minor +'providence-analytics': minor +'@lion/select-rich': minor +'@lion/switch': minor +--- + +Update to lit-element 2.4.0, changed all uses of \_requestUpdate into requestUpdateInterval diff --git a/packages/calendar/src/LionCalendar.js b/packages/calendar/src/LionCalendar.js index 34acec374..7d9f2bfec 100644 --- a/packages/calendar/src/LionCalendar.js +++ b/packages/calendar/src/LionCalendar.js @@ -234,8 +234,8 @@ export class LionCalendar extends LocalizeMixin(LitElement) { /** * @override */ - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); const map = { disableDates: () => this.__disableDatesChanged(), diff --git a/packages/core/package.json b/packages/core/package.json index 695b3d299..2e67bbca7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -31,8 +31,8 @@ "dependencies": { "@open-wc/dedupe-mixin": "^1.2.18", "@open-wc/scoped-elements": "^1.0.3", - "lit-element": "~2.3.0", - "lit-html": "^1.0.0" + "lit-element": "~2.4.0", + "lit-html": "^1.3.0" }, "keywords": [ "lion", diff --git a/packages/core/src/DisabledMixin.js b/packages/core/src/DisabledMixin.js index c4f0926c7..05a5dab9b 100644 --- a/packages/core/src/DisabledMixin.js +++ b/packages/core/src/DisabledMixin.js @@ -10,7 +10,6 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin'; */ const DisabledMixinImplementation = superclass => // eslint-disable-next-line no-shadow - // @ts-expect-error we're overriding private _requestUpdate class DisabledMixinHost extends superclass { static get properties() { return { @@ -55,9 +54,8 @@ const DisabledMixinImplementation = superclass => * @param {PropertyKey} name * @param {?} oldValue */ - _requestUpdate(name, oldValue) { - // @ts-expect-error - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (name === 'disabled') { if (this.__isUserSettingDisabled) { this.__restoreDisabledTo = this.disabled; diff --git a/packages/core/src/DisabledWithTabIndexMixin.js b/packages/core/src/DisabledWithTabIndexMixin.js index 2fbcaf321..ca91a539c 100644 --- a/packages/core/src/DisabledWithTabIndexMixin.js +++ b/packages/core/src/DisabledWithTabIndexMixin.js @@ -11,7 +11,6 @@ import { DisabledMixin } from './DisabledMixin.js'; */ const DisabledWithTabIndexMixinImplementation = superclass => // eslint-disable-next-line no-shadow - // @ts-expect-error we're overriding private _requestUpdate class DisabledWithTabIndexMixinHost extends DisabledMixin(superclass) { static get properties() { return { @@ -60,9 +59,8 @@ const DisabledWithTabIndexMixinImplementation = superclass => * @param {PropertyKey} name * @param {?} oldValue */ - _requestUpdate(name, oldValue) { - // @ts-expect-error - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (name === 'disabled') { if (this.disabled) { diff --git a/packages/form-core/src/FormatMixin.js b/packages/form-core/src/FormatMixin.js index 91c58be00..d2628834b 100644 --- a/packages/form-core/src/FormatMixin.js +++ b/packages/form-core/src/FormatMixin.js @@ -119,8 +119,8 @@ const FormatMixinImplementation = superclass => * @param {string} name * @param {any} oldVal */ - _requestUpdate(name, oldVal) { - super._requestUpdate(name, oldVal); + requestUpdateInternal(name, oldVal) { + super.requestUpdateInternal(name, oldVal); if (name === 'modelValue' && this.modelValue !== oldVal) { this._onModelValueChanged({ modelValue: this.modelValue }, { modelValue: oldVal }); diff --git a/packages/form-core/src/InteractionStateMixin.js b/packages/form-core/src/InteractionStateMixin.js index b2c292c5d..8bc4e5b05 100644 --- a/packages/form-core/src/InteractionStateMixin.js +++ b/packages/form-core/src/InteractionStateMixin.js @@ -67,14 +67,14 @@ const InteractionStateMixinImplementation = superclass => * @param {PropertyKey} name * @param {*} oldVal */ - _requestUpdate(name, oldVal) { - super._requestUpdate(name, oldVal); + requestUpdateInternal(name, oldVal) { + super.requestUpdateInternal(name, oldVal); if (name === 'touched' && this.touched !== oldVal) { this._onTouchedChanged(); } if (name === 'modelValue') { - // We do this in _requestUpdate because we don't want to fire another re-render (e.g. when doing this in updated) + // We do this in requestUpdateInternal because we don't want to fire another re-render (e.g. when doing this in updated) // Furthermore, we cannot do it on model-value-changed event because it isn't fired initially. this.filled = !this._isEmpty(); } diff --git a/packages/form-core/src/choice-group/ChoiceInputMixin.js b/packages/form-core/src/choice-group/ChoiceInputMixin.js index a240adae6..4650a5c0e 100644 --- a/packages/form-core/src/choice-group/ChoiceInputMixin.js +++ b/packages/form-core/src/choice-group/ChoiceInputMixin.js @@ -48,8 +48,8 @@ export const ChoiceInputMixin = superclass => } } - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (name === 'modelValue') { if (this.modelValue.checked !== this.checked) { @@ -177,7 +177,7 @@ export const ChoiceInputMixin = superclass => /** * @override * hasChanged is designed for async (updated) callback, also check for sync - * (_requestUpdate) callback + * (requestUpdateInternal) callback */ _onModelValueChanged({ modelValue }, { modelValue: old }) { if (this.constructor._classProperties.get('modelValue').hasChanged(modelValue, old)) { diff --git a/packages/form-core/src/utils/SyncUpdatableMixin.js b/packages/form-core/src/utils/SyncUpdatableMixin.js index aba661f16..6591afc54 100644 --- a/packages/form-core/src/utils/SyncUpdatableMixin.js +++ b/packages/form-core/src/utils/SyncUpdatableMixin.js @@ -17,8 +17,8 @@ import { dedupeMixin } from '@lion/core'; * - makes the propertyAccessor.`hasChanged` compatible in synchronous updates: * `updateSync` will only be called when new value differs from old value. * See: https://lit-element.polymer-project.org/guide/lifecycle#haschanged - * - it is a stable abstaction on top of a protected/non offical lifecycle LitElement api. - * Whenever the implementation of `_requestUpdate` changes (this happened in the past for + * - it is a stable abstraction on top of a protected/non official lifecycle LitElement api. + * Whenever the implementation of `requestUpdateInternal` changes (this happened in the past for * `requestUpdate`) we only have to change our abstraction instead of all our components * @type {SyncUpdatableMixin} */ @@ -78,8 +78,8 @@ const SyncUpdatableMixinImplementation = superclass => * @param {string} name * @param {*} oldValue */ - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); this.__SyncUpdatableNamespace = this.__SyncUpdatableNamespace || {}; const ns = this.__SyncUpdatableNamespace; @@ -98,8 +98,8 @@ const SyncUpdatableMixinImplementation = superclass => } /** - * @desc A public abstraction that has the exact same api as `_requestUpdate`. - * All code previously present in _requestUpdate can be placed in this method. + * @desc A public abstraction that has the exact same api as `requestUpdateInternal`. + * All code previously present in requestUpdateInternal can be placed in this method. * @param {string} name * @param {*} oldValue */ diff --git a/packages/form-core/test/utils/SyncUpdatableMixin.test.js b/packages/form-core/test/utils/SyncUpdatableMixin.test.js index 38ba9bf72..7a0a788cc 100644 --- a/packages/form-core/test/utils/SyncUpdatableMixin.test.js +++ b/packages/form-core/test/utils/SyncUpdatableMixin.test.js @@ -151,9 +151,9 @@ describe('SyncUpdatableMixin', () => { * @param {string} name * @param {*} oldValue */ - _requestUpdate(name, oldValue) { + requestUpdateInternal(name, oldValue) { // @ts-ignore the private override is on purpose - super._requestUpdate(name, oldValue); + super.requestUpdateInternal(name, oldValue); if (name === 'prop') { propChangedCount += 1; } diff --git a/packages/input-datepicker/src/LionInputDatepicker.js b/packages/input-datepicker/src/LionInputDatepicker.js index 25bd33dd5..52cc7e3ca 100644 --- a/packages/input-datepicker/src/LionInputDatepicker.js +++ b/packages/input-datepicker/src/LionInputDatepicker.js @@ -172,8 +172,8 @@ export class LionInputDatepicker extends ScopedElementsMixin(OverlayMixin(LionIn return `${this.localName}-${Math.random().toString(36).substr(2, 10)}`; } - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (name === 'disabled' || name === 'readOnly') { this.__toggleInvokerDisabled(); diff --git a/packages/input/src/LionInput.js b/packages/input/src/LionInput.js index d995769a9..5553f0de5 100644 --- a/packages/input/src/LionInput.js +++ b/packages/input/src/LionInput.js @@ -53,8 +53,8 @@ export class LionInput extends LionField { this.type = 'text'; } - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (name === 'readOnly') { this.__delegateReadOnly(); } diff --git a/packages/overlays/src/OverlayMixin.js b/packages/overlays/src/OverlayMixin.js index 5c687dd94..0a619bdb6 100644 --- a/packages/overlays/src/OverlayMixin.js +++ b/packages/overlays/src/OverlayMixin.js @@ -40,8 +40,8 @@ export const OverlayMixin = dedupeMixin( this.__config = value; } - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (name === 'opened') { this.dispatchEvent(new Event('opened-changed')); } diff --git a/packages/providence-analytics/package.json b/packages/providence-analytics/package.json index 313bdb2dd..ba4970ffa 100644 --- a/packages/providence-analytics/package.json +++ b/packages/providence-analytics/package.json @@ -45,7 +45,7 @@ "htm": "^3.0.3", "inquirer": "^7.0.0", "is-negated-glob": "^1.0.0", - "lit-element": "~2.3.0", + "lit-element": "~2.4.0", "ora": "^3.4.0", "parse5": "^5.1.1", "read-package-tree": "5.3.1", diff --git a/packages/providence-analytics/src/program/analyzers/find-classes.js b/packages/providence-analytics/src/program/analyzers/find-classes.js index 5314c5949..b331bbec1 100644 --- a/packages/providence-analytics/src/program/analyzers/find-classes.js +++ b/packages/providence-analytics/src/program/analyzers/find-classes.js @@ -56,7 +56,7 @@ async function findMembersPerAstEntry(ast, fullCurrentFilePath, projectPath) { // // Handle methods // const mBlacklistPlatform = ['constructor', 'connectedCallback', 'disconnectedCallback']; // const mBlacklistLitEl = [ - // '_requestUpdate', + // 'requestUpdateInternal', // 'createRenderRoot', // 'render', // 'updated', diff --git a/packages/providence-analytics/test-helpers/project-mocks-analyzer-outputs/find-classes.json b/packages/providence-analytics/test-helpers/project-mocks-analyzer-outputs/find-classes.json index 8a1d0e0da..859f2b420 100644 --- a/packages/providence-analytics/test-helpers/project-mocks-analyzer-outputs/find-classes.json +++ b/packages/providence-analytics/test-helpers/project-mocks-analyzer-outputs/find-classes.json @@ -179,7 +179,7 @@ "accessType": "public" }, { - "name": "_requestUpdate", + "name": "requestUpdateInternal", "accessType": "protected" }, { diff --git a/packages/providence-analytics/test-helpers/project-mocks/importing-target-project/target-src/match-subclasses/ExtendedComp.js b/packages/providence-analytics/test-helpers/project-mocks/importing-target-project/target-src/match-subclasses/ExtendedComp.js index d3986bc97..375eff707 100644 --- a/packages/providence-analytics/test-helpers/project-mocks/importing-target-project/target-src/match-subclasses/ExtendedComp.js +++ b/packages/providence-analytics/test-helpers/project-mocks/importing-target-project/target-src/match-subclasses/ExtendedComp.js @@ -30,7 +30,7 @@ export class ExtendedComp extends MyCompMixin(RefClass) { static get properties() {} static get styles() {} get updateComplete() {} - _requestUpdate() {} + requestUpdateInternal() {} createRenderRoot() {} render() {} updated() {} diff --git a/packages/providence-analytics/test-node/program/analyzers/find-classes.test.js b/packages/providence-analytics/test-node/program/analyzers/find-classes.test.js index f50ac9415..2b5ef919b 100644 --- a/packages/providence-analytics/test-node/program/analyzers/find-classes.test.js +++ b/packages/providence-analytics/test-node/program/analyzers/find-classes.test.js @@ -213,7 +213,7 @@ describe('Analyzer "find-classes"', () => { static get properties() {} static get styles() {} get updateComplete() {} - _requestUpdate() {} + requestUpdateInternal() {} createRenderRoot() {} render() {} updated() {} diff --git a/packages/select-rich/src/LionOption.js b/packages/select-rich/src/LionOption.js index 58809812f..7af128a70 100644 --- a/packages/select-rich/src/LionOption.js +++ b/packages/select-rich/src/LionOption.js @@ -57,8 +57,8 @@ export class LionOption extends DisabledMixin(ChoiceInputMixin(FormRegisteringMi this.__registerEventListeners(); } - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (name === 'active') { this.dispatchEvent(new Event('active-changed', { bubbles: true })); diff --git a/packages/select-rich/src/LionSelectRich.js b/packages/select-rich/src/LionSelectRich.js index b39341ae4..0557f374b 100644 --- a/packages/select-rich/src/LionSelectRich.js +++ b/packages/select-rich/src/LionSelectRich.js @@ -228,8 +228,8 @@ export class LionSelectRich extends ScopedElementsMixin( } } - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (name === 'interactionMode') { if (this.interactionMode === 'auto') { this.interactionMode = detectInteractionMode(); diff --git a/packages/switch/src/LionSwitchButton.js b/packages/switch/src/LionSwitchButton.js index 033aed84c..a51987a2f 100644 --- a/packages/switch/src/LionSwitchButton.js +++ b/packages/switch/src/LionSwitchButton.js @@ -124,8 +124,8 @@ export class LionSwitchButton extends DisabledWithTabIndexMixin(LitElement) { * * @override */ - _requestUpdate(name, oldValue) { - super._requestUpdate(name, oldValue); + requestUpdateInternal(name, oldValue) { + super.requestUpdateInternal(name, oldValue); if (this.isConnected && name === 'checked') { this.setAttribute('aria-checked', `${this.checked}`); } diff --git a/yarn.lock b/yarn.lock index abec5438f..29ed43917 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7413,7 +7413,7 @@ listr2@^2.1.0: rxjs "^6.6.2" through "^2.3.8" -lit-element@^2.2.1, lit-element@^2.3.1: +lit-element@^2.2.1, lit-element@^2.3.1, lit-element@~2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-2.4.0.tgz#b22607a037a8fc08f5a80736dddf7f3f5d401452" integrity sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg== @@ -7427,7 +7427,7 @@ lit-element@~2.3.0: dependencies: lit-html "^1.1.1" -lit-html@^1.0.0, lit-html@^1.1.1, lit-html@^1.2.1: +lit-html@^1.0.0, lit-html@^1.1.1, lit-html@^1.2.1, lit-html@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.3.0.tgz#c80f3cc5793a6dea6c07172be90a70ab20e56034" integrity sha512-0Q1bwmaFH9O14vycPHw8C/IeHMk/uSDldVLIefu/kfbTBGIc44KGH6A8p1bDfxUfHdc8q6Ct7kQklWoHgr4t1Q==