The Yorkie JavaScript SDK implements the client-side libraries.
To get started using Yorkie JavaScript SDK, see: https://yorkie.dev/docs/js-sdk
yorkie-js-sdk uses gRPC-web for communicating with Yorkie Server built on gRPC.
+--Browser--+ +--Envoy---------+ +--Yorkie-----+
| | | | | |
| gRPC-web <- HTTP1.1 -> gRPC-web proxy <- HTTP2 -> gRPC server |
| | | | | |
+-----------+ +----------------+ +-------------+
For more details: https://grpc.io/blog/state-of-grpc-web/
For building yorkie-js-sdk, You'll first need Node.js installed(Node.js version 16+ and npm version 7.10+ are required).
# install packages
$ npm install
# build
$ npm run build
For generating proto messages and the service client stub classes with protoc and the protoc-gen-grpc-web.
How to install protoc-gen-grpc-web: https://github.com/grpc/grpc-web#code-generator-plugin
# generate proto messages and the service client stub classes
$ npm run build:proto
Primary "source of truth" location of protobuf message is in yorkie. We manage the messages in the repository.
Start MongoDB, Yorkie and Envoy proxy in a terminal session.
$ docker-compose -f docker/docker-compose.yml up --build -d
Start the test in another terminal session.
$ npm run test
To get the latest server locally, run the command below then restart containers again:
$ docker pull yorkieteam/yorkie:latest
$ docker-compose -f docker/docker-compose.yml up --build -d
Start MongoDB, Yorkie and Envoy proxy in a terminal session.
$ docker-compose -f docker/docker-compose.yml up --build -d
Start the webpack-dev-server in another terminal session.
$ npm run dev
Open the co-editing example page served by webpack-dev-server in your browser.
$ open http://0.0.0.0:9000/
See CONTRIBUTING for details on submitting patches and the contribution workflow.
Thanks goes to these incredible people: