Code Monkey home page Code Monkey logo

y-octo's Introduction

Y CRDT

A collection of Rust libraries oriented around implementing Yjs algorithm and protocol with cross-language and cross-platform support in mind. It aims to maintain behavior and binary protocol compatibility with Yjs, therefore projects using Yjs/Yrs should be able to interoperate with each other.

Project organization:

  • lib0 is a serialization library used for efficient (and fairly fast) data exchange.
  • yrs (read: wires) is a core Rust library, a foundation stone for other projects.
  • yffi (read: wifi) is a wrapper around yrs used to provide a native C foreign function interface. See also: C header file.
  • ywasm is a wrapper around yrs that targets WebAssembly and JavaScript API.

Other projects using yrs:

  • ypy - Python bindings.
  • yrb - Ruby bindings.

Feature parity among projects

yjs
(13.6)
yrs
(0.18)
ywasm
(0.18)
yffi
(0.18)
y-rb
(0.5)
y-py
(0.6)
ydotnet
(0.4)
yswift
(0.2)
YText: insert/delete
YText: formatting attributes and deltas
YText: embeded elements
YMap: update/delete
YMap: weak links ✅ 
(weak-links branch)
YArray: insert/delete
YArray & YText quotations ✅ 
(weak links branch)
YArray: move ✅ 
(move branch)
XML Element, Fragment and Text
Sub-documents
Shared collections: observers ✅ 
(incompatible with yjs)
Shared collections: recursive nesting
Document observers ✅ 
(incompatible with yjs)
Transaction: origins
Snapshots
Sticky indexes
Undo Manager
Awareness
Network provider: WebSockets ✅ 
(y-websocket)
✅ 
(yrs-warp)
✅ 
(y-rb_actioncable)
✅ 
(ypy-websocket)
Network provider: WebRTC ✅ 
(y-webrtc)
✅ 
(yrs-webrtc)

Maintainers

Sponsors

NLNET

Ably

y-octo's People

Contributors

brooooooklyn avatar darkskygit avatar forehalo avatar thorseraq avatar zxch3n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

y-octo's Issues

Potential code optimization paths

  • map code clean #21
  • narrow Item::{left/right} type from Node to Somr<Item> #24
  • refactor map implementation #26
  • Update consumes [u8] instead of Vec<u8> #35
  • make Item::Content inner easier to share, especially for Value::Read (perf)
  • standardize Value::read(Content) for type content reading (perf/correctness)
  • try separate map/list into branches (mem reduce)

add more compatibility test baseline using yjs

Currently we still use yrs as a baseline for binary compatible behavior, which increases testing complexity

I consider introducing a js runtime to provide the execution results of yjs as a reference benchmark during testing

It may be a convenient choice to directly use node to execute and output to stdio. Another option is to introduce quickjs or a similar streamlined js runtime, but this will increase compilation time and dependency complexity.

I will first investigate the feasibility of using nodejs to obtain execution results. This is the easiest way

### Tasks
- [x] https://github.com/toeverything/y-octo/pull/4
- [x] impl the function binding of node: #6
- [ ] test case for verify the data between yjs and y-octo-node #6

Explainer

I feel like this libraries readme could better explain how exactly it is different from the normal Y.js library.

For example, by comparing data or use-cases. It's quite foggy right now.

add sub doc callback api

In yjs, sub doc is loaded in the following way:

let doc = new Y.Doc()
console.log('init main doc');

doc.on('subdocs', ({ loaded }) => {
  loaded.forEach(subdoc => {
    console.log('init subdoc provider');
    new SomethingProvider(subdoc.guid, subdoc)
  })
})

let subDoc = doc.getMap("map").get("some_sub_doc")
subDoc.on('synced', () => {
  console.log('synced');
  // when doc synced by provider, we can get sub doc's data
})
console.log('loading');
subDoc.load()

// exec workflow:
// init main doc -> loading -> init subdoc provider -> synced

In y-octo, we have implemented the parsing of sub doc identifiers in ydoc, this means that to add subdoc support to y-octo, what we need to do is:

  • provide an API to allow doc to know its own synchronization status
  • provide an API, pass in a doc instance, and use external implementation to load the doc binary from anywhere and apply update
  • maintain a thread-safe weak reference to a subdoc instance inside doc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.