curlz icon indicating copy to clipboard operation
curlz copied to clipboard

fix(deps): update rust crate minijinja-stack-ref to v1

Open renovate[bot] opened this issue 2 years ago • 1 comments

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

Compare Source

  • Fixed an issue where lstrip_blocks unintentionally also applied to variable expression blocks. #​502

v1.0.20

Compare Source

  • 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

Compare Source

  • Fixed an endless loop in undeclared_variables. #​486

v1.0.17

Compare Source

  • Added support for Option<Into<Value>> as return value from functions. #​452
  • Deprecated Value::from_serializable for the improved replacement method Value::from_serialize. #​482

v1.0.16

Compare Source

  • Tolerate underscores in number literals. #​443
  • Added support for trim_blocks and lstrip_blocks for Jinja2 compatibility. #​447
  • Changed API of unstable_machinery. The tokenize function got an extra argument for the WhitespaceConfig. It's however recommended to use the new Tokenizer struct instead. parse_expr was added, the parse function now takes a SyntaxConfig and WhitespaceConfig. #​447

v1.0.15

Compare Source

  • Resolved a compiler warning for Rust 1.77. #​440
  • Fixed an incorrect error case in call_method. Now UnknownMethod is returned instead of InvalidOperation correctly. #​439
  • Added Environment::set_unknown_method_callback which 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

Compare Source

  • Fixed a bug with broken closure handling when working with nested {% macro %} or {% call %} blocks. #​435

v1.0.13

Compare Source

  • minijinja-cli now supports an -o or --output parameter to write into a target file. #​405
  • minijinja-cli now accepts the --safe-path parameter to disallow includes or extends from paths not explicitly allowlisted. #​432
  • Added support for Error::display_debug_info which 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-autoreload now supports on_should_reload_callback which lets one register a callback to be called just before an auto reload should be performed. #​424
  • Added support for Value::from_iterator, IteratorObject and ObjectKind::Iterator. #​426
  • Added support for 0b/0o/0x prefixed integer literals for binary, octal and hexadecimal notation. #​433

v1.0.12

Compare Source

  • The urlencode filter now correctly skips over none and undefined. #​394
  • The dict function now supports merging in of extra arguments. #​395
  • Added support for primitive datetimes in the contrib module. #​398

v1.0.11

Compare Source

  • Added Environment::compile_expression_owned to allow compiled expressions to be held without requiring a reference. #​383
  • Added minijinja-embed crate which provides a simple way to embed templates directly in the binary. #​392

v1.0.10

Compare Source

  • Added int and float filters. #​372
  • Added integer and float tests. #​373
  • Fixed an issue that caused the CLI not to run when the repl feature was disabled. #​374
  • Added -n / --no-newline option to CLI. #​375

v1.0.9

Compare Source

  • Fixed a memory leak involving macros. Previously using macros was leaking memory due to an undetected cycle. #​359
  • The debug function in templates can now also be used to print out the debug output of a variable. #​356
  • Added a new stacker feature 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

Compare Source

  • Large integer literals in templates are now correctly handled. #​353
  • Relax the trait bounds of Value::downcast_object_ref / Object::downcast_ref / Object::is and added support for downcasting of types that were directly created with Value::from_seq_object and Value::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

Compare Source

  • Added support for keep_trailing_newlines which allows you to disable the automatic trimming of trailing newlines. #​334
  • Added minijinja-cli which 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::UNDEFINED and Value::from(()) is now undefined and none rather than Undefined and None. This was an accidental inconsistency.
  • Fixed a potential panic in debug error printing.
  • Added Environment::set_path_join_callback and State::get_template to 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 by include or extends can be relative to the current template. #​328
  • The default auto-escape detection now accepts .html.j2 as alias for .html as well as for all other choices. In general .j2 as an extension is now generally supported.

v1.0.6

Compare Source

  • Fixed iso datetime formatting not handling negative offsets correctly. #​327
  • Re-report Value directly from the crate root for convenience.
  • It's now possible to deserialize from a Value. Additionally the ViaDeserialize<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 accepts none in 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-contrib if the timezone feature 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 chrono support to the time filters in the minijinja-contrib crate.

v1.0.3

Compare Source

  • Republished 1.0.2 with fixed docs.

v1.0.2

Compare Source

  • Fixed an issue where lstrip_blocks unintentionally also applied to variable expression blocks. #​502

v1.0.1

Compare Source

  • Deprecated Value::from_iterator and introduced replacement Value::make_one_shot_iterator API which also exists in 2.x. #​487

v1.0.0

Compare Source

  • Support unicode sorting for filters when the unicode feature is enabled. This also fixes confusing behavior when mixed types were sorted. (#​299)

  • Added json5 as file extension for JSON formatter.

  • The autoreload crate now supports fast reloading by just clearning the already templates. This is enabled via set_fast_reload on the Notifier.

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_source and the Source type together with the source feature were removed. The replacement is the new loader feature which adds the add_template_owned and set_loader APIs. The functionality previously provided by Source::from_path is now available via path_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_block and Template::render_block_to_write were replaced with APIs of the same name on the State returned by Template::eval_to_state or Template::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_args was removed as API as it's no longer necessary since the from_args function 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 testutils feature and testutils module were removed. Instead you can now directly create an empty State and 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();
    
  • intern and some APIs that use Arc<String> now use Arc<str>. This means that for instance StructObject::fields returns Arc<str> instead of Arc<String>. All the type conversions that previously accepted Arc<String> now only support Arc<str>.

  • State::current_call was 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_discarding was removed without replacement. This is an implementation detail and was unintentionally exposed. You should not write code that depends on the internal state of the Output.

v0.34.0

Compare Source

  • Updated self_cell and percent-encoding dependencies. (#​264)

  • Added Template::render_block and Template::render_block_to_write which allows rendering a single block in isolation. (#​262)

v0.33.0

Compare Source

  • Hide accidentally exposed Syntax::compile method.
  • Added undeclared_variables methods to Template and Expression. (#​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.

renovate[bot] avatar Jun 16 '23 08:06 renovate[bot]

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.

codecov[bot] avatar Jun 16 '23 08:06 codecov[bot]