Skip to content
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

fix: boot sequence #10042

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions packages/base/src/UI5Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1271,20 +1271,22 @@ 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(); // boot must finish first, because it initializes configuration
const result = await Promise.all([
this.fetchI18nBundles(), // uses configuration
this.fetchCLDR(),
this.onDefine(),
]);
const [i18nBundles] = result;
Object.entries(this.getMetadata().getI18n()).forEach((pair, index) => {
const propertyName = pair[0];
const targetClass = pair[1].target;
(targetClass as Record<string, any>)[propertyName] = i18nBundles[index];
});
this.asyncFinished = true;
});
};
this.definePromise = defineSequence();

const tag = this.getMetadata().getTag();

Expand Down