Static Object Context for Ahead of Time compiling and Trimmed libraries #758
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Includes a source generator/analyzer that generate a static type inspector and object factory. These static objects allow the creation of objects and setting/getting of object properties and fields so YamlDotNet serializer will work with trimmed libraries and ahead of time compilation because it removes the use of reflection when these static objects are used during serialization and deserialization.
Currently it has the following requirements, support and limitations:
YamlSerializable
attributeYamlIgnore
andYamlMember
attributes are supported and respectedDictionary<,>
andList<>
property/field types are supported.SerializerBuilder
andDeserializerBuilder
that will configure the serializer and deserializer to not use the reflection based objects and instead use the static ones.YamlSerializable
it might workThis PR will not create or push an analyzer package to NuGet. That will come later.
This is to support creating an analyzer package manually that can be tested by the users in #740 and #753.
@aaubry , I know you are trying to take a more passive role in YamlDotNet, but I would really appreciate a review of this and the subsequent PR, at a potentially near future date, where we push up the official analyzer so people can use it for real.