Implements Source Generators for AOT compilation of (de)serializers
Adds new attributes for use with these generators
[DeserializerInstanceProviderAttribute]
[DeserializerMemberAttribute]
[GenerateDeserializerAttribute]
[GenerateSerializerAttribute]
[SerializerMemberAttribute]
Adds a new built-in ITypeDescriber that finds AOT compiled (de)serializers, AheadOfTimeTypeDescriber
Pre-allocates one of these AheadOfTimeTypeDescribers on TypeDescribers
Adds a new Cesil.SourceGenerators nuget package - its inclusion triggers source generation configured by the above attributes
Internal changes
A number of new attributes which are technically public (but marked with [Obsolete]) for use by AheadOfTimeTypeDescriber to find AOT compiled classes
Changes to some wrapper types to support using pre-generated methods on classes
A new IRowConstructor<TRow>, AheadOfTimeRowConstructor<TRow> to handle the common bits of AOT deserializers
Commentary
These are functional source generators, but as these are the first serious passes at them they're under-tested and definitely less than optimal. Because Cesil.SourceGenerator must be used with an exact version match of Cesil, there's considerable freedom to improve how source generators are built and tested in the future.
Visible changes
[DeserializerInstanceProviderAttribute]
[DeserializerMemberAttribute]
[GenerateDeserializerAttribute]
[GenerateSerializerAttribute]
[SerializerMemberAttribute]
ITypeDescriber
that finds AOT compiled (de)serializers,AheadOfTimeTypeDescriber
AheadOfTimeTypeDescribers
onTypeDescribers
Cesil.SourceGenerators
nuget package - its inclusion triggers source generation configured by the above attributesInternal changes
[Obsolete]
) for use byAheadOfTimeTypeDescriber
to find AOT compiled classesIRowConstructor<TRow>
,AheadOfTimeRowConstructor<TRow>
to handle the common bits of AOT deserializersCommentary
These are functional source generators, but as these are the first serious passes at them they're under-tested and definitely less than optimal. Because Cesil.SourceGenerator must be used with an exact version match of Cesil, there's considerable freedom to improve how source generators are built and tested in the future.