From fe0194097cd740d77ed2d72d06aaa7687953ffb3 Mon Sep 17 00:00:00 2001 From: Thijs Louisse Date: Wed, 30 Oct 2024 14:23:20 +0100 Subject: [PATCH] fix(ui): improve test experience in dev-mode --- .changeset/happy-ducks-wink.md | 5 +++++ packages/ui/components/calendar/src/LionCalendar.js | 6 ++++++ .../ui/components/core/src/DisabledWithTabIndexMixin.js | 7 +++++++ packages/ui/components/form-core/src/FormControlMixin.js | 6 ++++++ .../components/form-core/src/utils/SyncUpdatableMixin.js | 7 +++++++ packages/ui/components/icon/src/LionIcon.js | 6 ++++++ packages/ui/components/overlays/src/OverlayMixin.js | 7 +++++++ .../progress-indicator/src/LionProgressIndicator.js | 6 ++++++ packages/ui/components/steps/src/LionStep.js | 6 ++++++ packages/ui/components/steps/src/LionSteps.js | 6 ++++++ packages/ui/components/tabs/src/LionTabs.js | 6 ++++++ packages/ui/components/tooltip/src/LionTooltip.js | 6 ++++++ 12 files changed, 74 insertions(+) create mode 100644 .changeset/happy-ducks-wink.md diff --git a/.changeset/happy-ducks-wink.md b/.changeset/happy-ducks-wink.md new file mode 100644 index 0000000000..ab27a5b8ae --- /dev/null +++ b/.changeset/happy-ducks-wink.md @@ -0,0 +1,5 @@ +--- +'@lion/ui': patch +--- + +improve test experience in dev-mode by limiting verbose warnings diff --git a/packages/ui/components/calendar/src/LionCalendar.js b/packages/ui/components/calendar/src/LionCalendar.js index 885e6e7d9d..f8c80f2afd 100644 --- a/packages/ui/components/calendar/src/LionCalendar.js +++ b/packages/ui/components/calendar/src/LionCalendar.js @@ -369,6 +369,12 @@ export class LionCalendar extends LocalizeMixin(LitElement) { } } + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + /** * @private */ diff --git a/packages/ui/components/core/src/DisabledWithTabIndexMixin.js b/packages/ui/components/core/src/DisabledWithTabIndexMixin.js index 01e04ee6dd..81f4cc6d8c 100644 --- a/packages/ui/components/core/src/DisabledWithTabIndexMixin.js +++ b/packages/ui/components/core/src/DisabledWithTabIndexMixin.js @@ -49,6 +49,13 @@ const DisabledWithTabIndexMixinImplementation = superclass => } } + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + // @ts-expect-error + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + /** * @param {number} value * @private diff --git a/packages/ui/components/form-core/src/FormControlMixin.js b/packages/ui/components/form-core/src/FormControlMixin.js index fd232e82ee..93882ec24b 100644 --- a/packages/ui/components/form-core/src/FormControlMixin.js +++ b/packages/ui/components/form-core/src/FormControlMixin.js @@ -152,6 +152,12 @@ const FormControlMixinImplementation = superclass => return /** @type {LionValidationFeedback} */ (this.__getDirectSlotChild('feedback')); } + /** + * TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + constructor() { super(); diff --git a/packages/ui/components/form-core/src/utils/SyncUpdatableMixin.js b/packages/ui/components/form-core/src/utils/SyncUpdatableMixin.js index 4e0dd096f5..3e6db2ac7f 100644 --- a/packages/ui/components/form-core/src/utils/SyncUpdatableMixin.js +++ b/packages/ui/components/form-core/src/utils/SyncUpdatableMixin.js @@ -56,6 +56,13 @@ const SyncUpdatableMixinImplementation = superclass => this.__SyncUpdatableNamespace.connected = false; } + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + // @ts-expect-error + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + /** * Makes the propertyAccessor.`hasChanged` compatible in synchronous updates * @param {string} name diff --git a/packages/ui/components/icon/src/LionIcon.js b/packages/ui/components/icon/src/LionIcon.js index 2e9b8eddde..93f14bdcab 100644 --- a/packages/ui/components/icon/src/LionIcon.js +++ b/packages/ui/components/icon/src/LionIcon.js @@ -102,6 +102,12 @@ export class LionIcon extends LitElement { this.__svg = nothing; } + /** + * TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + /** @param {import('lit').PropertyValues} changedProperties */ update(changedProperties) { super.update(changedProperties); diff --git a/packages/ui/components/overlays/src/OverlayMixin.js b/packages/ui/components/overlays/src/OverlayMixin.js index 2676c757b6..9afaba49ef 100644 --- a/packages/ui/components/overlays/src/OverlayMixin.js +++ b/packages/ui/components/overlays/src/OverlayMixin.js @@ -189,6 +189,13 @@ export const OverlayMixinImplementation = superclass => } } + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + // @ts-expect-error + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + get _overlayInvokerNode() { return /** @type {HTMLElement | undefined} */ ( Array.from(this.children).find(child => child.slot === 'invoker') diff --git a/packages/ui/components/progress-indicator/src/LionProgressIndicator.js b/packages/ui/components/progress-indicator/src/LionProgressIndicator.js index 59349781ba..7929a562b9 100644 --- a/packages/ui/components/progress-indicator/src/LionProgressIndicator.js +++ b/packages/ui/components/progress-indicator/src/LionProgressIndicator.js @@ -93,6 +93,12 @@ export class LionProgressIndicator extends LocalizeMixin(LitElement) { return !this.hasAttribute('value'); } + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + /** * In case of a determinate progress-indicator it returns the progress percentage * based on value, min & max. diff --git a/packages/ui/components/steps/src/LionStep.js b/packages/ui/components/steps/src/LionStep.js index d05344adba..7b9dac04c1 100644 --- a/packages/ui/components/steps/src/LionStep.js +++ b/packages/ui/components/steps/src/LionStep.js @@ -115,4 +115,10 @@ export class LionStep extends LitElement { const result = this.condition(data); return this.invertCondition ? !result : result; } + + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; } diff --git a/packages/ui/components/steps/src/LionSteps.js b/packages/ui/components/steps/src/LionSteps.js index cdb49a3d17..bb8f86e4fe 100644 --- a/packages/ui/components/steps/src/LionSteps.js +++ b/packages/ui/components/steps/src/LionSteps.js @@ -108,6 +108,12 @@ export class LionSteps extends LitElement { ); } + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + /** * @param {number} newCurrent * @param {number} oldCurrent diff --git a/packages/ui/components/tabs/src/LionTabs.js b/packages/ui/components/tabs/src/LionTabs.js index 821c072b93..41b763995d 100644 --- a/packages/ui/components/tabs/src/LionTabs.js +++ b/packages/ui/components/tabs/src/LionTabs.js @@ -188,6 +188,12 @@ export class LionTabs extends LitElement { ); } + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + /** @private */ __setupSlots() { if (this.shadowRoot) { diff --git a/packages/ui/components/tooltip/src/LionTooltip.js b/packages/ui/components/tooltip/src/LionTooltip.js index 6106e3c786..738855716f 100644 --- a/packages/ui/components/tooltip/src/LionTooltip.js +++ b/packages/ui/components/tooltip/src/LionTooltip.js @@ -55,6 +55,12 @@ export class LionTooltip extends ArrowMixin(OverlayMixin(LitElement)) { this.invokerRelation = 'description'; } + /** + * // TODO: check if this is a false positive or if we can improve + * @configure ReactiveElement + */ + static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || []; + /** @protected */ // eslint-disable-next-line class-methods-use-this _defineOverlayConfig() {