yorkie-js-sdk
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.6 • Public • Published

    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:

    Keywords

    none

    Install

    npm i yorkie-js-sdk

    DownloadsWeekly Downloads

    30

    Version

    0.1.6

    License

    Apache-2.0

    Unpacked Size

    3.12 MB

    Total Files

    7

    Last publish

    Collaborators

    • hackerwins
    • dc7303