askama v0.8.0 Release Notes

Release Date: 2019-02-20 // 10 months ago
  • 🚀 After 3 months of development, I'm happy to announce the availability of version 0.8 of Askama, the type-safe, compiled Jinja-like template engine for Rust -- all the more so because it has taken me way too long to push out this release due to an exceedingly busy period in my personal life.

    🐎 Askama 0.8 is up to 2 times as fast as 0.7.2, thanks to performance improvements contributed by @botika and @yossyJ. For comparisons to other template engines, please look at the template benchmarks repo. The largest feature this time around is the newly added support for pluggable escape engines and formats. By adding just a few lines to the askama.toml configuration file and writing a simple implementation of the Escaper trait, Askama can use custom code for escaping, such as for different formats (LateX or shell) or with even more optimized performance (using SIMD).

    ⬆️ Upgrade notes:

    • 🏗 The use of build scripts is no longer needed and has been deprecated (#199, thanks to @de-vri-es)
    • ⬆️ Upgraded the Rocket integration to Rocket 0.4
    • Template::extension() is now a static method (#127, thanks to @ubnt-intrepid)
    • 🗄 Use of the _parent field is now deprecated (thanks to @botika)

    Other changes:

    • ⬆️ Upgraded the Rocket integration to Rocket 0.4
    • ➕ Added optional support for Gotham integration (#177, thanks to @rakenodiax)
    • ➕ Added an into_response() method for actix-web users (#205, thanks to @ZizhengTai )
    • ➕ Add support for tuple destructuring in let and for blocks (#187, thanks to @yossyJ)
    • ➕ Added optional yaml filter (#192)
    • ➕ Added an indent filter (#131, thanks to @casey)
    • ➕ Added isize and f64 filters (#146, thanks to @tizgafa)
    • ➕ Added a filesizeformat filter (#161, thanks to @tizgafa)
    • ➕ Added support for the loop.last variable (#194, thanks to @yossyJ)
    • 👍 Allow matching enum struct variants (#182, thanks to @mcarton)
    • 👍 Allow templates to work without importing Template directly (#147, thanks to @ubnt-intrepid)
    • 👍 Allow referencing self in expressions (#207)
    • 🛠 Fixed problems with unescaped expressions (#107 and #132)
    • 🛠 Fixed off-by-one error in escaping function (#138, thanks to @benjunmun)
    • Send debug output to stderr instead of stdout
    • Document assignment using {% let %} blocks

Previous changes from v0.7.2

  • 🚀 After two months, I'm happy to announce the 0.7.2 release of Askama, the type-safe, compiled Jinja-like template engine for Rust! Despite the small version number increase (because this release should be fully backwards compatible with earlier 0.7 releases), there's a good amount of feature in this release. Happily, I can say that for the first time, all of the improvements in this release are due to @botika spending a lot of time on improving Askama over the past months, for which I owe them many thanks! Let's dive in:

    • 📚 Custom syntax support: in response to a bug reporter who wanted to generate LaTeX with Askama (#121), it is now possible to use custom block delimiters in your Askama templates. Read the documentation for more information on how to define and use custom syntaxes. Thanks to @botika for spending a lot of time on getting this just right.
    • ➕ Added a number of built-in filters: abs, capitalize, center and wordcount
    • 🛠 Fixed support for range-based for-loops (#117) by specializing the code generator
    • 🛠 Fixed operator precedence issues with loop attributes (like index)
    • 🛠 Fixed a number of edge cases in macro scope resolution