Opened 12 years ago
Last modified 3 years ago
#10672 new enhancement
Automatically minify Javascript and CSS — at Initial Version
Reported by: | Peter Suter | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | next-dev-1.7.x |
Component: | general | Version: | |
Severity: | normal | Keywords: | javascript css performance |
Cc: | Ryan J Ollos, leho@…, olemis+trac@…, felix.schwarz@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
As discussed previously it might be a good idea to introduce a minification step that pre-processes the JavaScript and CSS files stored in source control.
This would allow developing with clean, well-commented source files while improving performance. We could then switch our JavaScript coding style to 4 spaces indentation and add copyright and documentation comments to file headers.
The step / a related step could do JSLint checking.
How should this be implemented?
- One suggestion was a
make minify
step. - Another idea would be to add it to
setup.py
. minify or distwebres provide setuptools commands (both use YUI compressor, which requires Java) - Alternatively, we could hook it into
trac-admin deploy
somehow. - Or the web frontend could dynamically minify and cache and combine just the files required for a request into one file. (Including scripts by plugins.)
An important requirement might be to keep this step optional.