jazz icon indicating copy to clipboard operation
jazz copied to clipboard

Simplifying the API

Open aeplay opened this issue 2 years ago • 1 comments

Observation from user feedback and pairing sessions:

  • We already need to introduce so many new concepts that there is little room for unfair complexity and unexpected behavior

What's currently weird

  • Nested CoValues have to be assigned by ID
  • CoValues have to always be created by a team or account
  • mutations and changers look very different from ResolvedCoValues
  • the sheer number of undefineds in the autoSub API
  • CoStreams are really weird
  • Groups are a bad name

What's currently good

  • autoSub api actually looks like shape of CoValue

Core obstacles

  • we have to distinguish between immutable json values and CoValues
  • we can already have the id of a nested CoValue but not have that loaded yet

Ideas for solutions

  • ~CoStreams could be a CoMap of CoLists with corresponding access rights~
  • ~if there was a way to eject immutable objects to become CoValues, we wouldn't have to distinguish and could change collaboration after the fact~

aeplay avatar Oct 28 '23 18:10 aeplay

The main solution to this will be a new package, jazz-schema that implements a high level API for CoJSON and CoValues, inspired by Zod et al.

  • [x] Schemas look like classes of which you create instances
  • [x] Schemas can directly reference other Schemas, without indirection over IDs and this is reflected in the instances
  • [x] autoSub is now a very small addition to this
  • [x] CoJSON can become much simpler
    • [x] everything could be mutable

aeplay avatar Nov 09 '23 11:11 aeplay