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

Serialization of custom OT types #389

Open
DetweilerRyan opened this issue Aug 25, 2015 · 2 comments
Open

Serialization of custom OT types #389

DetweilerRyan opened this issue Aug 25, 2015 · 2 comments

Comments

@DetweilerRyan
Copy link

Hi ShareJS community!

You guys have done an amazing job here and I'd like to contribute.

I am exploring the possibility of using ShareJS to solve the shared-mutable-state problem I have with my Trello-like web app. I have concluded that the JSON0 type cannot be used to enforce the invariants of my application state and therefore I must implement a custom OT type for my application state.

The snapshot for my custom OT type is an immutable object from the Immutable.js npm module. As a result, I need custom serialization/deserialization methods as documented here: https://github.com/ottypes/docs#optional-properties.

Unfortunately, the shareJS and liveDB libraries do not support the optional serialization/deserialization methods on OT types. I have forked the ShareJS and LiveDB repos to add custom serialization for my purposes ( https://github.com/DetweilerRyan/ShareJS https://github.com/DetweilerRyan/livedb ).

I feel there is a strong use case for custom serialization support ( I can go into more detail if needed ) and believe it should be supported by the two libraries.

@josephg
Copy link
Owner

josephg commented Aug 30, 2015

Yep, I totally agree. I've been wanting to add that for awhile. Make a pull request and I'll pull it in.

@DetweilerRyan
Copy link
Author

Thanks for the response. Once I feel comfortable with my implementation, I'll make the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants