Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom operations #340

Open
a-type opened this issue Feb 6, 2024 · 1 comment
Open

Custom operations #340

a-type opened this issue Feb 6, 2024 · 1 comment
Labels
idea I'm considering this, but no guarantees. Is it aligned and feasible?

Comments

@a-type
Copy link
Owner

a-type commented Feb 6, 2024

Theoretically... if all code for app logic is on the client, then custom operations are as simple as defining

  • The operation code
  • The forwards application
  • The undo

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:

  • Drop support for server snapshots (no more Gnocchi Hub)
  • Forbid (or ignore) custom operations on the server (too "special casey")
  • Provide a way to include the same isomorphic code to define the operations on the server and client

I lean toward 3 if I can find the right way to do it. There may be caveats.

@a-type a-type added the idea I'm considering this, but no guarantees. Is it aligned and feasible? label Feb 6, 2024
@a-type
Copy link
Owner Author

a-type commented Feb 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea I'm considering this, but no guarantees. Is it aligned and feasible?
Projects
None yet
Development

No branches or pull requests

1 participant