Skip to content

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Sep 1, 2025

OpenUI5Support allows OpenUI5 to be loaded second

Background

Until now, the assumption was always that OpenUI5 will be loaded in advance, so if it is not detected, UI5 Web Components will never check for it later

Issues

  • patchPopup and patchPatcher are not called on dynamically loaded OpenUI5 instances
  • features such as F6Navigation don't work as expected if OpenUI5 is loaded second
  • changing the theme for OpenUI5 does not reflect in UI5 Web Components

Improvements

  • the OpenUI5 onInit hook is used
  • patchPopup and patchPatcher are executed a.s.a.p. after OpenUI5 is loaded so that any popups open from OpenUI5 will not glitch
  • the configuration is not synchronized: when OpenUI5 loads first (classic scenario) UI5 Web Components take its configuration and use it, however if UI5 Web Components is loaded first, and only then OpenUI5, it is up to the app to initialize OpenUI5 with the same settings as UI5 Web Components for consistency.
  • if the theme is changed after OpenUI5 is loaded, the "OpenUI5 CSS Variables" detection will now succeed and UI5 Web Components will delete the adopted stylesheet and let OpenUI5 provide variables
  • after OpenUI5 is loaded, it takes over once again responsibility for setting the theme and UI5 Web Components will listen for the OpenUI5 theme change event. Same for F6Navigation.

Copy link

cla-assistant bot commented Sep 9, 2025

CLA assistant check
All committers have signed the CLA.

@vladitasev vladitasev requested a review from Copilot September 16, 2025 12:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables UI5 Web Components to detect and integrate with dynamically loaded OpenUI5 instances, addressing scenarios where OpenUI5 is loaded after UI5 Web Components initialization.

Key changes:

  • Implements dynamic OpenUI5 detection using the onInit hook mechanism
  • Introduces a secondary boot process to re-run initialization when OpenUI5 loads later
  • Adds proper cleanup and re-initialization of F6Navigation feature

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/main/test/pages/Openui5.delayed.html Test page demonstrating delayed OpenUI5 loading scenario
packages/base/src/features/OpenUI5Support.ts Core logic for detecting and integrating with dynamically loaded OpenUI5
packages/base/src/features/F6Navigation.ts Added destroy method for proper cleanup when OpenUI5 takes over
packages/base/src/Boot.ts Refactored boot process to support secondary initialization

@@ -81,6 +101,12 @@ const boot = async (): Promise<void> => {
return bootPromise;
};

const secondaryBoot = async (): Promise<void> => {
await boot(); // make sure we're not in the middle of boot before re-running the skipped parts
Copy link
Preview

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The secondaryBoot function calls boot() which may perform unnecessary work if already completed. Consider checking isBooted() first or restructuring to only re-run the OpenUI5-specific parts.

Suggested change
await boot(); // make sure we're not in the middle of boot before re-running the skipped parts
if (!isBooted()) {
await boot(); // make sure we're not in the middle of boot before re-running the skipped parts
}

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant