Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

JST debug behavior is broken #102

sean-lynch opened this Issue Feb 10, 2012 · 1 comment


None yet
2 participants

Debug = True or Debug = 'merge' breaks the applications that depend on JST to compile their templates. The JST filter should be run regardless of the value of the debug flag as simply merging the unprocessed HTML files into a single file doesn't make those templates retrievable by Javascript.

For an trivial example, see: https://github.com/sean-lynch/flask-assets-issues/blob/master/1/webassets-test.py - If you uncomment either of the debug flags, the resulting file is simply merged HTML, and not a JST object.

The work around is set the debug flag on any bundle that uses JST to false, but as far as I can tell, that needs to be done in code as a hack when setting up the environment. See: https://github.com/holdenmatt/webapp-boilerplate/blob/master/server/app.py


miracle2k commented Feb 10, 2012

This is a problem also with css and js compiler filters. The original design intention was to use the debug flag with nested bundles:


This does't work when defining bundles in templates, and it does't work when using things like the YAMLLoader, since nesting bundles isn't supported there.

I do intend to find a better solution. You may want to look at (and subscribe to) #12 and #60, which both touch on this.

#12 would introduce JSBundle/CSSBundle classes, which would solve the problem by constructing the correct nested Bundle structure internally.

#60 would approach this more directly by allowing filters to specify when they run.

@miracle2k miracle2k closed this Feb 10, 2012

@miracle2k miracle2k added a commit that referenced this issue May 13, 2012

@miracle2k miracle2k Limited ability for filters to run in debug mode.
Filters can now declare that they need to run in 'merge' mode (cssrewrite),
or that they need to run always (compiler-type filters).

In the latter case, if such a filter is used, the bundle will automatically be
merged. This is a more limited change than it sounds - still, see the section
on backwards-incompatibilities in the docs for more info.

Closes #60, and solves the requests in #73, #102 and possibly others.
Some relation to #120.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment