Your web-browser is very outdated, and as such, this website may not display properly. Please consider upgrading to a modern, faster and more secure browser. Click here to do so.
There are lots of cool new features in this release, as well as many critical bug fixes.
Full list of changes:
{%- and -%} to strip whitespace before/after the block.for loops implement Python-style array unpacking. This is a really nice feature which lets you do this:{% for x, y, z in [[2, 2, 2], [3, 3, 3]] %}
--{{ x }} {{ y }} {{ z }}--
{% endfor %}
The above would output: --2 2 2----3 3 3--for and it will destructure each array in the list to the variables.{% for k, v in { b: 2, a: 1 } %}
--{{ k }}: {{ v }}--
{% endfor %}
Output: --b: 2----a: 1--(note: the order could actually be anything because it uses javascript’s `for k in obj` syntax to iterate, and ordering depends on the js implementation)
{% for k, v in { b: 2, a: 1} | dictsort %}
--{{ k }}: {{ v }}--
{% endfor %}
Output: --a: 1----b: 2--{% raw %} blocksuper()
The biggest change in v0.1.7 comes from devoidfury (thanks!) which implements consistent and helpful error messages. The errors are still simply raw text, and not pretty HTML, but they at least contain all the necessary information to track down an error, such as template names, line and column numbers, and the inheritance stack. So if an error happens in a child template, it will print out all the templates that it inherits. In the future, we will most likely display the actual line causing an error.
Full list of changes:
{% include templateNames['foo'] %}, whereas previously you could only give it a simply variable name.app.locals is fixed with express 2.5this. Version 0.1.6 broke this and this was referencing the global scope.../../crazyPrivateFile.txtYou can view all the code changes here. Please file an issue if something breaks!
This is mostly a bugfix release, but there are a few small tweaks based on feedback:
{{ foo }}, {{ foo.bar }}, {{ foo.bar.baz }} all output nothing if foo is undefined. Previously only the first form would be suppressed, and a cryptic error thrown for the latter 2 references. Note: I believe this is a departure from jinja, which throws errors when referencing undefined objects. I feel that this is a good and non-breaking addition though. (thanks to devoidfury)set where you couldn’t not reference other variables is fixed (thanks chriso and panta)You can view all the code changes here. As always, file an issue if something breaks!
v0.1.5 has been pushed to npm, and it’s a big one. Please file any issues you find, and I’ll fix them as soon as possible!
I’m watching this release carefully because of the large amount of code that has changed, so please file an issue if you have a problem with it.