dc7303 / yorkie-js-sdk

Yorkie JavaScript SDK

Home Page:https://yorkie.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yorkie JavaScript SDK

codecov

The Yorkie JavaScript SDK implements the client-side libraries.

How to use JS SDK

To get started using Yorkie JavaScript SDK, see: https://yorkie.dev/docs/master/js-sdk

How yorkie-js-sdk works

yorkie-js-sdk uses gRPC-web for communicating with Yorkie agent 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/

Building and Testing the SDK

Building yorkie-js-sdk

# 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

Testing yorkie-js-sdk with Envoy, Yorkie and MongoDB.

Start MongoDB, Yorkie and Envoy proxy in a terminal session.

cd docker
docker-compose up

Start the test in another terminal session.

npm run test

Testing co-editing example with CodeMirror

Start MongoDB, Yorkie and Envoy proxy in a terminal session.

cd docker
docker-compose up

Start the test in another terminal session.

npm run start

Contributing

See CONTRIBUTING for details on submitting patches and the contribution workflow.

About

Yorkie JavaScript SDK

https://yorkie.dev

License:Apache License 2.0


Languages

Language:JavaScript 58.7%Language:TypeScript 41.3%Language:Dockerfile 0.0%