Investigate Ways to Extend or Replace Serialization Versioning #545
Labels
Breaking Change
Breaks binary or source compatibility
Core
Area: Duality runtime or launcher
Feature
It doesn't exist yet, but I want it
Milestone
Summary
Duality currently allows to handle simple serialization errors like renamed types or members, or type conversions using custom
SerializeErrorHandler
implementations. While nice, what is lacking is a more fundamental way to version serialized data, which is supported by the serialization system itself.Analysis
The basic idea of an extended approach to handling serialization between different type versions is to serialize a version number along with each type and, when detecting a mismatch, look for classes implementing a handler interface across all plugins that report to be able to handle that specific type and version change.
Type Identification
FormerlySerializedAs
that Unity provides for fields that have been renamed - just for type names instead of fields.Type Versioning
Version Mismatch Handling
ISerializeVersionMismatchHandler
terminology. Open for suggestions if you can come up with something shorter.ISerializeExplicit
works: By handing over anIDataReader
and letting the handler create and populate an object from that.Serialization Versioning Plugins
FormerlySerializedAs
,MinSerializationVersion
attributes,ISerializeVersionMismatchHandler
implementations, other stuff?) in a distinct plugin, so Duality and other libraries could ship with a "compatibility" plugin and keeping their core free of legacy clutter.SerializeType
for perf reasons.Backwards Compatibility
The text was updated successfully, but these errors were encountered: