Skip to content

Releases: andywilsonuk/StringTokenFormatter

v9.0

10 Mar 18:10

Choose a tag to compare

For breaking changes, see v9 migration notes.

  • Lowered .NET requrement thanks to Polysharp
  • Feature parity with string.Format for better performance
  • Introduced Commands (replacement for Block Commands)
    • New Map command for inline value mapping
    • Reworked Loop command to support sequences
  • Formatter Definitions provide strongly-typed formatters in preference to custom format providers
    • Added TokenValueFormatException to handle formatting errors
  • Improved library usability
    • InterpolatedStringResolver fleshed out to become preferred method over string extensions
    • TokenValueContainerBuilder is now fluent
    • Value Converters now support any function return type not just Func<string> and Func<object>
    • General convenience methods added
    • ObjectTokenValueContainer support for structs
  • Better validation of Settings and arguments
    • Settings can also be validation ahead of use
  • Internal structure improvements

v8.0

15 Jan 17:15
159bfbc

Choose a tag to compare

Reworked InterpolatedStringExpander for Block Commands

  • Conditional block command replacing conditional prefixed token
  • Loop block command
  • ExpanderContext implementation
  • ExpandedStringBuilder wraps StringBuilder

InterpolatedString

  • InterpolatedStringSegment is now abstract with addition concrete types
  • Tokens method updated to support block commands

Quality improvements

  • Better input validation throughout
  • Additional exception types and more consistent usages
  • Tests now run against both .net 8 and .net framework 4.8

FrozenDictionary support in .net 8

TokenValueContainers

  • Enforced TokenValueContainerFactory usage
  • TokenValueContainer classes are now sealed with private constructors
  • Frozen method on DictionaryTokenValueContainer and ObjectTokenValueContainer in .net 8

TokenValueConverters

  • Renamed factory to TokenValueConverterFactory for better consistency
  • Added ToStringConverter for easier support of classes with overridden ToString methods

v7.3

12 Dec 10:18

Choose a tag to compare

  • Changed net48 target framework to netstandard2.0 (still needs C# 10)
  • Added Parser support for .net7 regex source generation
  • Updated default Condition token start and end markers to avoid conflict with format separator
  • Tokens HashSet now strips Condition token markers
  • Reworked Expander for performance and readability
  • Added exception when token value cannot be converted due to missing converter

v7.2

05 Dec 22:37
8892684

Choose a tag to compare

  • Added composite container builder TokenValueContainerBuilder with hierarchical container support (finally!)
  • Supported ValueTuple as key/value pairs throughout
  • Added Default settings property
  • Added Tokenize method as TokenSyntax extension to get wrapped token names
  • Replaced Moq with fakes to aid readability
  • Bumped Test project nuget packages

v7.1

13 Nov 16:10
ec2cbd2

Choose a tag to compare

  • Added Conditions, see additional features
  • Added better FormatException handling including new default setting to throw on format error

v7.0

29 Oct 13:59
87611fe

Choose a tag to compare

v7.0

v6.1

29 Oct 13:56

Choose a tag to compare

Re-added sign key