-
Notifications
You must be signed in to change notification settings - Fork 278
feat(framework): detect dynamically loaded OpenUI5 #12235
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
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.
Co-authored-by: Copilot <[email protected]>
OpenUI5Support
allows OpenUI5 to be loaded secondBackground
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
andpatchPatcher
are not called on dynamically loaded OpenUI5 instancesF6Navigation
don't work as expected if OpenUI5 is loaded secondImprovements
onInit
hook is usedpatchPopup
andpatchPatcher
are executed a.s.a.p. after OpenUI5 is loaded so that any popups open from OpenUI5 will not glitch