Skip to content

Commit 0a4758b

Browse files
authored
chore: show a deprecation warning for old tags (#3088)
1 parent 684ccbf commit 0a4758b

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

packages/base/hash.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
EpEv8ewlNPY90ULIm8etkaS9plo=
1+
WeIr8BhWti5PEgIpG30j/drpLD4=

packages/base/src/UI5Element.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,9 @@ class UI5Element extends HTMLElement {
999999

10001000
if (altTag && !customElements.get(altTag)) {
10011001
registerTag(altTag);
1002-
window.customElements.define(altTag, getClassCopy(this));
1002+
window.customElements.define(altTag, getClassCopy(this, () => {
1003+
console.log(`The ${altTag} tag is deprecated and will be removed in the next release, please use ${tag} instead.`); // eslint-disable-line
1004+
}));
10031005
}
10041006
}
10051007
return this;
+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
const getClassCopy = klass => {
2-
return class classCopy extends klass {};
1+
const getClassCopy = (klass, constructorCallback) => {
2+
return class classCopy extends klass {
3+
constructor() {
4+
super();
5+
constructorCallback && constructorCallback();
6+
}
7+
};
38
};
49

510
export default getClassCopy;

0 commit comments

Comments
 (0)