open-ux-tools
open-ux-tools copied to clipboard
TBI - Prepare preview middleware for UI5 2.0
Description (include screenshots)
Internal testing of the preview middleware with a preliminary version of UI5 2.0 has shown issues in the code. This ticket is to track (and solve) these issues.
Value
Getting the preview middleware ready for UI5 2.0.
Architecture Elaboration
All fixes are expected in the preview-middleware-client module
Notes
Tasks
- [x]
sap.ui.getCore().getConfiguration().getLanguage()needs to be replaced, with import("sap/base/i18n/Localization").getLanguage - [x]
sap.ushell.Containerneeds to be replaced withsap.ui.require(“sap/ushell/Container”) - [ ]
sap.ushell.Container.createRenderer()is also deprecated - however there is no production ready solution yet - [x]
sap.base.util.UriParametersneeds to be replaced withsap/base/util/UriParameters - [x] the
fiori-tools-proxymiddleware has an additional initialization routine to manage the app state which also needs to be reworked for 2.0 and in the same process should be moved into thepreview-middleware-client - [ ] preview middleware to be integration tested with UI5 2.0 once a stable URL is available
Small corrections to avoid misunderstandings:
sap.ui.getCore().getConfiguration().getLanguage()needs to be replaced withimport("sap/base/i18n/Localization").getLanguage- sap/base/util/UriParameters.fromQuery(...) needs to be replaced with the native new URLSearchParams(...)
For FLP Sandbox and UI5 2.0 we've discussed the following options:
- We explicitly expect the user to tell us
- We add a new config property to the preview-middleware of type boolean allowing to switch to the new sandbox
- We add a url parameter with the same effect
- We add a env variable with the same effect
- We add a handler for both urls to the preview-middleware and if either of them returns a 404, we just redirect to the other. Tricky part here: we don’t know if the preview middleware is executed before or after the ui5-proxy middleware (or any other that might be serving the sources)
- We create our own bootstrap script that checks the UI5 version and then depending on the result pick one or the other
The decision is to go for option 3.
Implementation details for option 3.:
- Create our own bootstrap.js
- If version >= 2 load new FLP bootstrap
- Else load old FLP bootstrap
- Point the flp.html to our own bootstrap
@tobiasqueck isn't the remaining open task sap.ushell.Container.createRenderer() solved as well (see here)? Or do we need a replacement also for 1.x?