With this release, the fork rinja got merged back into the main project. Please have a look at our blog post for more information about the split and the merge.
What's Changed
This release (v0.13.0), when compared to the last stable askama release (v0.12.1), consists of:
- over 1000 commits
- with changes in over 500 files
- with over 40k additions and 8000 deletions
Compared to rinja v0.3.5
- Rename
rinja
intoaskama
by @GuillaumeGomez in #353 - Bump version number to 0.13.0 by @Kijewski in #382
Major added and improved features:
- Add support for "runtime" values by @GuillaumeGomez in #311
- Implement
enum
variants by @Kijewski in #255 - Relax
filesizeformat
filter requirements by @GuillaumeGomez in #216 - derive: implement template attribute
blocks
by @Kijewski in #337 - Add concat operator
~
by @Kijewski in #236 - Remove restriction preventing to have | surrounded by whistespace characters by @GuillaumeGomez in #250
- Make rinja
#![no_std]
compatible by @Kijewski in #286 - Make
derive
optional by @Kijewski in #342
More added and improved features:
- Let
FastWritable
propagate custom errors by @Kijewski in #217 - Implement
PrimitiveType
for non-zero integers by @Kijewski in #220 - Implement
AsIndent
forNonZeroUsize
andWrapping<usize>
by @Kijewski in #221 - Implement
HtmlSafe
for all reference wrappers by @Kijewski in #219 - Add support for default value in macros by @GuillaumeGomez in #207
- parser: allow whitespace control on
extends
by @Kijewski in #241 - Allow idents to start with
_
by @GuillaumeGomez in #244 std::num::Saturating
is stable since rust 1.74 by @Kijewski in #270- Make working with
Error
s a bit easier by @Kijewski in #277 - Add full support for if let chain feature by @GuillaumeGomez in #296
- Make filters
|fmt
and|format
available with feature"alloc"
, but without"std"
by @Kijewski in #319 - Add support for generics syntax in parser by @GuillaumeGomez in #317
- derive: add ".askama" to list of HTML extensions by @Kijewski in #321
- derive: for
enum
s, letSelf
refer to the original type by @Kijewski in #333 - derive: add option to specify
rinja
path by @Kijewski in #334 - Implement
Values
for all collection types by @Kijewski in #346 - Revive
askama_escaped
by @Kijewski in #378
Removed features:
- Remove
EXTENSION
constant fromTemplate
by @Kijewski in #252 - parser: remove obsolete parser fuzzing by @Kijewski in #261
- Remove integrations and
MIME_TYPE
guessing by @Kijewski in #271 - parser: deny all rust keywords as target names and add
gen
to keywords by @Kijewski in #294
Performance:
- Omit
fmt::Formatter
machinery in URL encoding by @Kijewski in #218 - filters: don't collect into intermediate
String
if we can help it by @Kijewski in #235 - parser: use built-in whitespace trimming by @Kijewski in #238
- derive: some clean-ups and optimizations by @Kijewski in #260
- parser: shrink the size of
WithSpan
to one register by @Kijewski in #257 - derive: less
format!()
, shorter context on error by @Kijewski in #276 - Speed-up HTML escaping a bit by @Kijewski in #301
- Remove intermediate allocations for error messages by @Kijewski in #322
- derive: some optimizations by @Kijewski in #338
- Allow parallel compilation of
serde
andserde_derive
by @Kijewski in #343
Safety and correctness:
- parser: reject excessively long syntax delimiters by @Kijewski in #230
- derive: reject
union
s as they requireunsafe
code by @Kijewski in #231 - Canonicalize include paths before emitting by @Kijewski in #258
- fix: normalize macro args on call (fixes #259) by @chrisp60 in #262
- derive: a safe-guard to disable bindings a unit struct was expected by @Kijewski in #269
- Canonicalize paths to ensure includes behave as expected when folders are involved by @LukeMathWalker in #289
- derive: reserve variable prefix
__rinja
and free namewriter
by @Kijewski in #292 - parser: use drop guards to track nesting level by @Kijewski in #297
- parser: fix excessive filter blocks by @Kijewski in #304
- parser: add missing level guard in
if let
by @Kijewski in #332 - Replace
from_utf8_unsafe()
withAsciiStr
by @Kijewski in #351 - Allow variables inheritance in block by @GuillaumeGomez in #264
- Fix minimum supported
syn
version by @paolobarbolini in #379
Documentation, our book, and examples:
- Fix crate version numbers in book by @BD103 in #212
- Add link to blog post for differences between rinja and askama by @GuillaumeGomez in #233
- book: pin to mdbook v0.4.40 for now and add table of contents to pages by @Kijewski in #240
- Fix integrations book chapter by @GuillaumeGomez in #249
- Add missing "Escapers" title in the book by @GuillaumeGomez in #248
- book: add
upgrading.md
by @Kijewski in #303 - book: document
blocks
by @Kijewski in #340 - Add bleeding edge API documentation to rtd by @Kijewski in #363
- docs: update twig's URL by @Kijewski in #364
- Update askama_playground URL by @Kijewski in #368
- book: mention
askama_web
by @Kijewski in #369 - book: fix article link by @Kijewski in #372
- fix toml features field in the filters chapter of the book by @bionicles in #373
- Add link to blog post explaining merge of rinja and askama by @GuillaumeGomez in #374
- Remove "Using integrations" part in book by @GuillaumeGomez in #310
- examples: add {axum,poem,rocket,warp} by translating the actix-web example; book: add frameworks section by @Kijewski in #308
- Add salvo example by translating the axum example by @Kijewski in #313
- docs: fix recursive example in template_syntax.md by @m4tx in #315
- book: a features section by @Kijewski in #316
- "object safe" is now "dyn-compatible" by @Kijewski in #199
- Rename
Escaper
argumentfmt
intodest
by @Kijewski in #349
Testing:
- Move types into their tests by @GuillaumeGomez in #228
- ci: add cluster-fuzz integration by @Kijewski in #229
- ci: group checks in fast, average and slow by @Kijewski in #305
- Update ui tests for rust 1.84, and deprecations in winnow 0.6.24 by @Kijewski in #312
- ci: ignore typos in librustdoc sources by @Kijewski in #360
- Add failing test from issue 272 by @Kijewski in #278
- Update fuzzing corpus URL by @Kijewski in #361
- ci: re-enable
Cluster-Fuzz
by @Kijewski in #376 - ci: ensure that github CI config is safe using zizmor by @Kijewski in #380
- ci: fix up to #380 by @Kijewski in #381
Migrate to from nom to winnow
- Migrate to from Nom 7 to Winnow 0.3 by @epage in #209
- Upgrade from Winnow 0.3 to 0.4 by @epage in #210
- refactor(parser): Clean up prep for 0.5 by @epage in #213
- refactor(parser): Clean up prep for 0.5 by @epage in #226
- refactor(parser): Move off of deprecated re-export by @epage in #234
- refactor(parser): Remove redundant closure by @epage in #242
- refactor(parser): Be explicit about
i
nput state by @epage in #275 - Upgrade from Winnow 0.4 to 0.5 by @epage in #214
- refactor(parser): Upgrade to Winnow 0.6 by @epage in #291
- chore: Upgrade to Winnow 0.7 by @epage in #330
Refactoring, error messages, and changes invisible to the user:
- derive: refactor
#[template]
parsing by @Kijewski in #243 - derive: refactor generator for greater re-usability by @Kijewski in #253
- derive standalone: opt out of native
proc-macro
support by @Kijewski in #268 - Second round of optimizations extracted from PR to implement
enum
variants by @Kijewski in #266 - derive: remove generics injection for
write_header()
by @Kijewski in #274 - Fix clippy warnings in rust nightly 1.85 by @Kijewski in #284
- Use cargo reference manifest section order by @Kijewski in #285
- derive: fix typo that mixes up
uppercase
andurlencode
by @Kijewski in #287 - derive: use
file_info
infind_template
by @Kijewski in #290 - Improve reserved variable name error message by @GuillaumeGomez in #293
- parser: add better error messages for broken closing block tags by @Kijewski in #239
- Improve error message when an extension escaper is missing by @GuillaumeGomez in #247
- derive: fix typos and unify error messages by @Kijewski in #251
- derive: split generator implementation into 3 files by @Kijewski in #295
- derive: keep track of called macros by @Kijewski in #299
- Fix
block_in_include
and add explanations on what is going on by @GuillaumeGomez in #279 - Minor clean-ups by @Kijewski in #327
- Fix rust 1.86 clippy warnings by @Kijewski in #331
- Improve macro call arguments mismatch errors by @GuillaumeGomez in #325
- Improve code readability by @GuillaumeGomez in #339
- derive: fail if requested template block is missing by @Kijewski in #341
- Don't format with
overflow_delimited_expr
by @Kijewski in #350 - build(deps): update pulldown-cmark requirement from 0.12.0 to 0.13.0 by @dependabot in #352
New Contributors
- @epage made their first contribution in #209
- @BD103 made their first contribution in #212
- @chrisp60 made their first contribution in #262
- @LukeMathWalker made their first contribution in #289
- @m4tx made their first contribution in #315
- @bionicles made their first contribution in #373
- @paolobarbolini made their first contribution in #379
Full Changelog: v0.3.5...v0.13.0