#357 Improve asset management
Closed: Fixed None Opened 12 years ago by tflink.

= problem =

The CSS and js used in the blocker tracking app are not minified, leading to extra bandwidth consumption and potentially slower page load times.

= analysis =

The CSS and js used should be minified.

= enhancement recommendation =

The quick n' dirty way to fix this would be to just update the versions in git to be minified but this is not necessarialy the best solution.

Another option would be to start using the [https://pypi.python.org/pypi/Flask-Assets Flask-Assets] extension which minifies js and css the first time that a template is rendered with the given libraries.


when I install a package built for el6 and try to run sync, I get a traceback:

{{{
[root@blockerbugspackagetest ~]# blockerbugs sync
Traceback (most recent call last):
File "/usr/bin/blockerbugs", line 9, in <module>
load_entry_point('blockerbugs==0.3.0.5', 'console_scripts', 'blockerbugs')()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
return ep.load()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/lib/python2.6/site-packages/blockerbugs/init.py", line 4, in <module>
from flask.ext.assets import Environment
File "/usr/lib/python2.6/site-packages/flask_assets.py", line 5, in <module>
from webassets.env import (\
ImportError: No module named webassets.env
}}}

There are licence issues with python-jsmin, moving to Undetermined Future until it is resolved.

uglifyjs is a good alternative for JS minification. In Beaker we're using uglifyjs and ycssmin (with webassets), that setup works well.

Replying to [comment:5 dcallagh]:

uglifyjs is a good alternative for JS minification. In Beaker we're using uglifyjs and ycssmin (with webassets), that setup works well.

Thanks for the suggestion!

Fixed in [https://git.fedorahosted.org/cgit/blockerbugs.git/commit/?h=develop&id=4c8905932d1511e88febb8e0faa2af1d4d20db17 4c8905932d1511e88febb8e0faa2af1d4d20db17] and [https://git.fedorahosted.org/cgit/blockerbugs.git/commit/?h=develop&id=dd6baff75945a69d77be7ef690c5ab97f5da5757 dd6baff75945a69d77be7ef690c5ab97f5da5757]

Log in to comment on this ticket.

Metadata