F20 System Wide Change: Web Assets

Jaroslav Reznik jreznik at redhat.com
Tue Jul 16 10:54:48 UTC 2013


= Proposed System Wide Change: Web Assets =
https://fedoraproject.org/wiki/Changes/Web_Assets

Change owner(s): T.C. Hollingsworth <tchollingsworth at gmail.com>

Traditionally, Fedora has been pushing bits from its various servers to 
people's browsers in an ad-hoc fashion, and issues surrounding JavaScript have 
been swept under the rug. This change proposal provides a simple framework for 
shipping static web content and a way forward to treat JavaScript more closely 
to other code in the distribution. 

== Detailed description ==
A standard directory (/usr/share/assets) for static bits that are intended to 
be delivered to web browsers, such as CSS Frameworks, UI libraries, etc. will 
be introduced. HTTP daemons in the distribution should make this directory 
available publicly as /assets.

Additionally, a standard directory (/usr/share/javascript) for JavaScript 
code, which may be used in browsers or server-side by applications such as 
nodejs or rubygem-execjs will also be introduced.

Finally, new packaging guidelines [1] will provide instructions for making 
proper use of these new directories. 

== Scope ==
=== The web-assets RPM ===

A web-assets package will be introduced.  A preliminary SRPM is available 
here. [2]

The web-assets-filesystem subpackage will be provided, which contains the 
following directories:

* /usr/share/assets
* /usr/share/javascript

Additionally the following symlinks will be provided:

* /usr/share/javascript -> /usr/share/assets/javascript
* /usr/share/fonts -> /usr/share/assets/fonts (so any Fedora font package can 
be used as a web font)

A web-assets-devel subpackage will be provided that provides macros like 
%{_assetdir} and other conveniences described in the proposed guidelines.

A web-assets-httpd package will make the web assets directory available at 
http://server/assets/.

=== redhat-rpm-config ===

We can trivially [3] automatically version the virtual Provides required by 
the static inclusion section [4] of the new guidelines, but the macro would 
need to live in redhat-rpm-config to work right in koji without conditional 
inclusion, which results in terrible syntax like %{?js_includes: %js_includes 
foopackage} due to RPM's restrictions regarding macros that accept arguments.

=== httpd ===

httpd may want to add Requires: web-assets-httpd (or ship the configuration 
itself, though it was suggested that it would be better seperate [5]) to make 
the assets directory available unconditionally by default.  This will simplify 
packaging.  (We really would prefer that JavaScript libraries not depend on 
httpd, as they could be used by Node.js or Ruby.)

=== JavaScript packagers ===

Some longstanding reviews (like jquery) can now be completed with clear 
guidelines, paving the way for web applications to start being migrating to 
using proper dependencies instead of bundling.

All web applications currently in the distribution should be examined for 
bundled JavaScript, which should be packaged separately.

=== Web application packagers ===

Web applications can migrate to new JavaScript/Web Asset packages as they 
become available.

There are a lot of potentially affected packages.  There's no hope of fixing 
them all in one release cycle, and even the dependency chain for jQuery, a big 
ticket package, could take several months to get reviewed and imported.  
Therefore, this Change proposal just seeks FESCo/FPC approval for a start to 
unravelling this madness. This will be a long transition, and will probably 
make the systemd transition look like a day in the park.

=== Foreign languages ===

Many foreign languages support JavaScript, like Ruby via rubygem-execjs or 
Java via rhino.  Several of them already depend on existing JavaScript library 
packages (virtually all node.js-related ones) and will need to be modified to 
conform to the new locations specified by the guidelines.

=== Node.js ===

Several node packages ship JavaScript for the browser and will need to be 
modified to conform to the new guidelines.

=== FPC ===

The Fedora Packaging Committee will need to consider and approve drafts 
pertaining to Web Assets [6] and JavaScript [7].

=== FPC/FESCo ===

FPC/FESCo may or may not want to consider a firm date for sunsetting the 
bundled JavaScript exception and requiring all new packages to meet the new 
guidelines.

[1] https://fedoraproject.org/wiki/User:Patches/PackagingDrafts/Web_Assets
[2] http://patches.fedorapeople.org/web-assets/web-assets-1-1.fc19.src.rpm
[3] https://gist.github.com/tchollingsworth/6007074#file-macros-web-assets-L4-L13
[4] User:Patches/PackagingDrafts/Web_Assets##Static_Inclusion_of_Libraries
[5] https://lists.fedoraproject.org/pipermail/packaging/2013-July/009313.html
[6] User:Patches/PackagingDrafts/Web Assets
[7] User:Patches/PackagingDrafts/JavaScript

_______________________________________________
devel-announce mailing list
devel-announce at lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel-announce


More information about the devel mailing list