Skip to content

5.0.0

Compare
Choose a tag to compare
@jamescourtney jamescourtney released this 10 Mar 21:45
c95f29e

Version 5 is a major release for FlatSharp, with support for lots of new features:

  • ~5-15% performance uplift for both Serialize and Parse workflows, depending on scenario.
  • file_identifier and root_type support
  • Updated Flatsharp FBS annotations to start with fs_
  • Deserialized FlatSharp objects now implement IFlatBufferDeserializedObject so objects can be queried to see if they are deserialized.
  • Non-Generic Serialize/Parse methods exposed via FlatBufferSerializer.Default.Compile(Type t) or FlatBufferSerializer.Default.Compile(object o)
  • Types are no longer required to expose parameterless constructors (can use a constructor accepting FlatBufferDeserializationContext instead).
  • Support for fixed-size vectors in structs: field:[int:8]
  • Support for C# 8 and 9 features
    • Nullable annotations in FlatSharp core libraries and generated C#
    • Init-only properties

Breaking changes:

  • Compiler no longer supports the NoCustomType metadata on unions.
  • Compiler no longer suports the ObsoleteDefaultConstructor metadata. It has been replaced with fs_defaultCtor, which provides more options.
  • For memory vectors, compiler generates nullable Memory<byte>? instead of previous behavior of non-nullable. This is more in-line with how flatbuffers treats vectors as optional fields.
  • ITypeModel has had interface changes.
  • FlatBufferUnion and derivatives no longer supply a Clone method.
  • OnInitialized partial methods for generated types now accepts a FlatBufferDeserializationContext parameter instead of no parameter.
  • Generated code requires C# 8 compiler, C# 9 for full nullable support.