Overview
The download builder is currently written in PHP and tied to the web interface from http://jqueryui.com/download. The new download builder should be written in Node as a module that is not tied to any specific interface. The download builder web interface will be responsible for tying in to the module and handling the HTTP requests.
Requirements
The builder will receive a version number, a set of components, and theme settings. These input parameters will be used to generate a zip containing source and minified files, as well as a theme. The structure of the zip is detailed in the Directory Structure section; theme information is detailed in the ThemeRoller section. Each version may have different components and different dependencies. The builder should support an unlimited number of versions, though the web interface will only support two versions.
Many components have dependencies. The builder must handle dependency resolution to find all components for the final build. For example, if the user requests only the dialog component, the generated zip must contain ui-core, widget, position, and dialog. Details on resolving dependencies can be found in the Dependency Management section.
The builder should track statistics on what is being built and how often builds occur. Details on specific statistics can be found in the Statistics/Tracking section.
The builder should be written in a modular way so that it can be leveraged by our release scripts and replace the existing ant build. See the Replace Ant Build section for more details.
Files should be cached in order to decrease build times and processor usage. However, the caching system should be smart enough to not completely fill up the disk if thousands of build variations are generated. Some suggested caches are individual minified files and full pre-built themes. It should be possible to clear all cached files for a given version, so that we can easily remove unnecessary files when releasing a new version.
We currently average about 10,000 downloads per day. We should look into how many requests we're getting during our peak download times and ensure the new builder can handle the load without a problem.
Directory Structure
(comments relate to the line item directly above them)
zip
|-- index.html
| # custom file based on selected components
|-- development-bundle
| | # filtered files from jquery-ui
| |-- AUTHORS.txt
| |-- GPL-LICENSE.txt
| |-- MIT-LICENSE.txt
| |-- jquery-x.y.z.js
| |-- version.txt
| |-- demos
| | | # directories are based on selected components
| | |-- demos.css
| | | # direct copy from jquery-ui/demos/index.html
| | |-- index.html
| | | # direct copy from jquery-ui/demos/index.html
| | | # should eventually be custom based on selected components
| | |-- dialog
| | | # direct copy from jquery-ui/demos/dialog/
| | |-- position
| | | # direct copy from jquery-ui/demos/position/
| | `-- images
| | # direct copy from jquery-ui/demos/images/
| |-- docs
| | | # files are based on selected components
| | | # currently a dump from http://docs.jquery.com/UI/<plugin>
| | | # will eventually live in a repo for http://api.jqueryui.com
| | |-- dialog.html
| | `-- position.html
| |-- external
| | | # direct copy from jquery-ui/external
| | |-- jquery.bgiframe-2.1.2.js
| | |-- jquery.cookie.js
| | |-- jquery.metadata.js
| | |-- qunit.css
| | `-- qunit.js
| |-- themes
| | |-- base
| | | # source theme files
| | | # files are based on selected components
| | | # see theme details
| | `-- custom-theme
| | # custom theme files
| | # files are based on selected components
| | # see theme details
| `-- ui
| | # files are based on selected components
| |-- jquery-ui-x.y.z.custom.js
| | # concated source files
| |-- jquery.ui.core.js
| |-- jquery.ui.dialog.js
| |-- jquery.ui.position.js
| |-- jquery.ui.widget.js
| `-- minified
| |-- jquery.ui.core.min.js
| |-- jquery.ui.dialog.min.js
| |-- jquery.ui.position.min.js
| `-- jquery.ui.widget.min.js
|-- js
| |-- jquery.x.y.z.min.js
| `-- jquery-ui-x.y.z.min.js
`-- css
`-- custom-theme
# custom theme files
# files are based on selected components
# see theme details
Dependency Management
Each plugin will have a package.json file in order to support the upcoming plugins site. These files will be used to track dependencies. However, since the builder should be self-contained, it will need to do its own parsing of the files and dependency resolution. The builder will only need to implement rudimentary dependency resolution since all files will already be available locally, and they will all be valid versions. If a plugin relies on an external plugin, the external plugin will be available in the external directory within the jquery-ui repo.
jQuery Plugins proposed package.json format: https://github.com/jquery/plugins.jquery.com/blob/master/docs/package.md
Statistics/Tracking
The builder should capture useful statistics, such as:
- start/stop times for each build
- selected components for each build
- theme settings for each build (possibly limited to just pre-built theme selection)
Reports and graphs based on the statistics would be useful but are outside the scope of the rewrite. We should simply have the data available for reports and graphs to be generated at a later time.
ThemeRoller
...
Replace Ant Build
There is an ant build that is used during releases that includes much of the same functionality as the download builder. This should be replaced with a Node script that hooks into the same code used for the download builder. Its fine if the new script does not exactly reflect the results of the current Ant-based build, as long as it is consistent with the Download Builder results.
Current ant build: https://github.com/jquery/jquery-ui/blob/master/build/build.xml
Issues with existing download builder in Trac: http://bugs.jqueryui.com/report/10?P=downloadbuilder
Comments (1)
Scott González said
at 10:08 am on Mar 2, 2012
Download Builder (and ThemeRoller) should probably persist user choices. We'll need to figure out a good way to know when to override past choices and for which fields (for example, if the user selects 5 widgets from the latest version, but then a new version comes out, we should select those same five widgets from the new version instead of the old version).
You don't have permission to comment on this page.