Release Notes
This release adds output spans and memory limits through fuel, and fixes many
differences to Jinja2 in both Rust and Go. Fuel now also accounts for memory and
work done in filters and operators, so templates consume more fuel than before and
fuel budgets might need adjusting. In Go, maps created by templates now keep the
type of their keys and their insertion order; Value.Raw returns a *value.Map
for them and Value.AsMap returns a copy with keys converted to strings.
- Fuel now also limits memory and the work done inside filters and operators, not just the number of instructions. Templates consume somewhat more fuel than before, so budgets might need adjusting. #483
- Added
State::consume_fuelin Rust andState.ConsumeFuelin Go so that custom filters and functions can charge fuel. #483 - Added
Template::render_with_spansin Rust andTemplate.RenderWithSpansin Go to map rendered output back to the template source. #1004 - Added the
countargument to thereplacefilter for Jinja2 compatibility in Rust. #1013 - The datetime filters in
minijinja-contribnow fall back to jiff's bundled time zone database for names missing from the system database. #1008 - Fixed booleans sorting separately from numbers. They now compare, sort and hash like
0and1in Rust and Go. - Fixed
maxandgroupbyreturning the last of multiple equal items instead of the first for Jinja2 compatibility in Rust and Go. - Fixed
~and+double escaping safe strings or not escaping unsafe ones when combining them with auto escaping enabled in Rust and Go. - Fixed
first,last,length,count,items,reverse,joinandgroupbyhandlingnoneand undefined values differently from Jinja2 in Rust and Go. - Fixed final sigma, titlecase and special case mappings in the
upper,lower,capitalizeandtitlefilters in Rust and Go. - Fixed
reverseandlastnot reversing maps and other reversible iterables.lastnow also works on maps. - Fixed repeating strings and sequences a negative number of times failing instead of producing an empty result, and repeating safe strings losing their safety.
- Fixed integer math between
2**127and2**128, negating the smallest 128-bit integer anddivisiblebywith a zero divisor in Rust and Go. - Fixed the
evenandoddtests for big integers and floats with an integer value. - Fixed
super()panicking at the top level of an included template andloop(...)misbehaving in included templates, blocks and macros. - Fixed slicing with a negative step panicking on empty values and returning wrong items for some bounds.
- Fixed
split(none, n)returning trailing whitespace as an extra item. - Errors raised while writing the value of
{{ ... }}now point to the whole expression. - Constant folding no longer creates strings or sequences larger than 1KB at compile time.
- Improved the performance of string slicing, string concatenation and the
titlefilter. - Go: maps now keep the type of their keys and their insertion order like in Rust. The new
value.Maptype gives access to such maps;Value.AsMapconverts their keys to strings. - Go: added support for integers outside the 64-bit range to arithmetic, comparisons,
tojson, theint,floatandroundfilters and theeven,oddandintegertests. - Go: maps can now be compared and sorted, and
==no longer rounds integers to floats. - Go: fixed
caller,super(),loop(x), macro auto escaping, blocks of included templates, the template reported for code in blocks and macros and filter chains in{% filter %}blocks to behave like in Rust. - Go: fixed operators and the
string,safe,sumandindentfilters accepting undefined values with strict undefined behavior. - Go: fixed many filters (
batch,slice,length,first,last,abs,items,split,attrand others) silently accepting invalid values or arguments instead of failing like in Rust. - Go: fixed
inon strings,+on iterables,chainresults,groupbygroups, namespaces, unsigned 64-bit integers and float literals such as1e400to behave like in Rust.
Install minijinja-cli 3.1.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/3.1.0/minijinja-cli-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/3.1.0/minijinja-cli-installer.ps1 | iex"Download minijinja-cli 3.1.0
| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |