Skip to content
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

BUG - preview middleware uses fixed list of ui5 libs although the list is version dependent #2683

Open
3 tasks
heimwege opened this issue Dec 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@heimwege
Copy link
Contributor

Description

preview-middleware uses a list) of UI5 libs. That list seems to be UI5 version specific (compare 1.120.24 to latest). So it needs to be adjusted to a more dynamic list.

More Details see https://github.com/SAP/open-ux-tools/pull/2613/files#r1872645371

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected results

Actual results

Screenshots

If applicable, add screenshots to help explain the problem.

Version/Components/Environment

Add any other context about the problem here
OS:

  • Mac OS
  • Windows
  • Other

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}

@devinea
Copy link
Member

devinea commented Dec 18, 2024

@heimwege Looking at this again I think we we can use ui5Json.libraries.map(lib => lib.name) to replace the static list of namespaces (which was a short cut to knowing the library names in the first place)

from https://ui5.sap.com/resources/sap-ui-version.json
returns
['sap.ui.core', 'sap.apf', 'sap.ca.scfld.md', 'sap.ca.ui', 'sap.cards.ap.common', 'sap.cards.ap.generator', 'sap.cards.ap.transpiler', 'sap.chart', 'sap.collaboration', 'sap.cux.home', 'sap.esh.search.ui', 'sap.f', 'sap.fe.base', 'sap.fe.controls', 'sap.fe.core', 'sap.fe.ina', 'sap.fe.macros', 'sap.fe.navigation', 'sap.fe.placeholder', 'sap.fe.plugins.managecache', 'sap.fe.templates', 'sap.fe.test', 'sap.fe.tools', 'sap.feedback.ui', 'sap.fiori', 'sap.gantt', 'sap.insights', 'sap.m', 'sap.makit', 'sap.me', 'sap.ndc', 'sap.ovp', 'sap.rules.ui', 'sap.sac.df', 'sap.suite.ui.commons', 'sap.suite.ui.generic.template', 'sap.suite.ui.microchart', 'sap.tnt', 'sap.ui.codeeditor', 'sap.ui.commons', 'sap.ui.comp', 'sap.ui.demoapps', 'sap.ui.documentation', 'sap.ui.dt', 'sap.ui.export', 'sap.ui.fl', 'sap.ui.generic.app', 'sap.ui.generic.template', 'sap.ui.integration', 'sap.ui.layout', 'sap.ui.mdc', 'sap.ui.richtexteditor', 'sap.ui.rta', 'sap.ui.server.abap', 'sap.ui.server.java', 'sap.ui.suite', 'sap.ui.support', 'sap.ui.table', 'sap.ui.testrecorder', 'sap.ui.unified', 'sap.ui.ux3', 'sap.ui.vbm', 'sap.ui.vk', 'sap.ui.vtm', 'sap.ui.webc.common', 'sap.ui.webc.fiori', 'sap.ui.webc.main', 'sap.uiext.inbox', 'sap.ushell', 'sap.ushell_abap', 'sap.uxap', 'sap.viz', 'sap.webanalytics.core', 'sap.zen.commons', 'sap.zen.crosstab', 'sap.zen.dsh', 'themelib_sap_belize', 'themelib_sap_bluecrystal', 'themelib_sap_fiori_3', 'themelib_sap_horizon']

http://localhost:8080/resources/sap-ui-version.json ( via npm run start-local )
returns
'sap.cards.ap.common', 'sap.cards.ap.transpiler', 'sap.chart', 'sap.collaboration', 'sap.esh.search.ui', 'sap.f', 'sap.fe.base', 'sap.fe.controls', 'sap.fe.navigation', 'sap.fe.placeholder', 'sap.insights', 'sap.m', 'sap.ovp', 'sap.suite.ui.commons', 'sap.suite.ui.generic.template', 'sap.suite.ui.microchart', 'sap.ui.commons', 'sap.ui.comp', 'sap.ui.core', 'sap.ui.dt', 'sap.ui.export', 'sap.ui.fl', 'sap.ui.generic.app', 'sap.ui.integration', 'sap.ui.layout', 'sap.ui.mdc', 'sap.ui.richtexteditor', 'sap.ui.rta', 'sap.ui.table', 'sap.ui.unified', 'sap.ui.ux3', 'sap.ui.vbm', 'sap.ui.vk', 'sap.ushell', 'sap.uxap', 'sap.viz'

@heimwege
Copy link
Contributor Author

@devinea I had a similar idea but then wasn't sure because currently the static list contains e.g. sap.ui whereas the list of libs from sap-ui-version.json contains sap.ui.core, sap.ui.mdc, sap.ui.vk, sap.ui.rta, ... So I thought we might have to reduce that list to a SET only containing the first level of the lib name (sap.x) instead of the full name (sap.x.y) or something. So I procrastinated 🙈
But if we can use it as is that would be even better.

I recently included a function to fetch the ui5Version from sap-ui-version.json when refactoring the way we preview apps using UI5 2.x. So we just need to enhance that one to be able to either read the UI5 version or get the list of all libs or something. Shouldn't be a big deal 🤞🏻

@devinea
Copy link
Member

devinea commented Dec 19, 2024

I recently encountered an internal ui5 library matching the a namespace in the static list but not part of standard UI5 delivered libraries. So I think better to move away from namespaces to use the full lib names instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants