Open a-type opened 9 months ago
Ok, one idea...
Rather than having Verdant Server generate your documents from operations for you, treat document snapshotting like a lower-level feature. The server returns the operations/baselines needed to create the snapshot. The calling server is responsible for interpreting them (using tools Verdant provides)
import { computeSnapshot } from '@verdant-web/server';
const docInfo = verdantServer.getDocumentInfo(id);
const snapshot = computeSnapshot(docInfo, schema, etc);
That way Verdant Server doesn't have to know any schemas, so it can remain multi-app-tenant capable without much effort.
Theoretically... if all code for app logic is on the client, then custom operations are as simple as defining
However, not all use of operations is on the client today. There's tools to get a snapshot on the server.
So to support custom operations, which would be nice, either:
I lean toward 3 if I can find the right way to do it. There may be caveats.