bonsaidb
bonsaidb copied to clipboard
Finish splitting ViewSchema
I am trying to create a small app from scratch as part of doing a little last-minute testing on the alpha. I'm not going to hold up releasing the alpha for this, but I'm considering it a bug because I thought I had implemented it -- only I didn't quite get there.
The goal is the ability to have 3 crates define a project:
- Shared: Any schema types that are needed to support the client. This should contain no backend code. Currently, ViewSchema must be defined in this crate.
- Server: The backend related code, linking to the types in Shared. This is where ViewSchema should be defined.
- Client: The client related code. It uses Shared for all types to be able to interact with the server.
ViewSchema is almost there, but the Schema process needs to be split into two to finish: one that only retrieves the Views, and one that retrieves the ViewSchemas. We need to figure out a way to make this as error-proof as possible.
Last night I realized that version()
needs to be moved back to View
, or we need some mechanism for a network client to verify that the view type information is what they are expecting. The version number gives a hard-and-fast verification, but could also cause too many forced updates with server-only logic changes. Perhaps we should switch to SemVer as well to allow for more nuanced behavior.