Jinja 1.1 in Feature Freeze
I now pushed Jinja 1.1 into feature freeze. The trunk is now only used to improve stability, write some more unittests and fix spelling mistakes and stuff like that in the documentation. You can expect a release in about one week.
The changelog so far is huge and the items here are only a very, very short summary with the most important things.
The probably biggest change is the support for {{ super() }}. It works like {{ block.super }} in django, just that it’s a lot more flexible because you can use it like any other function. So you can apply filters on it, put it into a variable, pass it around etc. The whole block system is not a lot more complex in the background, you can render all parents and because of that we also reworked the way Jinja stores debug information. It’s now not a requirement any more to have the sourcecode of the template — the bytecode knows about the debug infos.
We also improved the debugging messages and added support for brace balancing. Now you can set the delimiters of the blocks to ${ and } and still use dict literals in it. You can also have the same delimiters for blocks and variables now, similar to smarty. Other synax improvements: You can now use parentheses for macro definitions: {% macro foo(bar, baz %} instead of {% macro foo bar, baz %} which is a lot easier to read if the editor doesn’t highlight the function name.
Strings without unicode characters are now stored as bytestrings. While this is a bit slower than unicode everywhere it allows to use datetime.strptime and friends which only accept bytestrings. On the other hand an optional C implementation of the context baseclass was added. Variable lookups in the Jinja context are now a lot faster if installed with this module.
A bunch of bugs were also fixed, especially regarding old-style classes and invalid signatures for exceptions. Also the CachedLoader mixing works now for both memory and disk caching which just partially worked in the 1.0 release version.
Last but not least: A new {% call %} tag is available that allows to pass executable template code to a macro. It works exactly like Ruby blocks, just for Jinja templates :-)
If you want to upgrade to the development version to help fixing the latest bugs etc. consider deleting the cache files of your templates first if you have the disk cache enabled.
You can find other changes in the changelog, it’s quite long :-)
Update: here the results from the bigtable benchmark:
Django Templates 415.52 ms Jinja Templates 142.40 ms Kid Templates 1202.83 ms Genshi Templates 635.37 ms Cheetah Templates 56.52 ms Mako Templates 50.09 ms
Great, keep on the good work ;)
I see you don’t get much comments but I guess hits and downloads speak for themselves. Cheers.
Comment by Wok — Monday, December 10th, 2007 @ 5:58 amWell, sorry for commenting about something outdated :-| Didn’t see the announcement for the 1.2 (truth to be told, I didn’t read the date of this entry either). I’m going to comment on the newer entry, please delete these two comments. Please excuse my enthusiasm to comment here :)
Comment by Wok — Monday, December 10th, 2007 @ 6:43 am