From 9f7095d50a4124c9ebba119729f579fb059ce295 Mon Sep 17 00:00:00 2001 From: Vladislav Tasev Date: Thu, 17 Oct 2024 14:32:19 +0300 Subject: [PATCH 1/3] fix: boot sequence --- packages/base/src/UI5Element.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/base/src/UI5Element.ts b/packages/base/src/UI5Element.ts index cf411638023f..55e613e0c0ff 100644 --- a/packages/base/src/UI5Element.ts +++ b/packages/base/src/UI5Element.ts @@ -1271,12 +1271,14 @@ abstract class UI5Element extends HTMLElement { * @public */ static define(): typeof UI5Element { - this.definePromise = Promise.all([ - this.fetchI18nBundles(), - this.fetchCLDR(), - boot(), - this.onDefine(), - ]).then(result => { + const defineSequence = async () => { + await boot(); + const result = await Promise.all([ + this.fetchI18nBundles(), + this.fetchCLDR(), + boot(), + this.onDefine(), + ]); const [i18nBundles] = result; Object.entries(this.getMetadata().getI18n()).forEach((pair, index) => { const propertyName = pair[0]; @@ -1284,7 +1286,8 @@ abstract class UI5Element extends HTMLElement { (targetClass as Record)[propertyName] = i18nBundles[index]; }); this.asyncFinished = true; - }); + }; + this.definePromise = defineSequence(); const tag = this.getMetadata().getTag(); From e31e7f46b670b8ccaf9a865293c9edfd26a8883f Mon Sep 17 00:00:00 2001 From: Vladislav Tasev Date: Thu, 17 Oct 2024 14:35:57 +0300 Subject: [PATCH 2/3] chore: fix --- packages/base/src/UI5Element.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/base/src/UI5Element.ts b/packages/base/src/UI5Element.ts index 55e613e0c0ff..2fc73e3c6c08 100644 --- a/packages/base/src/UI5Element.ts +++ b/packages/base/src/UI5Element.ts @@ -1276,7 +1276,6 @@ abstract class UI5Element extends HTMLElement { const result = await Promise.all([ this.fetchI18nBundles(), this.fetchCLDR(), - boot(), this.onDefine(), ]); const [i18nBundles] = result; From db89312dd41616ba127b43a22684721a3765b790 Mon Sep 17 00:00:00 2001 From: Vladislav Tasev Date: Thu, 17 Oct 2024 14:40:30 +0300 Subject: [PATCH 3/3] chore: fix --- packages/base/src/UI5Element.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/base/src/UI5Element.ts b/packages/base/src/UI5Element.ts index 2fc73e3c6c08..14d4a7dbf3d1 100644 --- a/packages/base/src/UI5Element.ts +++ b/packages/base/src/UI5Element.ts @@ -1272,9 +1272,9 @@ abstract class UI5Element extends HTMLElement { */ static define(): typeof UI5Element { const defineSequence = async () => { - await boot(); + await boot(); // boot must finish first, because it initializes configuration const result = await Promise.all([ - this.fetchI18nBundles(), + this.fetchI18nBundles(), // uses configuration this.fetchCLDR(), this.onDefine(), ]);