open-ux-tools icon indicating copy to clipboard operation
open-ux-tools copied to clipboard

TBI - Prepare preview middleware for UI5 2.0

Open tobiasqueck opened this issue 1 year ago • 4 comments

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.Container needs to be replaced with sap.ui.require(“sap/ushell/Container”)
  • [ ] sap.ushell.Container.createRenderer() is also deprecated - however there is no production ready solution yet
  • [x] sap.base.util.UriParameters needs to be replaced with sap/base/util/UriParameters
  • [x] the fiori-tools-proxy middleware 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 the preview-middleware-client
  • [ ] preview middleware to be integration tested with UI5 2.0 once a stable URL is available

tobiasqueck avatar Feb 21 '24 07:02 tobiasqueck

Small corrections to avoid misunderstandings:

codeworrior avatar Feb 21 '24 07:02 codeworrior

For FLP Sandbox and UI5 2.0 we've discussed the following options:

  1. 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
  2. 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)
  3. 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.

zdravko-georgiev avatar May 27 '24 10:05 zdravko-georgiev

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

schreckstefan avatar Jul 08 '24 14:07 schreckstefan

@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?

heimwege avatar Sep 24 '24 07:09 heimwege