8
votes

I have an application that uses SAPUI5. I have extensively styled the result using my own CSS, which greatly enhances the appearance and usability of the application.

A few weeks ago a new release of the SAPUI5 libs was released to the

https://sapui5.hana.ondemand.com/resources/sap-ui-core.js

address (and the AU and US servers too). This new release changed some of the rendering of buttons. This broke some of my CSS. (it also fixed a bunch of other issues, but unfortunately the broken CSS was far more obvious.)

Is there a way to request a certain version of UI5 when requesting from the SAP maintained libraries? Or is the only solution to copy the library and host it myself (and refer to the hosted version in my application?)

It seems unfortunate if the second option is my only real choice, as this would mean I'm not going to benefit from other applications having loaded UI5 libs into cache. Given how long it can take to load UI5 libs, this is a great shame.

I also note that jQuery themselves make it very clear that you should never refer to the latest version of their lib in your productive code:

http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/

"So let’s be clear: Don’t use jquery-latest.js on a production site."

I think the same should/could be true about UI5 - please tell me it is? Or if it isn't that this is planned?

Thanks!

N.B. I'm referring here to the libs maintained on the HCP servers - https://sapui5.hana.ondemand.com, https://sapui5.ap1.hana.ondemand.com and https://sapui5.us1.hana.ondemand.com not any locally maintained SAP servers.

3
+1, never thought about this, but valid question (probably even more valid for OpenUI5). Would be great if this were possible! But that would also imply the SDK docs would be available for older versions, so I don't get my hopes too high...Qualiture

3 Answers

5
votes

And it has finally come to pass:

https://help.hana.ondemand.com/help/frameset.htm?2d3eb2f322ea4a82983c1c62a33ec4ae.html

You can use SAPUI5 in any HTML page from SAP HANA Cloud Platform with the following bootstrap script:

<script id="sap-ui-bootstrap" type="text/javascript" src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.m"></script>

If you want to make sure that you refer to a stable version of SAPUI5, you can use a versioned URL as in the example below:

<script id="sap-ui-bootstrap" type="text/javascript" src="https://sapui5.hana.ondemand.com/1.28.8/resources/sap-ui-core.js" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.m"></script>

The first segment of the URL after the host name is used to specify a concrete SAPUI5 version.

This is great news and will finally mean I can stop storing all my UI5 libs as part of my projects and hopefully users may have them cached. Now just to hope that these versioned libs are on a CDN :)

4
votes

currently there is indeed only the latest release available online.

It would probably make sense to change this and offer the latest patch of the previous release. Only the current release is supplied with patches, though, and we do want people to upgrade in order to get the fixes. We wouldn't like 1.12 or so to still be available now, but when we offer a specific URL for this release, this would mean that we'd just delete it one day, which would break apps much more...

Another approach would be to provide the NEXT version in advance, so developers who use the online version can test BEFORE we upgrade the main URL. What do you think about this option?

By the way: this online version of UI5 isn't necessarily the most optimized option, depending on the user's location and we don't give any uptime guarantee, so when you use it, you might want to add some fallback logic (e.g. check initially whether window.sap is defined, and if not, get UI5 from your own server.

Regards Andreas

0
votes

On your SAP system you will not only find the latest UI5 version installed but also several older versions. This page shows all installed versions: http://<host>:<port>/sap/public/bc/ui5_ui5.

Use a dedicated version like this:

<script 
        id="sap-ui-bootstrap"            
        src="resources/1.20/sap-ui-core.js" 
        data-sap-ui-libs="sap.ui.commons"
        data-sap-ui-theme="sap_bluecrystal" >
</script>

That might be interesting, too: http://help.sap.com/saphelp_nw74/helpdata/de/9f/eb96da02c2429bb1afcf6534d77c79/content.htm?frameset=/de/58/e82251e8242514e10000000a44176d/frameset.htm