Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 

Moving from Bower to npm


About four years ago we released the OpenUI5 sources to GitHub. Shortly after that, we also made the OpenUI5 libraries available for consumption with the Bower Package Manager (Blog Post).

Since then a lot has changed. Bower has been deprecated and npm (and yarn) became the de-facto standard for dependency management in the world of JavaScript. Not only for Node.js projects, but also for the web.

To keep up with this development, we made all OpenUI5 libraries available on the public npm registry in June of 2018. So far npm counted more than 10.000 downloads of the UI5 Core-library.

Check out the official OpenUI5 demo apps for examples that already make use of the new npm packages. Also various community projects surrounding the UI5Lab are currently working on or have already transitioned from Bower to npm. For example @StErMi's openui5-qrcode.

Therefore we have decided to discontinue Bower releases for UI5 1.60 and beyond.
All lower releases will still receive patches for as long as they are in maintenance (see OpenUI5 Versions Maintenance Status).

Migrating to npm


The npm packages differ from the Bower packages in terms of directory structure and content. This is mainly motivated by being able to provide a better integration with both, npm and the UI5 Build and Development Tooling.

The Bower packages had been aligned with the OpenUI5 download package. While the npm packages are in the same structure as the OpenUI5 sources on GitHub. This means that you can easily link your dependencies locally, which drastically improves the development experience when working across multiple projects.

Another important change is that there are no pre-built files like library-preload.js, library.css or an optimized version of the sap-ui-core.js.
That's because with the UI5 Build and Development Tooling there are now several options for building and optimizing UI5 sources along with your application. In many cases, the pre-built files might not even be required.

The libraries test-directories (representing their "test-resources") are also not included. They are not required for most UI5 projects and would increase package size by up to 80%.

We would like to hear your feedback on this change. Please let us known what you think in the #tooling channel of the OpenUI5 Community Slack or on Twitter.

Also See: