share / share/sharedb

Using the serialized representation the client & server?

Open
#156 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
6.5k
Forks
456
Avg merge
1d 5h
Merged PRs (30d)
5

Description

Hey @nateps I'm looking into adding an OT type for Slate.js and I was curious about how ShareDB works with the type.serialize() and type.deserialize() methods. Since Slate is built on top of Immutable.js, I'm dealing with immutable snapshot objects, instead of plain JS objects.

All of the apply(), create(), transform(), compose(), etc. logic is optimized to work on the deserialized object format, so I'd like to keep it in the deserialized format as much as possible.

It seems like right now deserialization to custom object types only occurs on the client, and on the server it only ever works with serialized representations. While working with the snapshots on the server, I'd like to use the deserialized, Immutable.js snapshot objects instead.

Is this true? Do you know how I'd achieve what I'm looking for? Or is there some reason it's not possible?

Thanks!

Edit: mixed up serialize and deserialize in a few places, fixed now.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing type.serialize() and type.deserialize() through ShareDB’s client and server paths, then compare how apply(), create(), transform(), and compose() consume snapshots. Confirm whether server-side OT can use Immutable.js deserialized snapshots and document the supported path or the scope of a change.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.