Skip to content

Switch to ValueTuple/Func/ReadOnlyMemory; Add StreamId, StringId, Union

Compare
Choose a tag to compare
@bartelink bartelink released this 18 Mar 23:51
· 8 commits to master since this release

NOTE: These release notes summarize the more detailed ones per -rc increment included in the CHANGELOG.md

TL;DR this release adds features and applies some associated tweaks with the following objectives:

  • Exposes a StreamId to go with the lower-level StreamName abstraction, which forms part of the Equinox V4 Programming Model, streamlining how identity types get mapped to stream names
  • Migrates from byte[] Event Bodies to System.ReadOnlyMemory - this is the default body types for most Equinox V4 stores, and for Propulsion V3
  • Updates minimum Newtonsoft.Json dependency to silence security scanners
  • Pushes various pieces e.g. Union and TypeSafeEnum (which started life as independent implementations per concrete Codec) to the core module
  • Removes usage of F#-specific and/or otherwise deprecated types from the public interface (FSharpFunc->Func, System.Tuple->System.ValueTuple)

Added

  • Codec.Create: Exposed low level overload for infrastructure use
  • Core.EventData/TimelineEvent/EventCodec.Map: Exposed building blocks for mapping event envelopes and/or codecs over Body Format types #77
  • Core.TimelineEvent.Create: Add overload to create an ITimelineEvent given the additional properties to go with a set of baseline data from an IEventData
  • Core.EventData/TimelineEvent: Exposed default ctors #83
  • NewtonsoftJson.StringEnumConverter.Create: Small wrapper to smooth construction syntax #111
  • NewtonsoftJson.Serdes.Deserialize<'T>(Newtonsoft.Json.Linq.JObject): One liner #111
  • NewtonsoftJson.StringIdConverter: Converter for StringId #119
  • Serdes: Add SerializeToStream and DeserializeFromStream #83 🙏 @deviousasti
  • StreamId: type-tagged wrapper for the streamId portion of a StreamName #100
  • StreamName.Category + category: Extracts the category portion of a streamName #85
  • StreamName.Category: covers aspects of StreamName pertaining to the {category} portion (mainly moved from StreamName.* equivalents; see Changed) #100
  • StreamName.Split: Splits a StreamName into its {category} and {streamId} portions, using StreamId for the latter. Replaces CategoryAndId #100
  • StreamName.tryFind: Helper to implement Stream.tryDecode / Reactions.For pattern (to implement validation of StreamId format when parsing StreamNames). (See README) #100
  • StringId, Comparable: Base types for Strongly Typed Ids with string renditions #119
  • SystemTextJson.CodecJsonElement: Maps Unions to/from Events with JsonElement Bodies as SystemTextJson.Codec did in in 2.x #75
  • SystemTextJson.Options.Create: Add rejectNullStrings option, which wires in a RejectNullStringConverter #87 🙏 @nordfjord
  • SystemTextJson.StringIdConverter: Converter for StringId #119
  • SystemTextJson.StringIdOrDictionaryKeyConverter: Converter for StringId that enables Dictionary values using a StringId-derived type as a key to be used as a JSON Object Key #116
  • SystemTextJson.ToUtf8Codec: Adapter to map from JsonElement to ReadOnlyMemory<byte> Event Bodies (for interop scenarios; ideally one uses SystemTextJson.Codec directly in the first instance) #75
  • TimelineEvent.Size: Enables stores to surface the stored size at the point of loading #82
  • TypeSafeEnum.caseValues<'t>: Yields all values of a union (that is a TypeSafeEnum) #115
  • TypeSafeEnum.tryParseF/parseF: parameterizes matching of the Union Case name (to enable e.g. case insensitive matching) #101
  • Union: Exposed internal type, featuring isUnion, isNullary, and caseName (that's not tied to TypeSafeEnum), #102

Changed

  • Rename Deflate.EncodeTryDeflate -> Compression.EncodeTryCompress #105 #80 🙏 @nordfjord
  • updated TypeShape reference to v 10, triggering min FSharp.Core target moving to 4.5.4
  • replace all FSharpFunc usage with Func #92 #105
  • BREAKING: JsonPickler/JsonIsomorphism/UnionConverter: Reduced greediness of Type matching (only honors tags placed on the type being serialized, not parents) #113
  • Compression: Switched encoding to use Brotli Compression (Deflate compressed content can still be inflated, but will no longer be generated) #105
  • Option/Tuple: Replace with ValueOption/ValueTuple #82
  • Codec.Create: Made timestamp mandatory in low level up / down signature #83
  • Codec 'Context: replace 'Context option with Context #82
  • IEventCodec.TryDecode: Rename to Decode (to align with the primary assumption of a Try prefix per BCL conventions: It won't throw, no matter what!) #107 🙏 @nordfjord
  • NewtonsoftJson: Rename Settings to Options #60 #76
  • NewtonsoftJson: Upped minimum Newtonsoft.Json version to 13.0.3 per GitHub advisory database #109
  • NewtonsoftJson.Codec: Switched Event body type from byte[] to ReadOnlyMemory<byte> #75
  • NewtonsoftJson.Options: Change all settings (inc CreateDefault) to set DateParseHandling = DateParseHandling.None in order to work around the hare-brained default #110
  • NewtonsoftJson.TypeSafeEnum: Sync with SystemTextJson.TypeSafeEnum #91
  • StreamName: breaking changes to reflect introduction of strongly typed StreamId #100
  • StreamName.trySplitCategoryAndId: renames: trySplitCategoryAndStreamId -> Internal.tryParse; splitCategoryAndStreamId -> split; CategoryAndId -> Split; Categorized|NotCategorized-> Internal.*; category->Category.ofStreamName, IdElements -> StreamId.Parse #100
  • SystemTextJson.Codec: Switched Event body type from JsonElement to ReadOnlyMemory<byte> #75
  • SystemTextJson.Options: Move custom converters after specified options #111
  • SystemTextJson.UnionOrTypeSafeEnumConverterFactory: Allow specific converters to override global policy #101
  • ToByteArrayCodec: now adapts a ReadOnlyMemory<byte> encoder (was from JsonElement) (to byte[] bodies); Moved from FsCodec.SystemTextJson to FsCodec.Box #75
  • TypeSafeEnum: Merged two impls from SystemTextJson and NewtonsoftJson #102

Removed

  • net461 support #60 #76
  • StreamName.CategoryAndIds: See new StreamId, StreamId.Elements #100

Fixed

New Contributors

Full Changelog: 2.3.2...3.0.0