[openstack-dev] [horizon] static files handling, bower/
Radomir Dopieralski
openstack at sheep.art.pl
Thu Jan 15 11:20:07 UTC 2015
On 14/01/15 23:05, david.comay at oracle.com wrote:
> I'm not particularly well-versed in the Horizon build process so
> perhaps I'm way off base. But given that a distribution's Horizon build
> package embeds various JavaScript libraries to be used by the browser,
> how those libraries are obtained during the build process is an
> interesting build detail. I thought the intent of the XStatic work was
> to provide Python wrappers around the various JavaScript libraries so
> they could be pulled down via pip. Since there's already a Python
> requirements.txt file for versioning information, that seemed to be a
> nice way of indicating which versions of the JavaScript libraries could
> be used by Horizon and Python was used all the way through the build.
>
> I realize that it takes work to build the XStatic packages but given
> the Python packages are basically wrappers, it seems creating those and
> uploading them to pypi could be automated by using Bower and setup.py
> but perhaps translating the metadata isn't straightforward.
This has actually been discussed. The problem is, that it adds
considerable complexity and some amount of work, while solves exactly
zero problems. You are just sweeping the node.js dependency under the
rug, because now, instead of being a direct dependency (for development)
of Horizon, it becomes a dependency (for building) of a package that
Horizon is dependent on. That doesn't solve anything, since all
distributions insist on building their own packages from sources, not
relying on pre-built binaries.
So what we settled on is a compromise. Horizon will not care *how* the
static files got there. Whether you put them there by hand, use Bower,
or install your distribution's packages -- Horizon doesn't care. And
neither do the tests written for Horizon, or the build scripts. They
just assume the files are where you configured them. Period. Let me
repeat that:
***You will not need Node.js or Bower to build and test Horizon.***
The packagers for different distributions will want to make packages for
the JavaScript and CSS libraries on their own anyways, and they will
want to test Horizon with those -- not with what Bower installs.
The only place where you will need Bower (but only for convenience, as
you may as well install everything manually or with your own scripts) is
the development machine. For convenience, we will keep the list of
dependencies in a format compatible with Bower -- but it's a simple JSON
file that can be read by any other tool or script, written in any language.
I hope that clears it.
--
Radomir Dopieralski
More information about the OpenStack-dev
mailing list