Release Notes
- Moved the
trim_blocks,lstrip_blocksandkeep_trailing_newlinesettings fromEnvironmentintoSyntaxConfig.SyntaxConfig::builder,Environment::set_syntaxandEnvironment::syntaxare now available without thecustom_syntaxfeature, andSyntaxConfig::to_builderwas added to modify an existing configuration. Template introspection viaTemplate::undeclared_variablesnow honors the whitespace settings. #470 - Changed
AutoEscape::Customto hold aCow<'static, str>so custom auto escape formats can be determined at runtime.AutoEscapeis no longerCopyandState::auto_escapenow returns a reference. The Python bindings no longer leak custom auto escape names. - Fixed deadlocks in the Python bindings when an environment is modified while another thread renders from it, or when it is used from within a callback during a render. Renders now work on a snapshot of the environment and no longer serialize on a shared lock. #955
- Fixed Python iterators that raise during iteration looping forever. The error is now raised from the render instead. #956
- Iteration now consistently fails on invalid values that iterators yield to report errors. Previously only loops did this while filters such as
list,joinorsort, theinoperator and serialization processed them like other items. The newValueIter::checkedhelper provides the same behavior for custom code. - Added automatic reloading of individual templates. Loaders can now return a
TemplateSourcewith an up-to-date check in addition to a plainString, and the environment re-invokes the loader when a template is looked up that is no longer up to date.path_loaderattaches a check based on the file's modification time and size. Auto reloading is enabled by default and can be disabled withEnvironment::set_auto_reload. Templates are reloaded through a shared reference so the environment no longer needs to be recreated or guarded by a lock. Thememo-mapdependency was removed. #819 - Discontinued the
minijinja-autoreloadcrate. Templates loaded viapath_loaderare now reloaded automatically and environments no longer need to be guarded by a lock to reload. SeeUPDATING.mdfor migration instructions. - Removed the
deserializationfeature. Deserialization support is now part of theserdefeature. - The
jsonfeature no longer depends onserdeandserde_json. Thetojsonfilter and JSON auto escaping now use a built-in JSON serializer. Invalid values now fail the serialization rather than being emitted asnull. Floats are formatted like recent versions ofserde_jsondo (for instance1e+16instead of1e16). Thespeedupsfeature now useszmijanditoato format numbers in JSON; the output is the same without it. - Updated PyO3 to 0.29 in the Python bindings.
Install minijinja-cli 3.0.0-alpha.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/3.0.0-alpha.3/minijinja-cli-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/3.0.0-alpha.3/minijinja-cli-installer.ps1 | iex"Download minijinja-cli 3.0.0-alpha.3
| 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 |