Diff for "JavaScriptBuildSystem"

Not logged in - Log In / Register

Differences between revisions 9 and 10
Revision 9 as of 2010-05-18 18:43:31
Size: 1259
Editor: mars
Comment:
Revision 10 as of 2011-02-22 13:29:36
Size: 1807
Editor: bac
Comment:
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:
== Adding a third-party widget ==

The current story for adding a third-party widget is to put it in `lib/lp/contrib`. (You can read the mailing list [[https://lists.launchpad.net/launchpad-dev/msg06474.html|discussion]] about the adoption of this location.)

For CSS, follow the rules above to modify the tools. If other assets are needed, you'll need to create a link in `lib/canonical/launchpad/icing` to the proper place in `lib/lp/contrib` so the assets can be found. See `lib/canonical/launchpad/icing/yui3-gallery` for an example.

The Launchpad JavaScript Build System

Most of the Launchpad JavaScript is bundled, minified, and distributed in one large stand-alone file: launchpad.js.

Adding new JavaScript modules

To add a new JavaScript module simply add a new <script> line to lib/lp/app/templates/base-layout-macros.pt in the large <devmode> JavaScript block. The file you add to the list will be automatically included in the launchpad.js roll-up and used by both the test runner and the LP production site.

Two special scripts, utilities/yui_deps.py and utilities/lp-deps.py, look in lib/lp/app/templates/base-layout-macros.pt for <script> lines. The corresponding minified script files (the version of the file ending with "-min.js") will be added to launchpad.js.

After making your changes you will probably want to run:

$ make clean_js && make jsbuild

Adding a new CSS file

Launchpad combines and minifies all of its CSS files into 'combo.css' before publishing them. You can add a new CSS file to the list by editing buildout-templates/bin/combine-css.in

After making your changes you will probably want to run:

$ make css_combine

Adding a third-party widget

The current story for adding a third-party widget is to put it in lib/lp/contrib. (You can read the mailing list discussion about the adoption of this location.)

For CSS, follow the rules above to modify the tools. If other assets are needed, you'll need to create a link in lib/canonical/launchpad/icing to the proper place in lib/lp/contrib so the assets can be found. See lib/canonical/launchpad/icing/yui3-gallery for an example.


CategoryJavaScript

JavaScriptBuildSystem (last edited 2020-10-27 10:23:00 by twom)