Files imported by UniversalDate missing from self-contained build output
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
-
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
-
There is a sap.ui.requireSync call on line 90 that loads a computed filepath:
sap.ui.requireSync("sap/ui/core/date/" + sCalendarType) -
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 --versionwhen 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)
- [X] ui5-builder
- [ ] ui5-server
- [ ] ui5-cli
- [ ] ui5-fs
- [ ] ui5-project
- [ ] ui5-logger
Log Output / Stack Trace
N/A
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
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
Build with --include-all-dependencies solved the issue for me with UI5 tooling v3.
Build with
--include-all-dependenciessolved 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.
Build with
--include-all-dependenciessolved 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.