1.0.6 • Published 7 months ago

y-protocols v1.0.6

Weekly downloads
8,052
License
MIT
Repository
github
Last release
7 months ago

Yjs Protocols

Binary encoding protocols for syncing, awareness, and history information

This API is unstable and subject to change.

API

Awareness Protocol

import * as awarenessProtocol from 'y-protocols/awareness.js'

The Awareness protocol implements a simple network agnostic algorithm that manages user status (who is online?) and propagate awareness information like cursor location, username, or email address. Each client can update its own local state and listen to state changes of remote clients.

Each client has an awareness state. Remote awareness are stored in a Map that maps from remote client id to remote awareness state. An awareness state is an increasing clock attached to a schemaless json object.

Whenever the client changes its local state, it increases the clock and propagates its own awareness state to all peers. When a client receives a remote awareness state, and overwrites the clients state if the received state is newer than the local awareness state for that client. If the state is null, the client is marked as offline. If a client doesn't receive updates from a remote peer for 30 seconds, it marks the remote client as offline. Hence each client must broadcast its own awareness state in a regular interval to make sure that remote clients don't mark it as offline.

awarenessProtocol.Awareness Class

const awareness = new awarenessProtocol.Awareness()

License

The MIT License © Kevin Jahns

brbytes-editor@dxos/editory-slatenephele-y-websocket@infinitebrahmanuniverse/nolb-y-@textea/yodas@everything-registry/sub-chunk-3194situatedslate-yjssb-yy-websocketrdy-websocket@jitera/blocknote-corereflect-yjssync-provider@trint/y-websockettiptap-extension-y-awareness@worktile/y-slate@y-sweet/client@y-sweet/react@y-rb/actioncable@wirelineio/editor@wordpress/sync@timothyaveni/slate-yjs-core@timothyaveni/slate-yjs-reactsecsync-react-yjssedestral-y-quillsedestral-y-websocket@tommoor/y-websocket@eweser/db-copyedytordropdeck_slate-yjsflok-serverghost@comfy-creator/graph-editorneural_compressor_ext_lab_customizedneural_compressor_ext_lab_customized_2marshall-y-slatemindmap-editorjmas-blocknote-corecomfy-creatorh-slatejupyverse-authpinpt-y-webrtc@vidbaseapp/hocuspocus-server@zhaopengme/myeditor@useblock/storetwhiteboard@hedgedoc/realtime@hedgedoc/realtime-communication@gived/waving@datacamp/yjs-helpers@datacamp/docprovider@datacamp/shared-models@gagndeep/y-webrtc@difizen/libro-shared-model@difizen/weave-collaborationbocknoat-corebocknoate-core@becomes/cms-ui@bentwnghk/chatwp-serviceswax-prosemirror-services@blocksuite/store@blocksuite/sync@inquisitive/serverless-y-websocket@cocreate/quill@jhaynie/y-websocket@joebobmiles/y-react@keystatic/coreblocknote-coreblocknote-next-core@blocklet/co-git@blockeditor/store@blockmah/store@blocknote/core@docget/blocknote-core@draftiy/yjs@grotelee/y-websocket@ac-synth/y-websocket@a-la-fois/doc-client@alisallon/blocksuite-store@alisallon/blocksuite-sync@ark-us/websockets-server@asyncworklfow/sdktldrawlignin@weamd/plugin-collaborative@collabjs/core@collabjs/reactyrb-actioncableyicat-y-websocket@codepod/api@codepod/ui@codepod/yjscodepodcodelabs.y-socket.ioy-durableobjectsy-daty-generic-syncy-holochainy-colour-websocket
1.0.6

7 months ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago