Skip to content

Releases: JPVenson/morestachio

Removal of obsolete code, QOL features, Bugfixes

22 Feb 00:48
Compare
Choose a tag to compare
  • Removed the #IFELSE keyword
  • 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
  • Added the #ELSEIF keyword as an conditional else within an #IF keyword. See https://github.com/JPVenson/morestachio/wiki/Keywords#else
  • 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
  • Reduced XML serialization size for partial documents
  • Fixed: /DECLARE tags would not be correctly reconstructed using the ToParsableStringDocumentVisitor
  • 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

Expression overhaul

18 Feb 00:20
Compare
Choose a tag to compare
Expression overhaul Pre-release
Pre-release

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
  • allows brackets in expressions
  • 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

this is an pre-release as there will be some performance improvements but it should be considered production ready.

Hotfix

14 Jan 09:33
Compare
Choose a tag to compare
  • Fixed a bug where Inline whitespace controls would have been executed twice

Instance formatters, Raw Escaping blocks, #Scope keyword and bugfixes

14 Jan 08:05
Compare
Choose a tag to compare
  • Morestachio can now link instance methods attributed with the [MorestachioFormatter]
  • Breaking change: removed support for options "TokenPrefix" & "TokenSuffix"
  • Added Escaping blocks. Everything within {{!?}} ... {{/!?}} block is treated as raw content and is exempt from parsing
  • Added Inline escaping. A token prefixed with {{?= ...}} is treated as raw content and is exempt from parsing
  • Fixed a NREX when accessing an variable that does not exist
  • Fixed the Inverted IF block not setting it context right
  • Updated the internal workings of block closing deserialization so more information is preserved for recombination of a template
  • Depricated the {{#PATH}} {{/PATH}} scoping syntax and replaced it with an explicit keyword #SCOPE. Please update your templates to use the {{#SCOPE path}} ... {{/SCOPE}} syntax. This version does still support the #PATH syntax.
  • Removed support for R# attributes
  • Added the TrimAll prefix and suffix --| and |--
  • Added Tag&Block base classes that support Regex for tokenizing
    • BlockRegexDocumentItemProviderBase
    • TagRegexDocumentItemProviderBase
  • Breaking change: Added the ParserOptions argument for all IPartialStore methods
  • Added Build-In console logger implementation
  • Added Build-In FileSystem backed PartialStore
  • Added additional formatters
    • Inflect
    • ByteStorageHumanzier

Bugfixes

03 Jan 17:25
Compare
Choose a tag to compare
  • #16 Fixed
  • NREX in Logger formatter fixed

Bugfixes, Whitespace Control, Custom Template Containers

29 Dec 14:32
Compare
Choose a tag to compare
  • Added missing ToParsableStringVisitor Implementation for #Switch, #Case, #Default blocks
  • Changed the Implementation of the Substring formatter to be more lenient in handling out of bounds arguments
  • Added the MorestachioFormatterService.ExceptionHandling property. It controls what should happen when a formatter throws an exception.
  • Added Delegate compilation. All IDocumentItems can implement the ISupportCustomCompilation interface. This is a WIP feature but fully tested. Expect changes to that comming.
  • Fixed Locations in all DocumentItems to be correctly reported now
  • Fixed #LOC, #LOCCULTURE and #LOCP tags&blocks to be case insensitive now
  • Fixed $Name & $recursion variables for Partials to be correctly reported when nesting Partials
  • Fixed a NullReferenceException when invoking an Operator that is not declared
  • Added bool.Not(bool value) formatter as an alias for the bool.Negate(bool value) formatter
  • Moved the IEnumerable<T>.Take<T>(IEnumerable<T> source, Number items) and the IEnumerable<T>.Skip<T>(IEnumerable<T> source, Number items) formatters from the DynamicLinq package to the predefined LinqFormatter as they do not require the external System.Dynamic.Linq package
  • Fixed string not parsing when the last argument at root expression
  • Fixed nested #IF calls can effect outside #ELSE blocks
  • Fixed Scopeing in Import
  • Added NullCoalescing Operator
  • Fixed Serialization for #CULTURE, #LOC and #LOCP
  • Added ITemplateContainer. This container can be set to provide a template from a source other then a string in memory like from a stream directly in a Low-Memory case
  • Fixed Expression not Compiling correctly when using self assignment and formats
  • Fixed Inverted Scope not be rendered by the ToParsableStringDocumentVisitor
  • Fixed bug where multithreadded use of MemoryTranslationResource could cause errors
  • Fixed Several bugs in DocumentVisitor and Expression Visitor
  • Added Get(object value, string path) formatter to dynamicly get an value from an object in the same way as Morestachio does
  • Added ScopeData as addable service
  • Added Logger interface and Logger Formatter Log(string category, string eventId, string message)
  • Added --| and |-- prefix and suffix whitespace control to replace the old behavior of -| and |-. Both old whitespace control operators will now only remove all whitespaces until they encounter the first linebreak.

Switch-Case and Import

28 Oct 02:00
Compare
Choose a tag to compare

In-Keyword Whitespace control and bugfixes

26 Sep 01:07
Compare
Choose a tag to compare

Bugfix

11 Sep 15:01
Compare
Choose a tag to compare
  • Fixed a bug where using Variables would update the variable

Bugfix and QOL features

04 Sep 21:38
Compare
Choose a tag to compare

This release contains a number of QOL features, additions to the Operator logic and some Bugfixes

  • Prepared Multipart streams for future parallel template processing
  • Added Fluent Api. This allows the direct modfication or creation of templates with cs code
  • Refactored Project structure (This may introduce breaks in using declarations)
  • Updated DynamicLinq formatter names (The old legacy lower case names are still provided)
  • Removed now obsolete Kind property from IDocumentItem
  • Added the Option to obtain all variables set within the template for bidirectional communication from your code to the template and back
  • Added at lot new pre definied formatters
  • Several Performance changes
  • Changed the ParserOptions to be of ISealed to prevent modifications after the template was begin to render
  • Added Build-In Optional support for Translations via the ParserOptions.RegisterLocalizationService() extension method
  • Added Block comments in template {{!}} comment {{/!}}
  • Added the {{#SET OPTION name = value}} tag to allow for options setting from the template in parsing time
  • Added Support for ICustomTypeDescriptor directly

Bugs:

  • Fixed bug where Numbers on non EN systems are not correctly parsed
  • Fixed experimental Operators bug where GreaterThen and LessThen was switched
  • Fixed experimental Operators bug where chained operators where not detected properly