Skip to content

Releases: jet/FsCodec

SystemTextJson: Remove vulnerable default dep

14 Oct 09:08
Compare
Choose a tag to compare

Added

  • TimelineEvent.ToString: Render Unfold/Event state, EventType, Index #123

Changed

  • SystemTextJson: Dropped minimum System.Text.Json version to 6.0.10 per CVE-2024-43485 #125

Full Changelog: 3.0.2...3.0.3

SystemTextJson: Update min System.Text.Json for non vulnerable default

11 Jul 14:41
Compare
Choose a tag to compare

What's Changed

  • chore(SystemTextJson, deps): Target minimum non vulnerable ver: 8.0.4 #122

Full Changelog: 3.0.0...3.0.2

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

18 Mar 23:51
Compare
Choose a tag to compare

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

Add Options.Default, Split autoUnion option

10 Mar 17:47
Compare
Choose a tag to compare

Fast-follow release with breaking changes vs 2.3.1, which (along with 2.3.0) is unlisted

Added

Changed

  • SystemTextJson: Replace autoUnion=true with individually controllable autoTypeSafeEnumToJsonString and autoUnionToJsonObject settings re #71 #73

See CHANGELOG

SystemTextJson: Fix autoUnion mode to not handle `list` and `option`

02 Mar 14:15
Compare
Choose a tag to compare

Fixed

  • SystemTextJson: Prevent UnionConverter being applied to option and list types when using UnionOrTypeSafeEnumConverterFactory/SystemTextJson.Options(autoUnion = true) #72

See CHANGELOG

Stateful Serdes, System.Text.Json UnionEncoder, STJ autoUnion mode

13 Jan 23:00
Compare
Choose a tag to compare

NOTE: Unlisted in favor of 2.3.1, which has a critical fix for autoUnion mode's handling of option and list types.

Added

  • SystemTextJson.UnionOrTypeSafeEnumConverterFactory: Global converter that automatically applies a TypeSafeEnumConverter to all Discriminated Unions that support it, and UnionConverter to all others #69
  • SystemTextJson.Options(autoUnion = true): Automated wireup of UnionOrTypeSafeEnumConverterFactory #69
  • SystemTextJson.UnionConverter: Port of NewtonsoftJson equivalent started in #43 #59 🙏 @NickDarvey

Changed

  • Serdes: Changed Serdes to be stateful, requiring a specific set of Options/Settings that are always applied consistently #70
  • Serdes.DefaultSettings: Updated README.md ASP.NET integration advice to reflect minor knock-on effect #70
  • SystemTextJson: Target System.Text.Json v 6.0.1, TypeShape v 9.0.0 #68

See CHANGELOG

Fix CI AssemblyVersion stamping

13 Sep 09:28
Compare
Choose a tag to compare

See CHANGELOG

Fixed/Changed

  • Updated to MinVer 2.5.0, .NET SDK 5.0.200 in order to fix internal AssemblyVersion stamping 🙏 @Mousaka

2.2.0

05 May 22:27
Compare
Choose a tag to compare
  • Added: NewtonsoftJson.Serdes.DefaultSettings: Exposes default settings (for use with ASP.NET Core .AddNewtonsoftJson) #63
  • Added: SystemTextJson.Serdes.DefaultOptions: Exposes default options (for use with ASP.NET Core .AddJsonOptions) #63
  • Fixed: Clarify StreamName.parse exception message #58 🙏 @dharmaturtle
  • Fixed: Remove erroneous Converters from FsCodec.SystemTextJson.Converters.JsonOptionConverter namespacing

See CHANGELOG

Support Nested FsCodec.NewtonsoftJson.UnionEncoders

25 May 15:24
Compare
Choose a tag to compare
  • Enable omission of catchAllCase from UnionConverter arguments #51
  • (Slightly simplistically) Handle nested UnionConverters #52

See CHANGELOG

FsCodec.SystemTextJson (awaiting UnionConverter)

11 May 17:03
Compare
Choose a tag to compare

Adds a full implementation of the FsCodec.Newtonsoft feature-set based on System.Text.Json

NOTE 1: depends on preview edition of System.Text.Json v 5-preview.3
NOTE 2: UnionEncoder has not yet been completed #43

See CHANGELOG

🙏 @ylibrach @NickDarvey for making it happen