[openstack-dev] [Horizon] the future of angularjs development in Horizon

Radomir Dopieralski openstack at sheep.art.pl
Thu Nov 13 12:58:52 UTC 2014

On 13/11/14 01:32, Richard Jones wrote:

> We're currently using xstatic and that works with Linux packaging
> because it was designed to cope with being a global installation. The
> current Horizon codebase has a django-xstatic plugin which further makes
> dealing with xstatic components nicer - for example it handles path
> management and static file compilation (JS minification and
> concatenation, for example). That's really nice, but poses some problems:
> - we would need to xstatic-ify (and deb/rpm-ify) all those components

Yes. They will need to be deb/rpm/arch/slack/whatever-ified anyways,
because that's how the Linux distributions that are going to ship them work.

> - we could run into global version conflict issues if we run more than
> one service on a system - is this likely to be an issue in practise though?

Yes, this is an issue in practice, and that's why the packagers have a
say in what libraries and in what versions you are adding to the
global-requirements. We have to use versions that are the least problematic.

> - as far as I'm aware, the xstatic JS minification is not angular-aware,
> and will break angular code that has not been written to be
> dumb-minifier-aware (the angular minifier "ngMin" is written in node and
> knows how to do things more correctly); adding dumb-minifier-awareness
> to angular code makes it ugly and more error-prone :/

You can use any minifier with the django-compress plugin that Horizon
uses (django-xstatic has nothing to do with it). You just define the
command (or a filter written in Python) to use for every mime type.

But I assume that ngMin is written in the Node.js language (which is
superficially similar to JavaScript) and therefore if we used it, you
would have to convince your fellow system administrators to install
node.js on their production servers. Violence may result.

Radomir Dopieralski

More information about the OpenStack-dev mailing list