[openstack-dev] [horizon] xstatic for removing bundled js libs

Maxime Vidori maxime.vidori at enovance.com
Wed Mar 26 10:43:42 UTC 2014


Hi Radomir,

I quickly looked at xstatic and I have the impression that you have to handle manually the retrievement of the javascript library files and the version of the scripts. What do you think of wrapping bower in a script in order to dynamically generate packages with the right versions? 

----- Original Message -----
From: "Radomir Dopieralski" <openstack at sheep.art.pl>
To: "OpenStack Development Mailing List (not for usage questions)" <openstack-dev at lists.openstack.org>
Sent: Wednesday, March 26, 2014 9:25:26 AM
Subject: [openstack-dev] [horizon] xstatic for removing bundled js libs

Hello,

Before we split Horizon into two parts, we need to deal with a couple of
related cleanup tasks. One of them is getting rid of the bundled
JavaScript libraries that we are using. They are currently just included
in the Horizon's source tree. Ideally, we would like to have them
installed as dependencies. There is a blueprint for that at:

https://blueprints.launchpad.net/horizon/+spec/remove-javascript-bundling

We have several options for actually doing this. One of them is
selecting an appropriate django-* library, where available, and using
whatever additional API and code the author of the library made
available. We need to choose carefully, and every library has to be
approached separately for this.

I propose a more general solution of using xstatic-* Python packages,
which contain basically just the files that we want to bundle, plus some
small amount of metadata. All of the JavaScript (and any static files,
really, including styles, fonts and icons) would be then handled the
same way, by just adding the relevant package to the requirements and to
the settings.py file. Packaging the libraries that are missing is very
easy (as there is no extra code to write), and we get to share the
effort with other projects that use xstatic.

Anyways, I made a proof of concept patch that demonstrates this approach
for the jQuery library. Obviously it fails Jenkins tests, as the xstatic
and xstatic-jquery packages are not included in the global requirements,
but it shows how little effort is involved. You can see the patch at:

https://review.openstack.org/#/c/82516/

Any feedback and suggestions appreciated.
-- 
Radomir Dopieralski

_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list