OpenUI5 can either be loaded locally with a relative path from a Web server or externally from a Content Delivery Network (CDN).
Note:
Loading OpenUI5 from a CDN improves your app performance: You can load from a server that (in most cases) is much closer to your location, and you can benefit from the caching mechanism and the language fallback logic.
Caution:
To ensure outdated versions don’t pose a potential security risk, OpenUI5 versions are removed from the OpenUI5 CDN one year after their end of maintenance. Also, patches of versions in maintenance which are older than one year will be removed. For more information, see this blog post. The end dates for the cloud provisioning of OpenUI5 versions and patches can be found at https://sdk.openui5.org/versionoverview.html
To avoid disruptions, you must keep your OpenUI5 version up to date. We recommend using the UI5 Renovate Preset Config tool, which allows you to become aware of version changes and upgrade OpenUI5 in a controlled manner.
The specific version allows you to select a particular fixed version for bootstrapping. You can refer to a specific version by using a versioned URL as in the following example:
<script id="sap-ui-bootstrap"
src="https://sdk.openui5.org/1.141.0/resources/sap-ui-core.js"
data-sap-ui-async="true"
data-...="...">
</script>
The first segment of the URL after the host name is used to specify a concrete version, which needs to be provided in the following form: <majorVersion>.<minorVersion>.<patchNumber>
. For more information, see Versioning and Maintenance of OpenUI5.
Check the available versions with the respective maintenance status at https://sdk.openui5.org/versionoverview.html.
Note:
Only use the Stable version for productive apps. Nevertheless, if you also want to test the Nightly version, you are very welcome to send us your feedback!
The evergreen version allows you to automatically select the latest available patch level of a specific (minor) long-term maintenance version for bootstrapping. You refer to a particular <majorVersion>.<minorVersion>
long-term maintenance version using a versioned URL as in the following example:
<head>
<!-- ... -->
<script id="sap-ui-bootstrap"
src="https://sdk.openui5.org/1.136/resources/sap-ui-core.js"
data-sap-ui-async="true"
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
data-sap-ui-resource-roots='{ "my.app": "./" }'
data-sap-ui-compat-version="edge">
</script>
</head>
<body id="content" class="sapUiBody">
<div data-sap-ui-component
data-id="myComponentContainer"
data-name="my.app"
data-height="100%"
data-settings='{ "id": "myComponent" }'
data-...="...">
</div>
</body>
The first segment of the URL after the host name is used to specify an evergreen version, which needs to be provided in the following version number combination: <majorVersion>.<minorVersion>
without a patch number. For more information, see Versioning and Maintenance of OpenUI5. All long-term maintenance versions >= 1.71 can be used as evergreen versions to bootstrap OpenUI5 applications. You can find the available versions with long-term maintenance status at https://sdk.openui5.org/versionoverview.html.
When using the patch-level independent bootstrap you must use data-sap-ui-async="true"
and the data-sap-ui-on-init
callback. Ideally, you refer to a module, for example sap/ui/core/ComponentSupport
to bootstrap your Component; see Declarative API for Initial Components. You can also refer to a custom module.
Note:
Evergreen versions only support asynchronous bootstrapping. Therefore, the
data-sap-ui-async
bootstrap attribute must be set totrue
.A consequence of asynchronous bootstrapping is that
sap-ui-debug=true
does not work when you bootstrap an evergreen version. You need to explicitly include the namespace of the modules you want to see the debug sources for, for example by specifyingsap-ui-debug=sap/
to include thesap/*
namespace, orsap-ui-debug=sap/,xyz/app/
to include more than one namespace. For more information, see the blog post SAPUI5 – Patch-Level Independent Bootstrap.
The default version of our libraries has the generic URL https://sdk.openui5.org/resources/sap-ui-core.js
(OpenUI5).
Caution:
The default version is constantly being upgraded and this might have an impact on the stability of your application. The caching behavior of the default version URL is often not stable either. Do not use this version in any real productive or testing environment.
If you’ve been bootstrapping with the default version to keep your OpenUI5 version current, we strongly recommend switching to the UI5 Renovate Preset Config instead. This allows you to become aware of version changes and upgrade OpenUI5 in a controlled manner. In this way, upgrading becomes the informed and active decision of the developer, whereas bootstrapping with the default version might leave you unaware of version changes and the OpenUI5 version used by your app. This could hamper the speedy resolution of issues arising from such automatic version changes.
The cache control is different for dynamic and static resources. If you refer to the latest maintenance version (dynamic), you have a maximum cache age of one week, if you refer to a specific (static) version, you have a maximum cache age of 10 years. In both cases, cross-origin resource sharing (CORS) headers are set, so that you can consume resources from the central location without any proxy in between.
You can use a cache buster mechanism for OpenUI5, which enables the browser to refresh OpenUI5 resources that have been changed instead of fetching them from the browser cache. For more information, see Cache Buster for OpenUI5.
<script id="sap-ui-bootstrap"
src="https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js"
data-sap-ui-async="true"
data-...="...">
</script>
Note:
The Cache Buster is only needed if you consume OpenUI5 without a concrete version in the URL. When you consume OpenUI5 with the concrete version in the URL, this is not needed, as the content served by that unique URLs will never change and can be cached forever.
Related Information
Multi-Version Availability of SAPUI5
Set Up a CDN for SAPUI5 on Your On-Premise SAP ABAP Server