Skip to content

Conversation

@heimwege
Copy link
Contributor

@heimwege heimwege commented Oct 27, 2025

  • default the flp.libs parameter of preview-middleware to true for edmx backends
  • override the flp.libs parameter of preview-middleware to false for cap
  • for compatibility reasons: enhance the serve-static-middleware to additionally serve paths that start with /resources w/o the /resources part (excluding /resources as standalone path) to ensure that the workaround to use servestatic on /resources/my/custom/lib because the flp.libs parameter was not known/used will still continue to work.

Sample: An existing path configuration /resources/my/custom/lib to serve a custom library locally w/o flp.libs true will have two servestatic paths.

  1. /resources/my/custom/lib <-- the existing one remains unchanged, but will no longer be used because
  2. /my/custom/lib <-- the new flp.libs default true will add the custom library and its respective ABAP backend url to the UI5 loader configuration; That's why we add this path configuration on-the-fly to ensure compatibility with the new flp.libs true default

Sample: An existing path configuration /resources will remain unchanged and still only has one servestatic path so that the whole UI5 framework can still be served locally

  1. /resources <-- the existing one remains unchanged, and will continue to work

@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2025

🦋 Changeset detected

Latest commit: cf88b83

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@sap-ux-private/preview-middleware-client Patch
@sap-ux/preview-middleware Patch
@sap-ux/serve-static-middleware Patch
@sap-ux/create Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@heimwege heimwege requested a review from devinea October 27, 2025 13:39
@heimwege heimwege added preview-middleware @sap-ux/preview-middleware preview-middleware-client serve-static-middleware @sap-ux/serve-static-middleware labels Oct 27, 2025
@heimwege heimwege changed the title WIP fix(preview-middleware): default flp.libs parameter to true fix(preview-middleware): default flp.libs parameter to true Oct 28, 2025
@heimwege heimwege marked this pull request as ready for review October 28, 2025 13:27
tobiasqueck
tobiasqueck previously approved these changes Oct 31, 2025
Copy link
Contributor

@tobiasqueck tobiasqueck left a comment

Choose a reason for hiding this comment

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

The PR contains quite a lot of changes but in the end you just set the default to true for edmx and added a workaround to the serve static middleware. The rest is code restructurings and cleanups, correct?
That mix made the review a little more time consuming but in the end, the code is now cleaner and better structured. The functional change is also a good idea and should have been done a long time ago (I missed it when creating the initial version of this code). The workaround in the serve static middleware will cause confusion in the future - I am sure of it - but I understand it is required to keep existing setups working as-is.

@heimwege
Copy link
Contributor Author

@tobiasqueck it also fixes an issue that the list of UI5 libs is not static but depending on the actual UI5 version. So we now load it from the UI5 version and only use a static list as fallback. Basically this fixes parts of #2683

devinea
devinea previously approved these changes Nov 4, 2025
Copy link
Member

@devinea devinea left a comment

Choose a reason for hiding this comment

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

Thanks @heimwege. Changes look good.
Haven't tested locally.
changeset ✅

…middleware/default-flp.libs-to-true-for-edmx-backends

# Conflicts:
#	packages/preview-middleware/README.md
@heimwege heimwege dismissed stale reviews from devinea and tobiasqueck via 36fab8b November 7, 2025 15:52
@sonarqubecloud
Copy link

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

Labels

preview-middleware @sap-ux/preview-middleware preview-middleware-client serve-static-middleware @sap-ux/serve-static-middleware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants