NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #3635 most downloaded on crates.io
The liquid templating language for Rust
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 12 months
Most releases are documented
notes for 45 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
12 years old
78 releases · first in 2015
chore: Release liquid version 0.26.11
chore: Release liquid version 0.26.11
chore: Release liquid version 0.26.10
chore: Release liquid version 0.26.10
One column per quarter.
Don't panic when generating parser error message
Nothing published for this version
Nothing published for this version
Support for jekyll's sort thanks to emmyoh
sort thanks to emmyohProvided an example of liquid::partials
Bump MSRV to 1.70
liquid::partials### Features - Initial support for render tag
render tag### Internal - Update dependencies
Serialization leaves off subseconds when not needed
Bump MSRV to 1.65
Don't lose millisecond precision on datetimes
Bump MSRV to 1.60
Upgraded kstring for real this time
More datetime string formats are supported
### Breaking Changes - Upgraded kstring
### Fixes - Use time instead of chrono
time instead of chronoEnsure LazyStore actually caches
LazyStore actually cachesUpgraded from anymap to anymap2 which is slightly better maintained (and removed it from the API)
anymap to anymap2 which is slightly better maintained (and removed it from the API)For the most part, only plugin authors should be impacted by these changes.
For the most part, only plugin authors should be impacted by these changes.
core::runtime went through significant changes
Renderable::render_to now takes &dyn Runtime instead of &Runtime<'_>StackFrame::new instead of Runtime.run_in_scope
runtime. to access stack functions instead of runtime.stack_mut()InterruptState is now InterruptRegister and accessed via runtime.registers()
core::model has been flattenedderive(ValueView) now requires being used with impl ObjectViewliquid-core users now need to opt-in to the derive feature for derive macrosAPI
#[derive(liquid_core::ObjectView, liquid_core::ValueView)] (previously only worked from liquid, making it unusable for the lib crate)serde requirement for derive(ValueView), making it work with more types (like field: &dyn ValueView).derive(ValueView) generating to_valueBenchmarks:
us rangebench_big_loop_big_object/render, it was hardly
impacted by the changes and yet that should have been case that greatly
improved. Further investigation is needed.handlebars_bench_template/parse/handlebars
time: [24.068 us 24.265 us 24.561 us]
change: [-19.750% -17.343% -14.831%] (p = 0.00 < 0.05)
Performance has improved.
handlebars_bench_template/parse/liquid
time: [19.382 us 19.438 us 19.503 us]
change: [-1.7723% -0.6484% +0.3359%] (p = 0.25 > 0.05)
No change in performance detected.
handlebars_bench_template/render/handlebars
time: [17.542 us 17.644 us 17.768 us]
change: [+0.2705% +0.9005% +1.5616%] (p = 0.01 < 0.05)
Change within noise threshold.
handlebars_bench_template/render/liquid
time: [9.0979 us 9.1362 us 9.1840 us]
change: [-29.397% -28.804% -28.079%] (p = 0.00 < 0.05)
Performance has improved.
handlebars_bench_large_loop/render/handlebars
time: [2.1674 ms 2.1748 ms 2.1828 ms]
change: [-1.6970% -0.9970% -0.3973%] (p = 0.00 < 0.05)
Change within noise threshold.
handlebars_bench_large_loop/render/liquid
time: [971.57 us 1.0048 ms 1.0330 ms]
change: [-25.328% -22.623% -20.133%] (p = 0.00 < 0.05)
Performance has improved.
liquid_bench_fixtures/parse/Hello World
time: [1.5103 us 1.5228 us 1.5364 us]
change: [+0.9648% +2.0790% +3.2025%] (p = 0.00 < 0.05)
Change within noise threshold.
liquid_bench_fixtures/render/Hello World
time: [325.45 ns 327.42 ns 329.17 ns]
change: [+66.006% +66.928% +67.840%] (p = 0.00 < 0.05)
Performance has regressed.
bench_big_loop_big_object/render/tera
time: [9.7588 us 10.082 us 10.483 us]
change: [+16.670% +19.302% +22.469%] (p = 0.00 < 0.05)
Performance has regressed.
bench_big_loop_big_object/render/liquid
time: [243.01 us 244.43 us 245.82 us]
change: [-3.1405% -2.6344% -2.1172%] (p = 0.00 < 0.05)
Performance has improved.
bench_big_table/render/tera
time: [3.6955 ms 3.7093 ms 3.7226 ms]
change: [-14.427% -12.151% -9.8055%] (p = 0.00 < 0.05)
Performance has improved.
bench_big_table/render/liquid
time: [5.4149 ms 5.4978 ms 5.5944 ms]
change: [-56.570% -55.904% -55.143%] (p = 0.00 < 0.05)
Performance has improved.
bench_teams/render/tera time: [8.9949 us 9.0961 us 9.2245 us]
change: [+11.039% +14.026% +16.983%] (p = 0.00 < 0.05)
Performance has regressed.
bench_teams/render/liquid
time: [9.0989 us 9.1398 us 9.1854 us]
change: [-30.075% -29.750% -29.403%] (p = 0.00 < 0.05)
Performance has improved.
bench_parsing_basic_template/render/tera
time: [29.527 us 29.732 us 29.979 us]
change: [-0.2179% +0.8213% +2.0881%] (p = 0.16 > 0.05)
No change in performance detected.
bench_parsing_basic_template/render/liquid
time: [16.676 us 16.724 us 16.772 us]
change: [-1.2453% -0.7338% -0.3215%] (p = 0.00 < 0.05)
Change within noise threshold.
bench_rendering_only_variable/render/tera
time: [1.4250 us 1.4302 us 1.4351 us]
change: [-14.768% -12.240% -9.6021%] (p = 0.00 < 0.05)
Performance has improved.
bench_rendering_only_variable/render/liquid
time: [851.04 ns 859.36 ns 867.64 ns]
change: [+26.841% +28.148% +29.436%] (p = 0.00 < 0.05)
Performance has regressed.
bench_rendering_basic_templates/render/tera
time: [7.9776 us 8.2825 us 8.5379 us]
change: [+8.1702% +11.263% +14.601%] (p = 0.00 < 0.05)
Performance has regressed.
bench_rendering_basic_templates/render/liquid
time: [3.9680 us 3.9832 us 3.9992 us]
change: [+15.551% +16.062% +16.660%] (p = 0.00 < 0.05)
Performance has regressed.
bench_huge_loop/render/tera
time: [850.76 us 857.75 us 865.69 us]
change: [+0.4801% +0.9708% +1.5712%] (p = 0.00 < 0.05)
Change within noise threshold.
bench_huge_loop/render/liquid
time: [803.23 us 808.50 us 814.27 us]
change: [-32.892% -32.340% -31.777%] (p = 0.00 < 0.05)
Performance has improved.
bench_access_deep_object/render/tera
time: [5.5409 us 5.5652 us 5.5925 us]
change: [-3.5414% -2.1804% -1.0822%] (p = 0.00 < 0.05)
Performance has improved.
bench_access_deep_object/render/liquid
time: [4.2440 us 4.2770 us 4.3158 us]
change: [-43.376% -42.898% -42.391%] (p = 0.00 < 0.05)
Performance has improved.
bench_access_deep_object_with_literal/render/tera
time: [7.7474 us 7.7802 us 7.8141 us]
change: [+0.9487% +1.4115% +1.9242%] (p = 0.00 < 0.05)
Change within noise threshold.
bench_access_deep_object_with_literal/render/liquid
time: [6.2592 us 6.2853 us 6.3135 us]
change: [-48.596% -47.174% -45.635%] (p = 0.00 < 0.05)
Performance has improved.
{% include %}: Support for variable passing for (#310 closed by #424)
{% include %}: Support for variable passing for (#310 closed by #424){% forloop %}: Support for parentloop variable (#271 closed by #425)Conformance: support looping over nil (Fixes #294)
nil (Fixes #294)where filter is now being included when stdlib is requested.
where filter is now being included when stdlib is requested.Switched from ScalarCow using i32 to i64.
ScalarCow using i32 to i64.API
ScalarCow using i32 to i64.from_value(&dyn ValueView) to complement to_value(...) -> ValueValueView support was added to all integer typesSupport split on nil (see #403)
split on nil (see #403)This release resolves several planned breaking changes we've been holding off on. This doesn't make us ready for 1.0 yet but this closes the gap signi…
This release resolves several planned breaking changes we've been holding off on. This doesn't make us ready for 1.0 yet but this closes the gap significantly.
We're striving to match the liquid-ruby's behavior and this release gets us closer:
where filter implemented by or17191sort, sort_natural, compact, and other filters by or17191includes conformance. Before, it was a weird hybrid of jekyll and stdlib styles.{{ var.size }}In addition, we've made it more clear what filters, tags, and blocks are a part of core liquid, Jekyll's extensions, Shopify's extensions, or our own extensions.
liquidThe liquid crate has been stripped down to what is needed for parsing and rendering a template.
liquid_core was created as a convenience for plugin authors.liquid_lib has all plugins so liquid can focus on providing the stdlib
while non-stdlib plugins can more easily evolve.render can accept Rust-native typesPreviously, you had to construct a liquid::value::Object (a newtype for a HashMap) to pass to render. Now, you can create a struct that implements ObjectView and ValueView instead and pass it in:
#[derive(liquid::ObjectView, liquid::ValueView, serde::Serialize, serde::Deserialize, Debug)]
struct Data {
foo: i32,
bar: String,
}
let data = Data::default();
let template = todo!();
let s = template.render(&data)?;
In addition to the ergonomic improvements, this can help squeeze out the most performance:
HashMap entries.These improvements will be in the caller of liquid and don't show up in our benchmarks.
render ergonomic improvementsThere multiple convenient ways to construct your data, depending on your application:
let template = todo!();
// `Object` is a newtype for `HashMap` and has a similar interface.
let object = liquid::Object::new();
let s = template.render(&object)?;
let object = liquid::object!({
"foo" => 0,
"bar" => "Hello World",
});
let s = template.render(&object)?;
// Requires your struct implements `serde::Serialize`
let data = todo!();
let object = liquid::to_object(&data)?;
let s = template.render(&object)?;
// Using the aforementioned derive.
let data = Data::default();
let s = template.render(&data)?;
A core data type in liquid is an Object, a mapping of strings to Values. Strings used as keys within a template engine are:
size and capacity fields of a String. Box<str> is more appropriate.'static. Something like a Cow<'static, str>. Even better if it can preserve 'static getting a reference and going back to an owned value.Combining these together gives us the new kstring crate. Some quick benchmarking suggests
String (as a gauge of access time).'static or small string optimization.kstring types for small string and 'static optimizations.&dyn ValueViewliquid is stripped down to being about to parse and render. For tag, filter, and block plugins, liquid_core will have everything you need.Value to ValueView, ArrayView, and ObjectView.Date was renamed to DateTime.DateTime is now a newtype.liquid no longer exposes filters, tags, or blocks. Depend on liquid_lib and enable the relevant features to get them.ParserBuilders extra_filters and jekyll_filters are no more. Instead depend on liquid_lib, enable the extras, shopify, or jekyll features and manually add them.ParserBuilders with_liquid and liquid have been renamed to with_stdlib and stdlib.include tag was a hybrid of jekyll and liquid styles. Now there are separate jekyll and luquid plugins.ObjectView (#379).to_scalar and to_object functions along with existing to_value (#381).scalar, array, and object macros along with existing value (#381).ObjectView / ValueView (#385)..size (#136 fixed in #390).where filter (#291 fixed in #349)sort, sort_natural, compact now accept property parameter (#333, #334, #335 fixed in #352).'static lifetimes were relaxed (#367).sort order of nil was incorrect (#262 fixed in #352).sort should work on scalars (#250 fixed in #352).Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Reflection for tags/blocks (72f8cee8, closes #315, breaks #)
#### Features * jekyll-filter: slugify filter
comment: parse tags inside comment, but ignore their content
Indexing by variable (c216a439, closes #209)
.first and .last (36d79cf2)when (0e56f772)and and or (fb16a066)else (8577eb1e)WHITESPACE (7bec9871, closes #286, #280)Deeply nested array indexes (51c3a853, closes #230)
Nothing published for this version
context: Reduce scope of public API
error: Make API consumable by failure
if: Bare if is an existence check
#### Features * API: * Support &String->Scalar (b87c983c) * Re-export datetime
Value: Control key order (7ff0fcd0, closes #159)
Implement contains operator (a0d27205, closes #155)
filters: date can parse YYYY-MM-DD HH:MM:SS TTTT
* Update dependencies
parse: Error on empty expressions (5cffe44a, closes #139)
for: Re-enable support for object.access
nil: Equality logic missed a case
api: Make Renderable debuggable
Make TemplateRepository cloneable
syntax: Add arr[0] and obj["name"] indexing (PR #141, fixes #127)
Turn serde into a default feature. (6be99f1d, closes #128)
round accepts a precision param
<!-- next-url --> [Unreleased]: https://github.com/cobalt-org/liquid-rust/compare/v0.26.11...HEAD [0.26.11]: https://github.com/cobalt-org/liquid-rust/compare/v0.26.10...v0.26.11 [0.26.10]: https://github.com/cobalt-org/liquid-rust/compare/v0.26.9...v0.26.10 [0.26.9]: https://github.com/cobalt-org/liquid-rust/compare/v0.26.8...v0.26.9 [0.26.8]: https://github.com/cobalt-org/liquid-rust/compare/v0.26.7...v0.26.8 [0.26.7]: https://github.com/cobalt-org/liquid-rust/compare/v0.26.6...v0.26.7 [0.26.6]: https://github.com/assert-rs/predicates-rs/compare/v0.26.5...v0.26.6 [0.26.5]: https://github.com/assert-rs/predicates-rs/compare/v0.26.4...v0.26.5 [0.26.4]: https://github.com/assert-rs/predicates-rs/compare/v0.26.3...v0.26.4 [0.26.3]: https://github.com/assert-rs/predicates-rs/compare/v0.26.2...v0.26.3 [0.26.2]: https://github.com/assert-rs/predicates-rs/compare/v0.26.1...v0.26.2 [0.26.1]: https://github.com/assert-rs/predicates-rs/compare/v0.26.0...v0.26.1 [0.26.0]: https://github.com/assert-rs/predicates-rs/compare/v0.25.1...v0.26.0 [0.25.1]: https://github.com/assert-rs/predicates-rs/compare/v0.25.0...v0.25.1 [0.25.0]: https://github.com/assert-rs/predicates-rs/compare/v0.24.0...v0.25.0 [0.24.0]: https://github.com/assert-rs/predicates-rs/compare/v0.23.1...v0.24.0 [0.23.1]: https://github.com/assert-rs/predicates-rs/compare/v0.23.0...v0.23.1 [0.23.0]: https://github.com/assert-rs/predicates-rs/compare/v0.22.0...v0.23.0 [0.22.0]: https://github.com/assert-rs/predicates-rs/compare/v0.21.5...v0.22.0 [0.21.5]: https://github.com/assert-rs/predicates-rs/compare/v0.21.4...v0.21.5
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →