ui5-tooling
ui5-tooling copied to clipboard
Detect preload format from minVersion in manifest.json (or version of sap.ui.core dependency)
Expected Behavior
Especially for applications the preload format should be detected from the minVersion property in the manifest.json. This ensures that even if newer versions for the dependencies (also most important the dependency to sap.ui.core) are used the Component-preload is created in the proper expected format. This is also how the Grunt tooling worked.
For libraries, being built today it should work when using the proper dependency to an older version of the sap.ui.core library.
Current Behavior
Today, the BundleBuilder (from LBT) decides depending on the existence of the ui5loader whether this should be a EVOBundleFormat (sap.ui.require.preload) or a UI5BundleFormat (jQuery.sap.registerPreloadedModules).
As soon as we support manifest-first for libraries the same like for components should also apply as the minVersion can then also be defined in the manifest.json. Today, the minVersion is derived from the sap.ui.core library dependency.
Context
- UI5 Module Version (output of
ui5 --versionwhen using the CLI):1.5.2 - Node.js Version:
not relevant - npm Version:
not relevant - OS/Platform:
not relevant
Affected components (if known)
- [X] ui5-builder
- [ ] ui5-server
- [ ] ui5-cli
- [ ] ui5-fs
- [ ] ui5-project
- [ ] ui5-logger
With what UI5 version do you encounter this issue? To my knowledge, there's no supported version that is old enough to support the new tooling but has no ui5loader.
I rather would consider to remove the current decision and always opt for the new bundling.
But you're right, this should be combined with a check of the UI5 version and the tooling should not run against a too old version.
The "problem" is that you can build your application project without having a npm dependency to the sap.ui.core library. So you can perfectly use the tooling to build your app (no self-contained) to be used with an older UI5 version. And IMO this is a valid use case. In this case we use the old bundle format, which is good as it will also work when running the app with older UI5 releases.
I think we should check for the application's "minUI5Version". If that's not available, use the new format and log an error/warning. But that wouldn't be compatible with existing scenarios I guess. So maybe fallback to the old format and switch to the new with 2.0 of our CLI/Tooling.