Skip to content

[Blazor] PersistentComponentStateSerializer API review feedback #63154

@javiercn

Description

@javiercn

Once I have it working, I would like to check how much setup I would need to create and register a general serializer that would work for any type or a subset of types.

My key concerns would be that:

  1. It might not be possible to register a single generic serializer for any type, so you will have to register serializers for all types manually.
  2. If it is possible to register a serializer for any generic type, it might not be possible to constrain this to only work for a subset of types. Imagine that I add a serializer that builds on MessagePack, but that this can only serialize types that are annotated with the [MessagePackObject] attribute, then I would not be able to say that it should fall back to JSON for types that are not annotated correctly. Preferebly it would be nice to have some way to add custom logic for whether a generic serializer could serialize a specific Type like in the Chain-of-responsibility pattern.

But since I haven't gotten the minimal sample to work yet, I have not been able to see what was needed for the above use cases.

Originally posted by @KristofferStrube in #62589

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions