serialize method
Serializes component using the first codec that claims it, or returns
null when none does.
Implementation
ComponentSpec? serialize(Component component, SerializeContext context) {
for (final codec in _byType.values) {
final spec = codec.serialize(component, context);
if (spec != null) return spec;
}
return null;
}