Lightweight, powerful, flavorful, template engine.
BlockLocation
that mark the closing tag of that blockTypeNameHandling = TypeNameHandling.Objects
setting from newtonsoft as it adds its own Type Discriminator#REPEAT
blocksThis release is only a version upgrade of all Newtonsoft.Json references that bump the version to 13.0.1 to mitigate the CWE-755.
When(bool, object, object)
formatter for single line conditional data outputContinuousIntegrationBuild
and Deterministic
options in msbuildTypeof
formatterThis release fixes the bug #21
$
in pathsArray.Empty
where applicable$index
StringBuilder
where applicable for performance and memory reasons#ForEach
loop. See https://github.com/JPVenson/morestachio/wiki/Keywords#each--foreach--every---blocks
ParserOptions
in IDocumentItem
during compile timeIValueResolver
that is set to an reflection based resolver per defaultThis update contains a number of Quality of life improvements and some minor changes to the internal architecture that aims for faster execution and more stable formatter execution as well as the usual expansion of build-in formatters.
[MethodName]
placeholder feature for Formatter names to be replaced with the C# name of the method it attributesServices
that contains the services for your template instead of beeing the service container itselfMorestachioPropertyListResolver
class for whitelisting properties[ServiceNameAttribute]
to define a custom name for a service within your templateIMorestachioExpression
as an argument instead of the valuelistOfData.Where(e => e.item == true)
. The formatter must accept a MorestachioTemplateExpression
as the parameter type#DO
, #WHILE
, #REPEAT
to get the correct collection scopeDataAccessAnalyzer
you can now analyize the whole expression tree to get all property paths and formatters that are called.This Update contains a number of smaller improvements, Performance fixes, QOL features and a the addition of renderes.
CharacterLocation
ReadOnlySpan<char>
in the ByteCounterStream for compatible .Net versionsIRenderer.RenderAsync()
ByteCounterTextWriter
and ByteCounterStringBuilder
for pure In-Memory generation. (both are way faster than the ByteCounterStream
)this
replacement for .
self referencingWith
formatter for list creationFormatterService
s service interface from IServiceProvider
to IServiceContainer
This mayor release contains a mayor rewrite of the expression parser, adding an tokenizer that greatly simplifies the tokenizing and parsing steps for expressions. This also results in a 20% performance improvement in small-medium sized expressions (<500 chars) but is slower for larger expressions. It also fixes a lot of bugs with the experimental operator feature and adds brackets for expressions.
Added predefined Path formatter
Added ParserOptions.UnmatchedTagBehavior
Added $services
variable for direct access to services instances from template
Added Optional FileSystemService
for direct file access from within the template
Added Brackets in expression for grouping
Added AsObject
formatter to convert IDictionary<string, object> into c# objects
Added null placeholder update within template by setting the $null
variable: {{#var $null = 'DD'}}
Added Expression tokenizer and parser
Added the #ELSEIF
keyword as an conditional else within an #IF
keyword. See
github.com/JPVenson/morestachio/wiki/Keywords#else
Added the this
keyword as a replacement for the self referencing {{.}}
syntax.
Removed the #IFELSE
keyword
Removed the obsolete .()
ToString formatter. This is possibly a breaking change if you did not update your formatter calls earlier. Just insert .ToString()
to get the same behavior
Changed the #ELSE
keyword so that it has the be written as a child of an #IF
keyword. See https://github.com/JPVenson/morestachio/wiki/Keywords#else
Changed the behavior of the IfDocumentItem
and added the Inverted property so it can replace the IfNotDocumentItem
Reduced XML serialization size for partial documents
Fixed: /DECLARE
tags would not be correctly reconstructed using the ToParsableStringDocumentVisitor