Repository navigation
chore(deps): update rust crate minijinja (2.21.0 → 3.1.0) - #153
Open
atvik-renovate[bot] wants to merge 1 commit into
Open
atvik-renovate[bot] wants to merge 1 commit into
atvik-renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
atvik-renovate
Bot
force-pushed
the
renovate/minijinja-3.x
branch
28 times, most recently
from
October 14, 2026 19:11
088dfe9 to
dcb2b3a
Compare
atvik-renovate
Bot
force-pushed
the
renovate/minijinja-3.x
branch
29 times, most recently
from
October 18, 2026 15:11
fd6807c to
3f0ae42
Compare
This branch has not been deployed
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:
2→3Release Notes
mitsuhiko/minijinja (minijinja)
v3.1.0Compare Source
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.Rawreturns a*value.Mapfor them and
Value.AsMapreturns a copy with keys converted to strings.State::consume_fuelin Rust andState.ConsumeFuelin Go so that custom filters and functions can charge fuel. #483Template::render_with_spansin Rust andTemplate.RenderWithSpansin Go to map rendered output back to the template source. #1004countargument to thereplacefilter for Jinja2 compatibility in Rust. #1013minijinja-contribnow fall back to jiff's bundled time zone database for names missing from the system database. #10080and1in Rust and Go.maxandgroupbyreturning the last of multiple equal items instead of the first for Jinja2 compatibility in Rust and Go.~and+double escaping safe strings or not escaping unsafe ones when combining them with auto escaping enabled in Rust and Go.first,last,length,count,items,reverse,joinandgroupbyhandlingnoneand undefined values differently from Jinja2 in Rust and Go.upper,lower,capitalizeandtitlefilters in Rust and Go.reverseandlastnot reversing maps and other reversible iterables.lastnow also works on maps.2**127and2**128, negating the smallest 128-bit integer anddivisiblebywith a zero divisor in Rust and Go.evenandoddtests for big integers and floats with an integer value.super()panicking at the top level of an included template andloop(...)misbehaving in included templates, blocks and macros.split(none, n)returning trailing whitespace as an extra item.{{ ... }}now point to the whole expression.titlefilter.value.Maptype gives access to such maps;Value.AsMapconverts their keys to strings.tojson, theint,floatandroundfilters and theeven,oddandintegertests.==no longer rounds integers to floats.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.string,safe,sumandindentfilters accepting undefined values with strict undefined behavior.batch,slice,length,first,last,abs,items,split,attrand others) silently accepting invalid values or arguments instead of failing like in Rust.inon strings,+on iterables,chainresults,groupbygroups, namespaces, unsigned 64-bit integers and float literals such as1e400to behave like in Rust.v3.0.5Compare Source
batchorslicefilters. Filters likelist,sort,reverse,map,sliceandbatchas well as slicing and concatenating sequences now cap how much they preallocate, so[1, 2]|batch(4611686018427387904)is[[1, 2]]instead of failing with "capacity overflow". #4831234567.5printed as1.2345675e+06. Like in Rust, a float now prints as its shortest exact decimal without an exponent, so1234567.5is1234567.5and1e20is100000000000000000000.0. Inside lists and maps, exponent notation is only used below1e-4and from1e16up, written like1e20and1e-5. NaN now prints asNaN, and infinity inside a list asinfinstead of+Inf. #984%sin theformatfilter formatting floats with%grules, so"%s"|format(1234567.5)was1.23457e+06. Like in Python, floats are now formatted likestr()does:1234567.5,1e+16,1e-05ornan. The0,+and space flags are ignored for floats and strings with%s, like in Python. This applies to both Rust and Go. #984tojsonfilter in Go writing floats like integers. Like in Rust, a float stays a float in the output, so1.0|tojsonis1.0instead of1, large and small magnitudes use exponent notation (1.5e+16,2.5e-7) and infinity becomesnullinstead of an error. The same applies to values rendered with JSON auto-escaping. #983upper,lower,capitalize,titleandreplacefilters in Go ignoring values that are not strings. Like in Rust, the value and thereplacearguments are converted to strings first, so1.5|replace(".", ",")is1,5andtrue|upperisTRUE, and a number passed toreplaceis no longer treated as an empty string. #985inoperator on iterables such asrange()in Go. Like in Rust,range(5)[:2]is now[0, 1]instead of failing with "cannot slice iterator", and3 in range(5)istrueinstead offalse. Slicingnoneor undefined gives an empty list like in Rust. Iterables now also print, compare, serialize withtojsonandpprintlike lists, sorange(2) == [0, 1]istrueand[range(2)]prints as[[0, 1]]instead of[<iterator>]. Theinoperator now also works on custom sequence, iterable and map objects. #986nonein Go not being treated as an empty sequence by thesort,unique,select,reject,map,groupby,joinandurlencodefilters and theiterabletest. Like in Rust,none|sortis now[]andnone|joinis an empty string instead ofNone. #987odd,evenanddivisiblebytests in Go ignoring booleans, anddivisiblebyignoring a float divisor. Like in Rust, booleans count as0and1, sotrue is oddis true, and6.5 is divisibleby(0.5)is true. #988str.formatinpycompatcutting floats to six significant digits when no precision is given. Like in Python, such floats are now formatted likestr()does, so'{}'.format(3.14159265)is3.14159265,'{}'.format(1234567.0)is1234567.0instead of1.23457e+06and'{}'.format(0.0)is0.0instead of0. #991trimfilter in Go ignoring values that are not strings and only stripping ASCII spaces, tabs and newlines by default. Like in Rust,5|trim|lengthis now1, and Unicode whitespace such as a non-breaking space is stripped. #989sort,unique,select,reject,selectattr,rejectattr,map,batchandgroupbyfilters in Go, andnonebybatch,selectattrandrejectattr. Like in Rust,undefined|sortis now[]with lenient undefined behavior, while strict and semi-strict undefined behavior still fail except forjoinandgroupby. #990compile_expressionwhen the expression contains}}followed by more input, such as}} x. This is now a syntax error, like the same text inside a template. #992v3.0.4Compare Source
str.countinpycompatlooping forever when counting an empty string. Like in Python,'abc'.count('')is now4.str.islowerandstr.isupperinpycompatreturning false for strings with spaces, digits or other uncased characters, and thestr.is*predicates returning true for an empty string. They now follow Python, so'foo bar'.islower()is true and''.isdigit()is false.str.findandstr.rfindinpycompatreturning byte offsets. Like in Python they now return character offsets, so'über'.find('e')is2.9007199254740993 + 0is9007199254740993and9223372036854775807 + 1is9223372036854775808. #981-,*,/,//and%and for repeating strings and sequences in Go. Like in Rust and Jinja2,true - 1is0and"ab" * trueisab.**failing with a negative integer exponent in Rust. Like in Jinja2,2 ** -1is now0.5. Zero to a negative power now always fails in Rust and Go like a division by zero, instead of producinginffor floats in Rust and for all numbers in Go. #982**on integers in Go being computed with floats. Like in Rust the result is now exact up to 128 bits and fails beyond that, a float base stays a float so2.0 ** 3is8.0, and booleans count as integers.sortfilter ignoring a comma-separated list of attributes in Go. Like in Rust,sort(attribute="name, state")now sorts bynameand then bystateinstead of leaving the items in their original order. #979sortfilter comparing strings case-sensitively when sorting by several attributes in Rust and Go. Like in Jinja2, each part of the key is now compared case-insensitively unlesscase_sensitiveis set. An attribute list with whitespace-only entries such as"name, "also no longer sorts by an empty attribute in Rust.attributeandstartarguments to thesumfilter and theattributeargument to thejoinfilter for Jinja2 compatibility in Rust and Go. Like in Jinja2 the arguments can be passed positionally or by keyword, and the separator ofjoincan also be passed asd. In Go the first positional argument ofsumis now the attribute rather than the start value, sosum(100)needs to be written assum(start=100). Go previously ignored unknown keyword arguments tosumandjoinand now fails like Rust. Like in Jinja2,sumin Rust can now also concatenate lists when given a list asstart. #980int,floatandroundfilters in Go. Like in Rust they now count as not given, so2.5|round(none)is2.0instead of an error.joinfilter dropping a separator that is not a string in Go. Like in Rust it is converted to a string, so[1, 2]|join(3)is132.v3.0.3Compare Source
v3.0.2Compare Source
{% import %}, and{% from ... import %}of such a name is a syntax error.State::exports/State.Exportsno longer return them either, but they can still be retrieved withlookup. #970{% import %}not being iterable in Go.indentfilter indenting blank lines of CRLF text whenblankis false, in Rust and Go. A blank line ended up as" \r"instead of"\r", leaving trailing whitespace. #972wordwrapfilter ignoringbreak_long_wordswhenbreak_on_hyphensisfalse. The two arguments are independent in Jinja2, so a word longer thanwidthis still broken unlessbreak_long_wordsisfalse. #940foo.1.0failing with a syntax error in Rust and Go. Like in Jinja2, a number right after a dot is now always read as an item index, sofoo.1.0isfoo[1][0]instead offoofollowed by the float1.0. #974\xand octal string escapes above\x7fproducing invalid UTF-8 in Go. Like in Rust they now produce the code point, so'\xe9'isé. Go now also understands the\band\fescapes and surrogate pairs written as two\uescapes, and rejects a lone surrogate like Rust does. #975methodargument to theroundfilter for Jinja2 compatibility in Rust and Go. It takescommon(the default),ceilorfloor, and bothprecisionandmethodcan now be passed as keyword arguments. Integers are now rounded to a negative precision like in Jinja2, so15|round(-1)is20rather than15. #968{% break %}, was raised in place of the next unrelated error. Exceptions are now attached to the error that carries them. Exceptions raised by a loader are also no longer treated as missing templates, so they are no longer ignored byignore missingor skipped by an include with a list of templates. #967abi3t(PEP 803) wheel for CPython 3.15+. #969v3.0.1Compare Source
pyemscriptenplatform tag) for Pyodide 0.29 and 314 so it can be installed withmicropip.minandmaxfilters now compare strings case-insensitively by default and accept thecase_sensitiveandattributearguments for Jinja2 compatibility in Rust and Go. Previously["b", "P", "n"]|maxreturnednwhere Jinja2 returnsP, and passing either argument failed with too many arguments.defaultandbasearguments to theintfilter and thedefaultargument to thefloatfilter for Jinja2 compatibility in Rust and Go. If a default is given, it is returned for values that cannot be converted and for none instead of failing. In Go both filters now also reject undefined values with strict undefined behavior like in Rust. #962formatfilter ignoring keyword arguments in Go. Like in Rust they are passed as a trailing mapping and fill%(name)sspecs.lstrip_blocksand the end of line statements in Go only handling ASCII whitespace. Like in Rust they now handle all Unicode whitespace. Syntax errors about unexpected characters now show the character rather than its first byte.v3.0.0Compare Source
MiniJinja 3 is a major release. It aligns template behavior and the value
model more closely with Jinja2, makes Serde optional, makes mutable
Statethecanonical way to call back into the engine, adds built-in automatic reloading
of templates, reworks the JavaScript bindings and makes the Python bindings
considerably faster. Errors involving undefined values and the debug info
shown for errors were improved as well.
Most projects will need some changes when upgrading. See
UPDATING.mdformigration instructions. The changes below are relative to 2.24.0 and include
everything from the 3.0.0 alpha releases.
Breaking Changes
serdeoptional, explicit and disabled by default. The rendering APIs,context!andargs!now consume values and convert exclusively throughInto<Value>. Serde conversion is requested with the newvalue::Serdewrapper which also replacesViaDeserializefor deserializing function arguments.Value::from_serializewas removed. Thedeserializationfeature was removed and is now part of theserdefeature. Disabling the feature fully removes the dependency. #528jsonfeature 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.Statethe canonical path for functions, filters, tests, objects, methods, formatters, unknown method callbacks and nested macro calls. Read-only typed callbacks can continue to use&State; state mutation and dynamic calls now require&mut State. Added typed render-local extensions that persist through includes, blocks and macros.State::get_or_set_temp_objectwas removed in favor of these extensions.Template::render_and_return_state,Template::render_to_write,Template::eval_to_state, theFilter,Test,TestResultandViaDeserializealiases,value::internand the no-opkey_interningfeature. The no-oploaderfeature was also removed; loader APIs remain available unconditionally.format_filterandFormatStylefrom the crate root into the newformattingmodule and renamedformat_filtertoformatting::format.trim_blocks,lstrip_blocksandkeep_trailing_newlinesettings fromEnvironmentintoSyntaxConfig. AddedSyntaxConfig::to_builderto modify an existing configuration. Template introspection viaTemplate::undeclared_variablesnow honors the whitespace settings.WhitespaceConfigwas removed from theunstable_machineryAPIs. #470custom_syntaxfeature. Custom delimiters, line statements and line comments are now always available. Theaho-corasickdependency was removed; start markers are now found with a simple scan which is as fast or faster and makes building a customSyntaxConfigabout 100 times faster.ErrorKind::InvalidDelimiter.AutoEscape::Customto hold aCow<'static, str>so custom auto escape formats can be determined at runtime.AutoEscapeis no longerCopyandState::auto_escapenow returns a reference.Valuefunction arguments to reject implicit keyword-argument values. Variadic functions that intentionally capture them can useValueOrKwargs. #596Value::from_pairs. Collecting pairs directly intoValuenow creates a sequence of tuples rather than a map.list,joinorsort, theinoperator and serialization processed them like other items. The newValueIter::checkedhelper provides the same behavior for custom code.Environment::set_loaderis now generic over the returned source, which can be aStringor aTemplateSource. Closures that relied on type inference through.into()or only returnOk(None)need an explicit type.minijinja-autoreloadcrate in favor of built-in automatic reloading (see below).Template Behavior
These changes apply to Rust and Go and therefore also to the Python and
JavaScript bindings.
tojsonto use Jinja2-compatible separator spacing. #785roundfilter to use round-half-even semantics and fixed decimal rounding edge cases. #948sequencetest to classify undefined values as sequences. #951upperandlowertests to reject non-strings and handle titlecase characters correctly. #952titlefilter treating every ASCII punctuation character as a word boundary. Words now start after whitespace or one of-,(,{,[and<as in Jinja2, so"don't"|titlerenders asDon'tinstead ofDon'T. #930-foo.barnow negatesfoo.barrather than looking upbaron-foo.formatfilter accepting undefined values with strict and semi-strict undefined behavior.andandorexpressions returning booleans instead of preserving their operands. #945<%and<%%=) sometimes picking the wrong marker.Features and Improvements
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`user.name` is undefined), including where it came from if that was elsewhere. This adds no memory overhead to values. #871withblock or a filtered loop ({% for x in seq if cond %}) are no longer omitted when the error happens within or after it, and errors within macros no longer show variables from outside of the macro. Variables only referenced within the bodies of declared macros are no longer shown.minijinjaby about 14% in a default release build. Sorting by attribute andgroupbyare roughly twice as fast.Go
/v2to/v3.Environment.SetUnknownMethodCallback. #934loop.changed()always reporting a change. #936Python Bindings
extension-modulefeature. Building now requires maturin 1.9.4 or later.f64conversion. #944pass_statenot working on methods invoked from templates.JavaScript Bindings
The JavaScript bindings were largely rewritten:
causeis the original exception.undefinedBehavior.semi_strictundefined behavior (wassemi_strct).Map,Set,Date,BigInt,Uint8Arrayand typed arrays are supported, and class instances are accessed lazily with methods called on the instance. Cyclic structures fail with an error instead of overflowing the stack.Maps, none is returned asnulland integers outside of the safe range asBigInt. Functions and objects passed in are returned unchanged.SafeStringfor strings that should not be auto escaped. Callbacks receive safe strings asSafeStringand can return them to bypass auto escaping.TemplateErrorwithkind,detail,templateName,line,rangeandtemplateSourceproperties.addFunction,removeFilter,removeTest,setAutoEscapeCallback,setFinalizer,undeclaredVariablesInTemplateandundeclaredVariablesInStras well as thesyntaxproperty for custom delimiters and line statements and thepycompatproperty.Context,SyntaxConfig,AutoEscapeandUndefinedBehaviorare exported.passStatereceive aStateobject to look up variables, inspect the template name and auto escape mode, and apply filters and tests. Callbacks can throwTemplateErrorto fail with a specific error kind.datetimeformat,dateformat,timeformatandnow()) inminijinja-js/datetimewhich use the native time zone support of the JavaScript runtime.randcontrib feature (random,randrangeandlipsum) seeded fromMath.random.urlencode,loop_controlsandunicodefeatures as well as thehtml_entitiesandwordwrapcontrib features to match the Python bindings.renderStr,renderTemplate,renderNamedStrandevalExpris now optional.exportsmap. Node.js loads the wasm module synchronously (and supportsrequire()on versions withrequire(esm)), browsers, bundlers, Deno and Bun load it with top-level await. Theminijinja-js/initentry point allows initializing the module manually. Thedist/node,dist/webanddist/bundlerpaths are gone. The package is now about a quarter of its previous size.fragileandserde-wasm-bindgendependencies and updatedwasm-bindgento 0.2.129.Contrib
time/time-tzto Jiff. Custom formats now usestrftime-style syntax instead oftimeformat descriptions. With thetimezonefeature, time zones are looked up through the system time zone database when available. Thedatetimefeature no longer depends onserde. #694minijinja_contrib::rand::set_seed_sourceto provide seeds for the random functions on platforms without a source of randomness.CLI
undefinedfor expressions that evaluate to undefined.clap,rustylineand theserdebased data format crates were replaced byargument,minilineanddeser. Fig completions are no longer supported. The minimum supported Rust version of the CLI is now 1.88.v2.24.0Compare Source
wordwrapfilter to the Python bindings. #885context!sorting keys when thepreserve_orderfeature is enabled. #920v2.23.0Compare Source
v2.22.0Compare Source
None,True, andFalsefor Jinja2 compatibility in Rust and Go. #913StringInputfor custom Rust filters and functions that transform strings while preserving safety provenance.splitfilter to return a sequence, enabling negative indexing and slicing in Rust and Go. #909Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Operator.