curlz
curlz copied to clipboard
fix(deps): update rust crate minijinja-stack-ref to v1
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| minijinja-stack-ref | dependencies | major | 0.32 -> 1.0 |
Release Notes
mitsuhiko/minijinja (minijinja-stack-ref)
v1.0.21
- Fixed an issue where
lstrip_blocksunintentionally also applied to variable expression blocks. #502
v1.0.20
- Added support for implicit string concatenation for Jinja2 compatibility. #489
- Added support for sequence concatenation with the plus operator for Jinja2 compatibility. #491
v1.0.18
- Fixed an endless loop in
undeclared_variables. #486
v1.0.17
- Added support for
Option<Into<Value>>as return value from functions. #452 - Deprecated
Value::from_serializablefor the improved replacement methodValue::from_serialize. #482
v1.0.16
- Tolerate underscores in number literals. #443
- Added support for
trim_blocksandlstrip_blocksfor Jinja2 compatibility. #447 - Changed API of
unstable_machinery. Thetokenizefunction got an extra argument for theWhitespaceConfig. It's however recommended to use the newTokenizerstruct instead.parse_exprwas added, theparsefunction now takes aSyntaxConfigandWhitespaceConfig. #447
v1.0.15
- Resolved a compiler warning for Rust 1.77. #440
- Fixed an incorrect error case in
call_method. NowUnknownMethodis returned instead ofInvalidOperationcorrectly. #439 - Added
Environment::set_unknown_method_callbackwhich allows a user to intercept method calls on primitives. The motivation here is that this can be used to implement python like methods to improve the compatibility with Jinja2 Python templates. #441
v1.0.14
- Fixed a bug with broken closure handling when working with nested
{% macro %}or{% call %}blocks. #435
v1.0.13
minijinja-clinow supports an-oor--outputparameter to write into a target file. #405minijinja-clinow accepts the--safe-pathparameter to disallow includes or extends from paths not explicitly allowlisted. #432- Added support for
Error::display_debug_infowhich displays just the debug info, same way as alternative display on the error does. #420 - Added the
namspace()function from Jinja2 and the ability to assign to it via{% set %}. #422 minijinja-autoreloadnow supportson_should_reload_callbackwhich lets one register a callback to be called just before an auto reload should be performed. #424- Added support for
Value::from_iterator,IteratorObjectandObjectKind::Iterator. #426 - Added support for
0b/0o/0xprefixed integer literals for binary, octal and hexadecimal notation. #433
v1.0.12
- The
urlencodefilter now correctly skips over none and undefined. #394 - The
dictfunction now supports merging in of extra arguments. #395 - Added support for primitive datetimes in the contrib module. #398
v1.0.11
- Added
Environment::compile_expression_ownedto allow compiled expressions to be held without requiring a reference. #383 - Added
minijinja-embedcrate which provides a simple way to embed templates directly in the binary. #392
v1.0.10
- Added
intandfloatfilters. #372 - Added
integerandfloattests. #373 - Fixed an issue that caused the CLI not to run when the
replfeature was disabled. #374 - Added
-n/--no-newlineoption to CLI. #375
v1.0.9
- Fixed a memory leak involving macros. Previously using macros was leaking memory due to an undetected cycle. #359
- The
debugfunction in templates can now also be used to print out the debug output of a variable. #356 - Added a new
stackerfeature which allows raising of the recursion limits. It enables monitoring of the call stack via stacker and automatically acquires additional memory when the call stack runs out of space. #354
v1.0.8
- Large integer literals in templates are now correctly handled. #353
- Relax the trait bounds of
Value::downcast_object_ref/Object::downcast_ref/Object::isand added support for downcasting of types that were directly created withValue::from_seq_objectandValue::from_struct_object. #349 - Overflowing additions on very large integers now fails rather than silently wrapping around. #350
- Fixed a few overflow panics: dividing integers with an overflow and
- Exposed missing new functionality for the Python binding. #339
v1.0.7
- Added support for
keep_trailing_newlineswhich allows you to disable the automatic trimming of trailing newlines. #334 - Added
minijinja-cliwhich lets you render and debug templates from the command line. #331 - Macros called with the wrong state will no longer panic. #330
- Debug output of
Value::UNDEFINEDandValue::from(())is nowundefinedandnonerather thanUndefinedandNone. This was an accidental inconsistency. - Fixed a potential panic in debug error printing.
- Added
Environment::set_path_join_callbackandState::get_templateto support path joining. This is for greater compatibility with Jinja2 where path joining was overridable. With this you can configure the engine so that paths used byincludeorextendscan be relative to the current template. #328 - The default auto-escape detection now accepts
.html.j2as alias for.htmlas well as for all other choices. In general.j2as an extension is now generally supported.
v1.0.6
- Fixed iso datetime formatting not handling negative offsets correctly. #327
- Re-report
Valuedirectly from the crate root for convenience. - It's now possible to
deserializefrom aValue. Additionally theViaDeserialize<T>argument type was added to support value conversions via serde as argument type. #325
v1.0.5
- Added the ability to merge multiple values with the
context!macro. (#317) Option<T>now acceptsnonein filters. Previously only undefined values were accepted. This bugfix might have a minor impact on code that relied in this behavior. (#320)- Fix a compilation error for
minijinja-contribif thetimezonefeature is not enabled.
v1.0.4
- Added the
args!macro which can be used to create an argument slice on the stack. (#311) - Improved error reporting for missing keyword arguments.
- Added
chronosupport to the time filters in theminijinja-contribcrate.
v1.0.3
- Republished
1.0.2with fixed docs.
v1.0.2
- Fixed an issue where
lstrip_blocksunintentionally also applied to variable expression blocks. #502
v1.0.1
- Deprecated
Value::from_iteratorand introduced replacementValue::make_one_shot_iteratorAPI which also exists in 2.x. #487
v1.0.0
-
Support unicode sorting for filters when the
unicodefeature is enabled. This also fixes confusing behavior when mixed types were sorted. (#299) -
Added
json5as file extension for JSON formatter. -
The autoreload crate now supports fast reloading by just clearning the already templates. This is enabled via
set_fast_reloadon theNotifier.
Note: This also includes all the changes in the different 1.0.0 alphas.
Breaking Changes
1.0 includes a lot of changes that are breaking. However they should with some minor exceptions be rather trivial changes.
-
Environment::source,Environment::set_sourceand theSourcetype together with thesourcefeature were removed. The replacement is the newloaderfeature which adds theadd_template_ownedandset_loaderAPIs. The functionality previously provided bySource::from_pathis now available viapath_loader.Old:
let mut source = Source::with_loader(|name| ...); source.add_template("foo", "...").unwrap(); let mut env = Environment::new(); env.set_source(source);New:
let mut env = Environment::new(); env.set_loader(|name| ...); env.add_template_owned("foo", "...").unwrap();Old:
let mut env = Environment::new(); env.set_source(Source::from_path("templates"));New:
let mut env = Environment::new(); env.set_loader(path_loader("templates")); -
Template::render_blockandTemplate::render_block_to_writewere replaced with APIs of the same name on theStatereturned byTemplate::eval_to_stateorTemplate::render_and_return_state:Old:
let rv = tmpl.render_block("name", ctx)?;New:
let rv = tmpl.eval_to_state(ctx)?.render_block("name")?; -
Kwargs::from_argswas removed as API as it's no longer necessary since thefrom_argsfunction now provides the same functionality:Before:
// just split let (args, kwargs) = Kwargs::from_args(values); // split and parse let (args, kwargs) = Kwargs::from_args(values); let (a, b): (i32, i32) = from_args(args)?;After:
// just split let (args, kwargs): (&[Value], Kwargs) = from_args(values)?; // split and parse let (a, b, kwargs): (i32, i32, Kwargs) = from_args(values)?; -
The
testutilsfeature andtestutilsmodule were removed. Instead you can now directly create an emptyStateand use the methods provided to invoke filters.Before:
let env = Environment::new(); let rv = apply_filter(&env, "upper", &["hello world".into()]).unwrap();After:
let env = Environment::new(); let rv = env.empty_state().apply_filter("upper", &["hello world".into()]).unwrap();Before:
let env = Environment::new(); let rv = perform_test(&env, "even", &[42.into()]).unwrap();After:
let env = Environment::new(); let rv = env.empty_state().perform_test("even", &[42.into()]).unwrap();Before:
let env = Environment::new(); let rv = format(&env, 42.into()).unwrap();After:
let env = Environment::new(); let rv = env.empty_state().format(42.into()).unwrap(); -
internand some APIs that useArc<String>now useArc<str>. This means that for instanceStructObject::fieldsreturnsArc<str>instead ofArc<String>. All the type conversions that previously acceptedArc<String>now only supportArc<str>. -
State::current_callwas removed without replacement. This information was unreliably maintained in the engine and caused issues with recursive calls. If you have a need for this API please reach out on the issue tracker. -
Output::is_discardingwas removed without replacement. This is an implementation detail and was unintentionally exposed. You should not write code that depends on the internal state of theOutput.
v0.34.0
-
Updated
self_cellandpercent-encodingdependencies. (#264) -
Added
Template::render_blockandTemplate::render_block_to_writewhich allows rendering a single block in isolation. (#262)
v0.33.0
- Hide accidentally exposed
Syntax::compilemethod. - Added
undeclared_variablesmethods toTemplateandExpression. (#250)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 74.60%. Comparing base (
1d18d4a) to head (919582f).
Additional details and impacted files
@@ Coverage Diff @@
## main #132 +/- ##
==========================================
+ Coverage 74.50% 74.60% +0.10%
==========================================
Files 37 37
Lines 957 957
==========================================
+ Hits 713 714 +1
+ Misses 244 243 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.