burr icon indicating copy to clipboard operation
burr copied to clipboard

Adds modular SERDE approach

Open skrawcz opened this issue 1 year ago • 0 comments

This PR introduces a modular SERDE approach.

  1. Singledispatch to register type serializers.
  2. Any complex object deserialization, needs to be accompanied with a "type field" that will map to the name of a "string dispatcher function". i.e. like single dispatch, but you register a string value for it. This approach means that most people will get around the need for field level deserialization / having to tell Burr about state types explicitly.

TODOs:

  • [ ] decide on module structure and where it should live
  • [ ] wire changes through to tracker serialization
  • [ ] wire changes through to persister serialization
  • [ ] wire changes through to UI reading local tracker logs
  • [ ] update LC examples
  • [ ] write tests

Changes

How I tested this

Notes

Checklist

  • [ ] PR has an informative and human-readable title (this will be pulled into the release notes)
  • [ ] Changes are limited to a single goal (no scope creep)
  • [ ] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • [ ] Any change in functionality is tested
  • [ ] New functions are documented (with a description, list of inputs, and expected output)
  • [ ] Placeholder code is flagged / future TODOs are captured in comments
  • [ ] Project documentation has been updated if adding/changing functionality.

skrawcz avatar May 11 '24 07:05 skrawcz