SAP / open-ux-tools

Enable community collaboration to jointly promote and facilitate best in class tooling capabilities
Apache License 2.0
83 stars 33 forks source link

BUG - App local previews fail with reuse libs added from annotation #2133

Open korotkovao opened 1 month ago

korotkovao commented 1 month ago

Related Feature

1924

Description

The library is only available in an abap backend, but if you use ui5-local you run everything offline. So, it can never find the lib. You cannot add - name: sap.nw.core.gbt.notes.lib.reuse to the ui5-local yaml. If you remove it, then your app should start and run without the reuse component being loaded. You would still see in the browser log a 404 when trying to load it but FEv4 should handle it

Steps to Reproduce

Steps to reproduce the behavior:

  1. Use https://github.tools.sap/ux/open-ux-tools-playground/tree/main/apps/fe.v4.lrop.note app
  2. Use YI3_TEST and service SB_NTE_DEMO_TP_OD_V4_UI > SD_NTE_DEMO_TP (0001) - OData V4
  3. Use example (mocked) metadata for testing: metadata.xml.zip.
  4. See failure to load local preview

Expected results

No failures during the previews.

Actual results

Previews with start, start-mock and start-variants-management are good, but previews with npm run start-local, npm run int-test and npm run start-noflp fail

Screenshots

If applicable, add screenshots to help explain the problem.

Version/Components/Environment

Add any other context about the problem here OS:

Root Cause Analysis

Problem

{describe the problem}

Fix

{describe the fix}

Why was it missed

{Some explanation why this issue might have been missed during normal development/testing cycle}

How can we avoid this

{if we don’t want to see this type of issues anymore what we should do to prevent}

tobiasqueck commented 1 month ago

@korotkovao. I looked at your PR #2134 again and the implementation feels wrong - not incorrect but just not the way it should be. So, I thought about it a little longer and realized what caused the feeling: the name is wrong. While the notes library is an SAP S/4 reuse library, from an application writer perspective, that term is meaningless. These libs are actually customLibs i.e. libs that the app needs that are not part of the UI5 distribution. We don’t know anything about custom libs except their id e.g. we don’t know how and when to load them, therefore, the customLibs should never be part of the ui5Libs array and should never be added to the flpSandbox-preload or to any ui5*.yaml.

So, I’ recommend to simplify the implementation in #2134: