yorkie-js-sdk

Yorkie JavaScript SDK

Showing:

Popularity

Downloads/wk

14

GitHub Stars

38

Maintenance

Last Commit

25d ago

Contributors

15

Package

Dependencies

5

License

Apache-2.0

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

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/main/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

Primary "source of truth" location of protobuf message is in yorkie. We manage the messages in the repository.

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

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

Starting co-editing example with CodeMirror

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 start

Open the co-editing example page served by webpack-dev-server in your browser.

open http://0.0.0.0:9000/

Contributing

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

Contributors ✨

Thanks goes to these incredible people:

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100