ui5-tooling icon indicating copy to clipboard operation
ui5-tooling copied to clipboard

Files imported by UniversalDate missing from self-contained build output

Open jbragiel opened this issue 6 years ago • 8 comments

Expected Behavior

There are no missing JavaScript files in sap-ui-custom.js used by an application.

Current Behavior

sap/ui/core/date/(Buddhist|Gregorian|Islamic|Japanese|Persian).js is not being included.

Steps to reproduce the issue

  1. Take a look at the sap/ui/core/date/UniversalDate.js source from the openui5 repo: https://github.com/SAP/openui5/blob/6478939c8d4a89b3197647d6bcb99e3cb54f3047/src/sap.ui.core/src/sap/ui/core/date/UniversalDate.js#L90

  2. There is a sap.ui.requireSync call on line 90 that loads a computed filepath: sap.ui.requireSync("sap/ui/core/date/" + sCalendarType)

  3. Due to the dynamic nature of this import, the build of sap-ui-custom.js won't include any of the possible files. I'm not sure if a fix would go into the build tools or into the SDK source code...

Context

  • UI5 Module Version (output of ui5 --version when using the CLI): 1.5.2 (from C:\dev\master\htmlcommons-samples\openui-microbump\node_modules\@ui5\cli\bin\ui5.js)
  • Node.js Version: v8.11.1
  • npm Version: 6.9.0
  • OS/Platform: Windows 10 1809
  • Browser (if relevant): N/A
  • Other information: N/A

Affected components (if known)

Log Output / Stack Trace

N/A

jbragiel avatar Jul 10 '19 20:07 jbragiel

Due to this issue, the ui5 bootstrap will currently fail if the project has been build as self-contained, but does not include all project dependencies.

ui5 build self-contained

BenReim avatar Dec 23 '22 08:12 BenReim

The problematic dynamic require in sap.ui.core has since moved to https://github.com/SAP/openui5/blob/c1b7517b7857b58879c3e3473bbaeced10ea55a2/src/sap.ui.core/src/sap/ui/core/date/_Calendars.js#L18

RandomByte avatar Dec 23 '22 09:12 RandomByte

Build with --include-all-dependencies solved the issue for me with UI5 tooling v3.

BohanLiu avatar Jul 16 '23 01:07 BohanLiu

Build with --include-all-dependencies solved the issue for me with UI5 tooling v3.

Do you mean that it now bundles the files, or that the app still works because the single files are loaded successfully? I don't see from the code how the bundling part would work now, even with v3.

matz3 avatar Jul 17 '23 06:07 matz3

Build with --include-all-dependencies solved the issue for me with UI5 tooling v3.

Do you mean that it now bundles the files, or that the app still works because the single files are loaded successfully? I don't see from the code how the bundling part would work now, even with v3.

I didn't check the build content after I checked the application can run successfully... It actually packaged everything and I ended up with a nearly 300 MB web app with all the lib files that I did not need. The --include-all-dependencies doesn't really help.

BohanLiu avatar Oct 04 '23 23:10 BohanLiu