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

feat: Stable JSON representation for history #368

Merged
merged 42 commits into from
Jun 7, 2024

Conversation

Leeeon233
Copy link
Member

@Leeeon233 Leeeon233 commented May 21, 2024

This PR implements a JSON-based encoding scheme, intended as a common format before the stable document encoding format. The JSON format is highly readable and can be potentially used for visualization in devtools in the future.

Details

It generally aligns with the internal data structures Change and Op of Loro, where PeerID is stored in an additional array and is simplified by using indexes in the content.

  • ID/IdLp/CounterID are all expressed in string form, and simultaneously, the PeerID is replaced.
  • It introduces a new JsonUnknown type that ensures forward and backward compatibility for multiple versions of encoding and is also compatible with the binary unknown part.

The specification of JSON representation

@Leeeon233 Leeeon233 changed the title feat: json encoding feat: Stable JSON representation for history May 22, 2024
@Leeeon233 Leeeon233 force-pushed the leon/loro-635-json-encoding branch from eb6daf4 to ed0c643 Compare May 24, 2024 09:18
@Leeeon233 Leeeon233 force-pushed the leon/loro-635-json-encoding branch from 871c01e to 3d107a0 Compare May 24, 2024 12:33
@Leeeon233 Leeeon233 marked this pull request as ready for review May 24, 2024 12:56
@Leeeon233 Leeeon233 marked this pull request as draft May 24, 2024 12:57
@Leeeon233 Leeeon233 marked this pull request as ready for review May 27, 2024 03:22
@Leeeon233 Leeeon233 requested a review from zxch3n May 27, 2024 08:30
@Leeeon233 Leeeon233 force-pushed the leon/loro-635-json-encoding branch from 526a09b to 7a5465f Compare May 29, 2024 09:54
docs/JsonSchema.md Outdated Show resolved Hide resolved
docs/JsonSchema.md Outdated Show resolved Hide resolved
docs/JsonSchema.md Outdated Show resolved Hide resolved
docs/JsonSchema.md Outdated Show resolved Hide resolved
docs/JsonSchema.md Outdated Show resolved Hide resolved
@Leeeon233 Leeeon233 force-pushed the leon/loro-635-json-encoding branch from 97256e7 to 295e13a Compare June 3, 2024 08:23
@Leeeon233 Leeeon233 requested a review from zxch3n June 3, 2024 11:10
@Leeeon233 Leeeon233 force-pushed the leon/loro-635-json-encoding branch from 19dd98f to 94f801c Compare June 4, 2024 11:33
@Leeeon233 Leeeon233 force-pushed the leon/loro-635-json-encoding branch from 94f801c to 6e021a5 Compare June 4, 2024 14:41
@Leeeon233 Leeeon233 merged commit 2df2a52 into main Jun 7, 2024
1 check passed
@Leeeon233 Leeeon233 deleted the leon/loro-635-json-encoding branch June 7, 2024 05:18
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

Successfully merging this pull request may close these issues.

None yet

2 participants