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

Radomir Dopieralski openstack at sheep.art.pl
Mon Nov 17 10:54:01 UTC 2014


On 17/11/14 09:53, Martin Geisler wrote:

[...]

> As Richard said, npm and bower are not competitors. You use npm to
> install bower, and you use bower to download Angular, jQuery, Bootstrap
> and other static files. These are the static files that you will want to
> include when you finally deploy the web app to your server.
> 
> Before using Bower, people would simply download Angular from the
> projects homepage and check it into version control. Bower is not doing
> much, but using it avoids this bad practice.
> 
> There is often a kind of "compilation step" between bower downloading a
> dependency and the deployment on the webserver: minification and
> compression of the JavaScript and CSS. Concatenating and minifying the
> files serve to reduce the number of HTTP requests -- which can make an
> app much faster.
> 
> Finally, you use Grunt/Gulp to execute other tools during development.
> These tools could be a local web server, it could be running the unit
> tests. Grunt is only a convenience tool here -- think of it as a kind of
> Makefile that tells you how to lunch various tasks.

Thank you for your explanations.

The way I see it, we would need:
- Bower in the development environment,
- Grunt both in the development environment and packaged (to run tests,
etc.),
- Bower configuration file in two copies, one for global-requirements,
and one for the Horizon's local requirements. Plus a gate job that makes
sure no new library or version gets included in the Horizon's before
getting into the global-requirements,
- A tool, probably a script, that would help packaging the Bower
packages into DEB/RPM packages. I suspect the Debian/Fedora packagers
already have a semi-automatic solution for that.
- A script that would generate a file with all the paths to those
packaged libraries, that would get included in Horizon's settings.py

What do you think?
-- 
Radomir Dopieralski



More information about the OpenStack-dev mailing list