Skip to content

Releases: JPVenson/morestachio

5.0.1.631 Token location refactoring, Serialization refactoring and addition of Xml & System.Text.Json value converter

01 Aug 14:59
f92896c
Compare
Choose a tag to compare
  • Refactored indexing.
    • The new indexing does always include ranges within the template and are more verbose.
    • Tag Document items do now have information on the start and end of the whole tag embedded
    • Block Document items have a new property BlockLocation that mark the closing tag of that block
  • Refactored XML and Json serialization.
    • Json serialization does no longer depend on the TypeNameHandling = TypeNameHandling.Objects setting from newtonsoft as it adds its own Type Discriminator
    • Added support for System.Text.Json serialization
    • Added support for Nullable type serialization.
  • Added additional Number.cs formatters such as "IsIntegralNumber", "IsFloatingPointNumber", "AsFloatingPointNumber"
  • Added support for Numbers to be used with #REPEAT blocks
  • Added additional Linq formatter
  • Breaking Change: Updated Inheritance for Block/Tag document items. Only block documents now declare a Children property.

5.0.1.622 Newtonsoft.Json Update CWE-755

23 Jun 06:06
e54c52a
Compare
Choose a tag to compare

This release is only a version upgrade of all Newtonsoft.Json references that bump the version to 13.0.1 to mitigate the CWE-755.

5.0.1.615 External Integrations

15 Jun 17:01
4f74555
Compare
Choose a tag to compare
  • Added Handling for PartialsStoreAggregator and MultiValueResolver in ParserOptionsBuilder
  • Added Handling for ListLogger in ParserOptionsBuilder
  • Added Nuget Package for System.Text.Json support
  • Added Nuget Package for System.Xml support
  • Added Nuget Package for Microsoft.Extensions.Logging
  • Added proper symbol packages to nuget
  • Added When(bool, object, object) formatter for single line conditional data output
  • Improved generics type inheritance matching in Formatters
  • Improved Logger usage with explicit Interpolated string handling
  • Refactored usage of ConfigureAwait(false)
  • Fixed invalid calling case to a Instance formatter when the invoking object is not the correct instance
  • Set CI build to use ContinuousIntegrationBuild and Deterministic options in msbuild
  • Discontinued the support for the data parameter in logging. The methods are still present but marked Obsolete.

5.0.1.589 ParserOptionsBuilder

12 May 09:48
6644a44
Compare
Choose a tag to compare
  • BreakingChange: Added ParserOptionsBuilder with fluid syntax to create ParserOptions
  • Added ParserOptionsError serialization
  • Added FormatterService parent with default of the default FormatterService
  • Added Typeof formatter
  • Added Allowed currencies to be added or substracted when one is more defined then the other
  • Added IMorestachioExpression as option for TokenOption
  • Fixed Logger warning on Inverted scope
  • Fixed HashWith formatter

5.0.1.577 Hotfix #21

29 Apr 09:30
58a7806
Compare
Choose a tag to compare

This release fixes the bug #21

5.0.1.570 Bugfixes & Performance Improvments

09 Apr 10:25
34a3b2a
Compare
Choose a tag to compare
  • Fixed: Generics for Formatters not matched under certain conditions
  • Fixed: Xml persistent tokens not properly serialized
  • Fixed: Tokenizer not always respecting special variables $ in paths
  • Fixed: Runner nuget package referencing the Test project
  • Removed explicit references to .NetFramework. Compatibility is ensured via .NetStandard
  • Improved usage of Array.Empty where applicable
  • Improved access to special collection variables like $index
  • Improved tokenizer to use shared StringBuilder where applicable for performance and memory reasons
  • Improved several places for performance
  • Added Tests
  • Added #ForEach loop. See https://github.com/JPVenson/morestachio/wiki/Keywords#each--foreach--every---blocks
  • Added access to ParserOptions in IDocumentItem during compile time
  • Added Fallback IValueResolver that is set to an reflection based resolver per default

QOL Features

20 Oct 00:21
Compare
Choose a tag to compare

This 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.

  • Added the [MethodName] placeholder feature for Formatter names to be replaced with the C# name of the method it attributes
  • Updated the Predefined Formatter wiki
  • Added the CryptService for encrypting data with AES
  • Added the HashService to hash data with several algorithms
  • Added Constants. Constants are read only variables provided by the invoker that exists alongside the root object.
  • BREAKING CHANGE: The MorestachioFormatterService now has a property Services that contains the services for your template instead of beeing the service container itself
  • Added methods to evaluate most values at compile time instead of runtime. This prolongs the compiling process but speeds up the execution significantly.
  • Fixed: The name of a #Import partial is now properly handled when null
  • Fixed: The value of a #Culture is now properly handled when null
  • Added a base MorestachioPropertyListResolver class for whitelisting properties
  • Added Currency to the Money type
  • Added the [ServiceNameAttribute] to define a custom name for a service within your template
  • Allowed a formatter to get the original IMorestachioExpression as an argument instead of the value
  • Allowed the use of lambda generation from template. You can now create a lambda function in your template and provide it to a formatter like listOfData.Where(e => e.item == true). The formatter must accept a MorestachioTemplateExpression as the parameter type
  • Allowed alias to be set on #DO, #WHILE, #REPEAT to get the correct collection scope
  • Added UsageReport. Using the DataAccessAnalyzer you can now analyize the whole expression tree to get all property paths and formatters that are called.

Performance, Custom Renderes, Isolation, Bugfixes

02 May 14:04
Compare
Choose a tag to compare

This Update contains a number of smaller improvements, Performance fixes, QOL features and a the addition of renderes.

  • Added an Index property to CharacterLocation
  • Fixed the NullCoalescing Operator
  • Added global Formatter "ParseBool" that will parse a string containing ether "true","yes","valid" or "1" to true otherwise to false.
  • Added Isolation keyword. See: https://github.com/JPVenson/morestachio/wiki/Keywords#isolation---block
  • Fixed an StackOverflow in Tokenizer
  • Added IDocumentCompiler and IRenderer see: https://github.com/JPVenson/morestachio/wiki/IRenderer-and-IDocumentCompiler
  • Performance improvement for Path handing in CompiledRenderer
  • Performance improvement for Expression execution in CompiledRenderer
  • Performance improvement for EachDocument loop
  • Breaking Change: Removed the AbortGeneration property
  • Breaking Change: Expressions no longer overwrites the ToString method but uses the DebuggerProxys ToString method
  • Huge Performance Improvement with the usage of ReadOnlySpan<char> in the ByteCounterStream for compatible .Net versions
  • TextInstructions are now added to the Content as a Child instead of being an distinct DocumentItem
  • Breaking Change: Moved the ParserOptions property from ContextObject to ScopeData
  • Bugfix: AsyncPartialStore now uses ValueTask where applicable
  • EachDocument now reuses its Context object
  • NumberExpression and StringExpression now evaluates its ContextObject in CompileTime instead of RenderTime
  • Feature: It is now possible to overwrite the TargetStream directly when calling IRenderer.RenderAsync()
  • Feature: Added ByteCounterTextWriter and ByteCounterStringBuilder for pure In-Memory generation. (both are way faster than the ByteCounterStream)
  • Feature: All build-in ByteCounters overwrite the ToString method to to allow easy result-to-string generation
  • Added .Net-Configuration transformation with Morestachio (WIP)

Hotfix and QOL

03 Mar 12:09
Compare
Choose a tag to compare
  • Fixed endless running TokenParser when encountering a single expression containing only one string opening
  • Added this replacement for . self referencing
  • Added With formatter for list creation
  • Changed the FormatterServices service interface from IServiceProvider to IServiceContainer

5.0.0 Release

24 Feb 20:16
Compare
Choose a tag to compare

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