chore(deps): update rust crate minijinja to v2#2548
Merged
albertlockett merged 1 commit intomainfrom Apr 6, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2548 +/- ##
==========================================
- Coverage 88.34% 88.34% -0.01%
==========================================
Files 613 613
Lines 222675 222675
==========================================
- Hits 196731 196722 -9
- Misses 25420 25429 +9
Partials 524 524
🚀 New features to boost your workflow:
|
albertlockett
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1→2Release Notes
mitsuhiko/minijinja (minijinja)
v2.19.0Compare Source
==), string concatenation (~), and undefined needles in theinoperator to better match Jinja2. #886 #888defaultfilter in strict undefined mode so an explicitly passed undefined fallback argument errors instead of being treated like a missing argument. #887v2.18.0Compare Source
width,first,blank) to theindentfilter for Jinja2 compatibility in Rust and Go. #864foo.0) in Rust and Go for Jinja compatibility. #881foo . bar . baz) for Jinja compatibility. #879\s) for Jinja compatibility in Rust and Go. #880minijinja-cabiownership and pointer-safety issues that could leakmj_valuevalues on error paths.
minijinja-cabiAPIs for callback-based functions/filters/tests,globals, loaders, path joining, auto-escape configuration, and fuel limits.
minijinja-cabiheader maintenance to manual source-based syncing andremoved cbindgen-based generation tooling.
minijinja-cabi(viamake -C minijinja-cabi test)with coverage across all exported C ABI functions, and wired them into top-level
testing and CI.
render_capturedandrender_captured_tomethods onTemplatewhichreturn a
Capturedtype holding the rendered output and the template state.into_outputmethod onCapturedto consume and return the output string.render_and_return_state,eval_to_state, andrender_to_writein favor of the new
render_captured/render_captured_to/CapturedAPI.v2.17.1Compare Source
v2.17.0Compare Source
'c'(character) format type support for format filters andstr.format-style formatting. #868minijinja-clirelease targets foraarch64-pc-windows-msvc(Windows ARM64) andarmv7-unknown-linux-gnueabihf.Rest<String>andVec<String>conversions. #877maturinby moving stripping from global config to release wheel build arguments.v2.16.0Compare Source
|escapeto honor custom formatters. #861keysandvaluesfilters from the Go port for parity. #863v2.15.1Compare Source
v2.15.0Compare Source
py.typedmarker for PEP 561 typing support in Python bindings. #853map.get()method in pycompat. #852|sortfilter when usingreverse=true. #856SemiStrictundefined mapping in Python bindings. #859v2.14.0Compare Source
{% set %}statements. #847v2.13.0Compare Source
|sortfilter. #827formatfilter andstr.formatmethod for pycompat. #835not undefinedwith strict undefined behavior. #838setLoaderandsetPathJoinCallbackto the JavaScript bindings. #842v2.12.0Compare Source
|zipfilter. #818break_on_hyphensfor the|wordwrapfilter. #823unknown_method_callback. #824.jinjaand.jinja2as extensions in auto escape. #832v2.11.0Compare Source
strings in the
|joinfilter. This was inconsistent withJinja2 and the filter itself for undefineds in other
positions. #794
rangefunction and changerange to
isize. #799isizeas argument type. #799\xescape sequences in stringsas well as octals. #805
|chainfilter. #807v2.10.2Compare Source
next-generation trait resolver to fail. #787
v2.10.1Compare Source
v2.10.0Compare Source
--outputis used in the CLI. #772mj_err_get_debug_infoto the C-ABI. #775means that if you do
{% import 'template.j2' as x %}and youthen render
{{ x }}the output oftemplate.j2is rendered asif it was included. #778
are now correctly handled. Additionally slicing on bytes now
correctly handles steps other than 1. #781
v2.9.0Compare Source
columns) are loaded. The error reporting will be wrong in those
cases but the templates will load. #742
proper error reporting if they cannot find a method. #743
merge_mapswhich is a dynamic version of thecontext!merge feature, and fixed enumeration behavior when non-map objects
are attempted to be merged. #745
mj_value_new_bytesto the C-ABI. #749mj_value_as_bytesto the C-ABI to borrow from strings orbyte values. #750
mj_err_get_detailandmj_err_get_template_name. Thesedid not work correctly. To fix them the return value now needs to be
freed. #754
AtomicU64isnot available in minijinja-contrib. #755
with contextandwithout contextforimports. #759
defaultfilter is now also registered asdfor Jinja2compatibility. #763
defaultfilter now accepts a second argument to enable laxdefaulting. #764
striptagsfilter to the contrib module. #765pycompatby default for the Python bindings and registerthe default contrib filters and tests. #767
v2.8.0Compare Source
SemiStrictundefined mode that is like strict but allowsto be checked for truthiness. Additionally an if expression without
an else block will always produce a silent undefined object that
never errors for compatibility with Jinja2. #687
ViaDeserializestricter. Now the typecan only be constructed if the type implements
DeserializeOwned.This is not a new requirement for passing the function to
add_functionbut bad code will now error earlier for bettererror reporting. #689
of depending on all of the
randmodule. #696to not advance the RNG between calls. #698
Environment.undeclared_variables_in_templateandEnvironnent.undeclared_variables_in_strto Python binding. #699loop_controlsfor Python in-line with the CLI. #704Object::custom_cmpto allow objects to influence how theycompare against themselves. This also fixes Python objects in the
Python binding not to compare correctly. #707
undeclared_variableswould incorrectly handlevariables referenced by macros. #714
rendering from the same environment at once. #717
__bool__correctly now for customobjects in if-conditions and filters. #719
}}caused a syntax error in expressions withopen parentheses, braces or brackets. #723
State::known_variablesto return a list of known variablesand
Environment::globals. #724caller. #725FiltersandTeststraits. They remain ashidden aliases to
Function. #726handle escapes. #728
and addresses. This cuts down on the memory usage needed for debug
information. #735
load_from_pathto python. #736v2.7.0Compare Source
loop.nextitemis now a lazy operation. This prevents issues wheniterating over one-shot iterators combined with
{% break %}andit now ensures that the iterator is not running "one item ahead". #677
recursive loops. #678
serde_ymltoserde_yaml. #684cases point to exactly where the error happened. #686
crate. #688
v2.6.0Compare Source
sumfilter. #648truncatefilter tominijinja-contrib. #647wordcountfilter tominijinja-contrib. #649wordwrapfilter tominijinja-contrib. #651and a bug was fixed that caused undefined values in strict undefined
mode not to work with tests. #657
unsafecode block from theKwargstype internallywhich was probably unsafe. #659
out when flattening on value handles is used. #664
Value::make_object_mapto create projections from objectinto maps, similar to how it was already possible to create
iterators that were projected from objects. #663
|itemsfilter will no longer allocate a list and insteadreturn an iterator. #665
lstrip_blocksto act too eager. #674v2.5.0Compare Source
minijinja-clinow supports preservation of order in maps. #611minijinja-cli. #611linesfilter to split a string into lines.Value::from_byteswithout having to go via serde, and they are nowproducing a nicer looking debug output. #616
stringfilter from Jinja2. #617more consistently. #619
minijinja-clinow allows the template name to be set to an emptystring when
--templateis used, to allow suppliying a data file. #624sameasfilter from Jinja2. #625(
1 is sameas 1). #626rendering. #627
the error. #630
minijinja-clinow has all features enabled by default as documented(that means also shell completion and ini). #633
minijinja-clinow does not convert INI files to lowercase anymore. This wasan unintended behavior. #633
*argsfor variable args and**kwargsfor keyword arguments) and fixed a bug where sometimes maps and keyword
arguments were created in inverse order. #642
v2.4.0Compare Source
minijinja-cliwith support for better documentation,config file and environment variable support. #602
minijinja-clinow supports template source passed by parameter forsimple cases. #606
minijinja-clinow has a--syntax-helpargument that prints out theprimer on the syntax. #607
minijinja-clinow installs to~/.local/binby default. #608String/Cow<str>argument types will no longer implicitly convertkeyword arguments to string form. This was an unintended foot gun. #605
v2.3.1Compare Source
PartialEq/EqinValuecaused by changesin 2.3.0. #584
v2.3.0Compare Source
were not in consistent order. #569
groupbyfilter. #570uniquefilter now is case insensitive by default like inJinja2 and supports an optional flag to make it case sensitive.
It also now lets one check individual attributes instead of
values. #571
Ordto avoid accidentally non total orderthat could cause panics on Rust 1.81. #579
Value::is_integermethod to allow a user to tell floatsand true integers apart. #580
v2.2.0Compare Source
used with
ViaDeserialize. #554IntoDeserializerforValueand&Value. #555filesizeformatto minijinja-contrib. #556loop_controlsfeature which adds{% break %}and{% continue %}. #558to slice them. This improves support for Jinja2 compatibility as Jinja2
is more likely to create temporary lists when slicing lists. #565
v2.1.2Compare Source
This fixes a bug that caused the wrong filters to be used in some
cases. #551
v2.1.1Compare Source
indentparameter totojsonfilter. #546randrange,lipsum,random,cyclerandjoinertominijinja-contrib. #547&TandArc<T>as parametersto filters and functions if
Tis anObject. #548minijinja-clinow also enables the datetime, timezone and rand features. #549intfilter closer to Jinja2. #549v2.1.0Compare Source
.inifiles. #532template extended from another template. #538
self_cellto 1.0.4. #540serdefeature is disabled. This is inanticipation of removing the serde dependency in the future. #541
State::resolve. It now can resolve theinitial template context in macro calls even if no closure has been
created. #542
v2.0.3Compare Source
str.endswith,str.rfind,str.isalnum,str.isalpha,str.isascii,str.isdigit,str.isnumeric,str.join,str.startswith. #522boolean,divisibleby,lowerandupper. #592v2.0.2Compare Source
*operator to match Jinja2 behavior. #519
minijinja::pycompatmodule which allows one to registeran unknown method callback that provides most built-in Python methods.
This makes things such as
dict.keyswork. Also adds a new--py-compatflag tominijinja-clithat enables it. This improvesthe compatibility with Python based templates. #521
|splitfilter that works like the.splitmethod in Python. #517v2.0.1Compare Source
binding. #506
v2.0.0Compare Source
This is a major update to MiniJinja that changes a lot of core internals and
cleans up some APIs. In particular it resolves some limitations in the engine
in relation to working with dynamic objects, unlocks potentials for future
performance improvements and enhancements.
It's very likely that you will need to do changes to your code when upgrading,
particular when implementing dynamic objects. In short:
StructObjectandSeqObjectare gone. They have been replaced by improvedAPIs directly on
Object. Please refer to the updated documentation to seehow these objects behave now. For the most part code should become quite a bit
clearer during the upgrade.
ObjectKindhas been replaced byObjectRepr. Rather than holding a referenceto a
StructObjectorSeqObjectthis now is a simple enum that just indicateshow that object serializes, renders and behaves.
Objectno longer usesfmt::Displayfor rendering. Instead the newObject::rendermethod is used which has a default implementation.Objecttrait has been completely transformed and the new type-erased typeDynObjecthas been added to work with unknown objects. This trait has animproved user experience and more flexibility. It's now possible to implement
any non-primitive value type including maps with non string keys which was previously
not possible.
ValueKindis now non exhaustive and got a log of new value types. This resolvesvarious issues in particular in relationship with iterators. As a result of this
functions will no longer accidentally serialize into empty objects for example.
Value::from_iteratorhas been replaced by the newValue::make_iterable,Value::make_object_iterableandValue::make_one_shot_iterator. The directreplacement is
Value::make_one_shot_iteratorbut for most uses it's stronglyrecommended to use one of the other APIs instead. This results in a much improved
user experience as it's possible to iterate over such values more than once.
Syntaxtype has been replaced by theSyntaxConfigtype. It uses a builderpattern to reconfigure the delimiters.
For upgrade instructions read the UPDATING guide.
Other Changes:
Environment::templatesmethod that iterates over loaded templates. #471Value::try_iternow holds a referenceto the
Valueinternally via reference counting.DynObjectnow replacesArc<Object>.iterabletest. #475Value::from_serializableis nowValue::from_serialize.was raised to 100000. #493
Value::fromis now implemented forErroras public API to create invalid values.Previously this behavior was hidden internally in the serde support. #495
UndefinedBehavior::Strictnow acts more delayed. This means that nowvalue.key is definedwill no longer fail.--syntaxto reconfigure syntax flags such as delimiters. #504Configuration
📅 Schedule: Branch creation - "before 8am on Monday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.