Switch to ValueTuple/Func/ReadOnlyMemory; Add StreamId, StringId, Union
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-levelStreamName
abstraction, which forms part of the Equinox V4 Programming Model, streamlining how identity types get mapped to stream names - Migrates from
byte[]
Event Bodies toSystem.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
andTypeSafeEnum
(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 useCore.EventData/TimelineEvent/EventCodec.Map
: Exposed building blocks for mapping event envelopes and/or codecs over Body Format types #77Core.TimelineEvent.Create
: Add overload to create anITimelineEvent
given the additional properties to go with a set of baseline data from anIEventData
Core.EventData/TimelineEvent
: Exposed default ctors #83NewtonsoftJson.StringEnumConverter.Create
: Small wrapper to smooth construction syntax #111NewtonsoftJson.Serdes.Deserialize<'T>(Newtonsoft.Json.Linq.JObject)
: One liner #111NewtonsoftJson.StringIdConverter
: Converter forStringId
#119Serdes
: AddSerializeToStream
andDeserializeFromStream
#83 🙏 @deviousastiStreamId
: type-tagged wrapper for the streamId portion of aStreamName
#100StreamName.Category
+category
: Extracts the category portion of a streamName #85StreamName.Category
: covers aspects ofStreamName
pertaining to the{category}
portion (mainly moved fromStreamName
.* equivalents; see Changed) #100StreamName.Split
: Splits a StreamName into its{category}
and{streamId}
portions, usingStreamId
for the latter. ReplacesCategoryAndId
#100StreamName.tryFind
: Helper to implementStream.tryDecode
/Reactions.For
pattern (to implement validation of StreamId format when parsingStreamName
s). (See README) #100StringId, Comparable
: Base types for Strongly Typed Ids with string renditions #119SystemTextJson.CodecJsonElement
: Maps Unions to/from Events withJsonElement
Bodies asSystemTextJson.Codec
did in in2.x
#75SystemTextJson.Options.Create
: AddrejectNullStrings
option, which wires in aRejectNullStringConverter
#87 🙏 @nordfjordSystemTextJson.StringIdConverter
: Converter forStringId
#119SystemTextJson.StringIdOrDictionaryKeyConverter
: Converter forStringId
that enablesDictionary
values using aStringId
-derived type as a key to be used as a JSON Object Key #116SystemTextJson.ToUtf8Codec
: Adapter to map fromJsonElement
toReadOnlyMemory<byte>
Event Bodies (for interop scenarios; ideally one usesSystemTextJson.Codec
directly in the first instance) #75TimelineEvent.Size
: Enables stores to surface the stored size at the point of loading #82TypeSafeEnum.caseValues<'t>
: Yields all values of a union (that is aTypeSafeEnum
) #115TypeSafeEnum.tryParseF/parseF
: parameterizes matching of the Union Case name (to enable e.g. case insensitive matching) #101Union
: Exposed internal type, featuringisUnion
,isNullary
, andcaseName
(that's not tied toTypeSafeEnum
), #102
Changed
- Rename
Deflate.EncodeTryDeflate
->Compression.EncodeTryCompress
#105 #80 🙏 @nordfjord - updated
TypeShape
reference to v10
, triggering minFSharp.Core
target moving to4.5.4
- replace all
FSharpFunc
usage withFunc
#92 #105 BREAKING: JsonPickler/JsonIsomorphism/UnionConverter
: Reduced greediness ofType
matching (only honors tags placed on the type being serialized, not parents) #113Compression
: Switched encoding to use Brotli Compression (Deflate compressed content can still be inflated, but will no longer be generated) #105Option/Tuple
: Replace withValueOption
/ValueTuple
#82Codec.Create
: Made timestamp mandatory in low levelup
/down
signature #83Codec 'Context
: replace'Context option
withContext
#82IEventCodec.TryDecode
: Rename toDecode
(to align with the primary assumption of aTry
prefix per BCL conventions: It won't throw, no matter what!) #107 🙏 @nordfjordNewtonsoftJson
: RenameSettings
toOptions
#60 #76NewtonsoftJson
: Upped minimumNewtonsoft.Json
version to13.0.3
per GitHub advisory database #109NewtonsoftJson.Codec
: Switched Event body type frombyte[]
toReadOnlyMemory<byte>
#75NewtonsoftJson.Options
: Change all settings (incCreateDefault
) to setDateParseHandling = DateParseHandling.None
in order to work around the hare-brained default #110NewtonsoftJson.TypeSafeEnum
: Sync withSystemTextJson.TypeSafeEnum
#91StreamName
: breaking changes to reflect introduction of strongly typedStreamId
#100StreamName.trySplitCategoryAndId
: renames:trySplitCategoryAndStreamId
->Internal.tryParse
;splitCategoryAndStreamId
->split
;CategoryAndId
->Split
;Categorized|NotCategorized
->Internal
.*;category
->Category.ofStreamName
,IdElements
->StreamId.Parse
#100SystemTextJson.Codec
: Switched Event body type fromJsonElement
toReadOnlyMemory<byte>
#75SystemTextJson.Options
: Move custom converters after specified options #111SystemTextJson.UnionOrTypeSafeEnumConverterFactory
: Allow specific converters to override global policy #101ToByteArrayCodec
: now adapts aReadOnlyMemory<byte>
encoder (was fromJsonElement
) (tobyte[]
bodies); Moved fromFsCodec.SystemTextJson
toFsCodec.Box
#75TypeSafeEnum
: Merged two impls fromSystemTextJson
andNewtonsoftJson
#102
Removed
Fixed
Core.Codec
: Changed default timestamp toDateTime.UtcNow
as per docs (was:DateTime.Now
) #104(NewtonsoftJson|SystemTextJson).TypeSafeEnum
: Merged/moved toFsCodec.TypeSafeEnum
#102NewtonsoftJson
: UppedRecyclableMemoryStream
to>= 3.0.0
to handle breaking change inGetStream
return type #118
New Contributors
- @deviousasti made their first contribution in #83
- @nordfjord made their first contribution in #87
- @Mousaka made their first contribution in #88
- @olivercoad made their first contribution in #74
Full Changelog: 2.3.2...3.0.0