Skip to content

Releases: JPVenson/morestachio

Enums, Performance and Global formatter

08 Aug 11:55
Compare
Choose a tag to compare

This release packs a lot of features and a lot of Performance optimizations .

Bugs:

  • It is no longer possible to add an formatter with a name that is not invokable from a template

Features:

  • Added a huge ammount of pre-defined formatters for common usage. See: https://github.com/JPVenson/morestachio/wiki/Predefined-Formatter
  • Added WITH options for INCLUDE to specify the scope the INCLUDE should be executed with
  • Added Support for distinct global formatters. These Formatters do not need an SourceObject and can be invoke anywhere
  • Added ##Let keyword
  • Added Block&Tag-DocumentItemProvider for easy extension
  • BREAKING CHANGE The FormatterService does no longer offer the option to enable case matching of name and now does this by default. If you need case insensitive matching please inhert from MorestachioFormatterService and implement your own matching logic
  • Numbers are now completely ParseTime and are now part of the expression itself with the ExpressionNumber
  • Updated Debugger Proxies
  • Experimental Added support for Operators. Operators are a special kind of formatters and must be explicitly declared with the [MorestachioOperatorAttribute]
  • Added new Project: Morestachio.Newtonsoft.Json containing an Json IValueResolver
  • Added new Project: Morestachio.Runner that wraps the Parse and Create calls
  • Added new Project: Morestachio.LessCompiler containing an Custom DocumentItem that can compile Less code
    • Supports JSON and .Net Dlls
  • Changed from Task to ValueTask for .NetCore dlls
  • Added Support for .NetCore3.1
  • Added TextOperations
    • Added NewLine Tag {{#NL}}
    • Added TrimNewLines/s Tags {{#TNL}} & {{#TNLS}}
  • BREAKING CHANGE The FormatterFrameworkService now operates in a more declarative way. Formatter calls should be Cached for reusage by Instead calling CallMostMatchingFormatter you should now call PrepareCallMostMatchingFormatter & Execute and cache the result of PrepareCallMostMatchingFormatter.
  • Added Helper classes for Invoice Generation: Worktime & Money

Bugfix Release

16 Jul 20:01
Compare
Choose a tag to compare

A Small Bugfix release:

Bugs:

  • Inverted scope did not accept an collection variable in certain cases
  • The Linq package did declare invalid Formatter names
  • In .Net Core the Unpack for tasks did not work

Features:

  • Added Autocomplete and Syntax highlighting for the Editor project
  • Removed unnessary c# references
  • Moved all possible Linq methods into the base lib as default formatter
  • Breaking Change Changed method names in Number.cs BiggerAs -> GreaterThen and SmallerAs -> SmallerThen

4.0.1

30 Jun 06:53
e25d39d
Compare
Choose a tag to compare

Breaking Changes:;

  • Refactored PartialStackOverflowBehavior to be outside ParserOptions
  • Refactored TokenType of TokenPair to be IComparable instead of the enum TokenType to support custom TokenTypes

Features:

  • Added {{DO expression}} ... {{/DO}} loop
  • Added {{WHILE expression}} ... {{/WHILE}} loop
  • Added Visitor api to IExpression
  • Added Visitor api to IDocumentItem
  • Updated the Linq project to contain all known Linq Functions as Formatter
  • Updated Number support. All numbers (either from Template or from data) are now convertable into a Number struct.
  • Added global Math functions for all kinds of numbers (see https://github.com/JPVenson/morestachio/wiki/Numbers,-null-and-booleans#numbers)
  • Added Service injection into Formatter via the [ExternalDataAttribute] (see https://github.com/JPVenson/morestachio/wiki/Formatter#formatter-service-injection)
  • Added support for Numbers, boolean and null syntax on parse-time rather evaluation in render-time
  • Updated error creation for Path evaluation on parse-time for more verbose path checking

Bugs:

  • Fixed Undisposed stream when using the Stringify methods

Expression Framework

13 Jun 12:27
Compare
Choose a tag to compare
Expression Framework Pre-release
Pre-release

Morestachio has undergone a major rewrite in how Expressions are parsed. It now offers the ExpressionTokenizer to parse single expressions that can be ether a Morestachio conform string (a string that starts with ether " or ' and ends with the same char that it started) or an expression.

  • Fixed #14
  • Fixed #13
  • Added Expression Renderer
  • Fixed several other bugs

3.0.0

09 Mar 02:39
Compare
Choose a tag to compare

In this release the new Formatter syntax is finalized, multible new language features where added and bugs

  • Performance improvements for long paths
  • Added support for Custom Document Items
  • [Breaking Change] Removed support for old Formatter syntax
  • Support for null values
  • Support for template variables
  • Support for Invariant formatter name lookup

Fluent Formatters

02 Nov 14:06
Compare
Choose a tag to compare
Fluent Formatters Pre-release
Pre-release

In this release a breaking change with the formatters will be introduced. Formatters should now be called as part of the path they are invoked.

  • Removed the FormatterMatcher and replaced it with a new Version of the MorestachioFormatterService
  • Besides its still possible to call formatters without an name, its recommanded to name any formatter accordingly to a Cs name
  • Numbers in Templates are nativ supported. Write {{123}} to get an Int32, or use it as part of an formatter argument
  • PartialStores allow precompiling certain partials and add them to an execution
  • ValueConverters can intercept an call to an Formatter and allow custom conversion
  • Keyword: IF & ELSE. Will only print its enclosing content it the expression results to the DefinitionOfTrue but will not set its scope to the result
  • Added XML DocumentTree Serialization support
  • Fixed #3
  • Fixed #6

IF-NotIF, Several Formatter Fixes, NetStandard & DocumentTree

13 Sep 00:48
Compare
Choose a tag to compare

In this Release are several improvements to Morestachio.

  • Morestachio is now a NetStandard Lib supporting following Frameworks: netstandard2.0;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;net46;net461;net462;net47;net471;net472;
  • There is an DocumentTree that will be returned by the Parser an can be Serialized
  • Several changes to the Formatter Syntax. All string arguments must be now escaped with ether " or ' and everything else is treated as an Expression.
  • Several fixes to the Formatters
  • Linebreaks and Tabs in and at the start/end of Expressions are now allowed
  • Custom Value resolvers were added to allow custom resolving from any object on a Global and/or per use case
  • New Syntax If and NotIf

Partials and .Net Core versions

15 Jan 12:04
Compare
Choose a tag to compare

In this release it is now possible to create Partials by declaring them with

{{#declare NAME}} Just your usual {{code}} {{/declare}} <-- this declares the partial
{{#include NAME}} <-- this prints the Partial on this place and in this scope
  1. It is now possible to format scopes with {{#path.to()}} {{/path.to()}}
  2. it is now possible to format inverted scopes with {{^path.to()}} {{/path.to()}}
  3. It is now possible to enumerate (or box) objects into a list with {{#each root.object.?}} {{Key}} {{Value}} {{/each}}
    This will make every object usable by a #each.
    a. For c# objects Key is the name of the Property and Value is value
    b. For Lists this will enumerate the list object NOT its items
    c. For Dictionary Key is Key and Value is Value
  4. Removed all references for cleanup ( only System.dll, Microsoft.CSharp and JetBrains.Annotations remains)
  5. Timeout added
  6. .Net Core and .Net Framework versions added ( both Morestachio code and Tests )
  7. Added Keyword $recursion that emits the level of recursion any partial is currently in
  8. Added Limit of recursion (defaults to 255) in ParserOptions

Formatter Framework Ex

23 Dec 23:20
Compare
Choose a tag to compare

In this release there are several changes to the old Mustachio. This is the first "official" release of Morestachio that differs from mustachio.
Summery:

  1. each value can be formatted by adding formatter the the morestachio
  2. Templates will be parsed as streams and will create a new stream. This is better when creating larger templates and best for web as you can also limit the length of the "to be" created template to a certain size
  3. Morestachio accepts any object besides the Dictionary<string,object> from mustachio.
  4. Root paths are supported, for examle {{#this.is.a.object}} {{~this.is.from.root}} {{/this.is.a.object}}
  5. Cancellation of Template generation is supported
  6. Async calls are supported
  7. No Reference to Newtonsoft ( this has proven problematic with other versions of the lib )
  8. No Reference to System.Web ( Rewritten to WebUtility as HttpUtility.HtmlEncode just calls WebUtility.HtmlEncode )
  9. Using of JetBrains Annotations for R# user ( if you are not a R# user just ignore this point )
  10. Supports user Encoding of the result template

Note:
Releases contain ALL parts of Morestachio including (Morestachio, Morestachio.Formatter.Framework and Morestachio.Formatter.Framework.Linq). To get distinct packages please use the Nuget packages as seen on the Home.