Skip to content

4.2.2: Type Facades and 'id' attribute in FBS files

Compare
Choose a tag to compare
@jamescourtney jamescourtney released this 14 Feb 05:09
acfb20b

4.2.2 is a minor release of FlatSharp that brings a couple of new features!

'id' Attribute in FBS files

It's now possible to manually specify the 'id' attribute on table definitions in FBS files:

table MyNeatTable {
   foo:int (id:2)
   bar:int (id:1)
   baz:int (id:0)
}

ID's are an all-or-none proposition. Either all properties have IDs or none do. Thanks to @Eshva for the contribution here!

Type Facades

Type Facades are a new feature, enabling you to expose new types in FlatSharp. Facades are a handy way to extend FlatSharp's type model for types that are not natively available in FlatBuffers. The samples project has an example showing how to add Guid and DateTimeOffset Facades to your project.

Facades are currently only available when using runtime-generated serializers through FlatBufferSerializer. Compiler support is tricky since it requires plugins, but is something being considered for future releases.