When upgrading from an older version, you might encounter some backwards incompatibility. The webassets API is not stable yet.
Some filters now run in debug mode. Specifically, there are two things that deserve mention:
cssrewrite now runs when debug="merge". This is always what is wanted; it was essentially a bug that this didn’t happen before.
All kinds of compiler-style filters (Sass, less, Coffeescript, JST templates etc). all now run in debug mode. The presence of such a filter causes bundles to be merged even while debug=True.
In practice, if you’ve been using custom bundle debug values to get such compilers to run, this will continue to work. Though it can now be simplified. Code like this:
Bundle(
Bundle('*.coffee', filters='coffeescript', debug=False)
filters='jsmin')
can be replaced with:
Bundle('*.coffee', filters='coffeescript,jsmin')
which has the same effect, which is that during debugging, Coffeescript will be compiled, but not minimized. This also allows you to define bundles that use compilers from within the templates tags, because nesting is no longer necessary.
However, if you need to combine Coffeescript files (or other files needing compiling) with regular CSS or JS files, nesting is still required:
Bundle('*.js'
Bundle('*.coffee', filters='coffeescript'),
filters='jsmin')
If for some reason you do not want these compilers to run, you may still use a manual debug value to override the behavior. A case where this is useful is the less filter, which can be compiled in the browser:
Bundle('*.less', filters='less', debug=True)
Here, as long as the environment is in debug mode, the bundle will output the source urls, despite the less filter normally forcing a merge.
As part of this new feature, the handling of nested bundle debug values has changed such that in rare cases you may see a different outcome. In the unlikely case that you are using these a lot, the rule is simple: The debug level can only ever be decreased. Child bundles cannot cannot do “more debugging” than their parent, and if Environment.debug=False, all bundle debug values are effectively ignored.
The internal class names of filters have been renamed. For example, JSMinFilter is now simply JSMin. This only affects you if you reference these classes directly, rather than using their id (such as jsmin), which should be rare.
There are some significant backwards incompatible changes in this release.
Other changes:
The semantics of the ASSETS_DEBUG setting have changed. In 0.1, setting this to True meant enable the django-assets debugging mode. However, django-assets now follows the default Django DEBUG setting, and ASSETS_DEBUG should be understood as meaning how to behave when in debug mode. See ASSETS_DEBUG for more information.
ASSETS_AUTO_CREATE now causes an error to be thrown if due it it being disabled a file cannot be created. Previously, it caused the source files to be linked directly (as if debug mode were active).
This was done due to Explicit is better than implicit, and for security considerations; people might trusting their comments to be removed. If it turns out to be necessary, the functionality to fall back to source could be added again in a future version through a separate setting.
The YUI Javascript filter can no longer be referenced via yui. Instead, you need to explicitly specify which filter you want to use, yui_js or yui_css.