Skip to content

v2.0.0

Compare
Choose a tag to compare
@chakhsu chakhsu released this 08 Jan 02:25
· 26 commits to main since this release
21e48fb

Completely rewritten in TypeScript.

Break Change

Loader

  • no-module-default
  • use import { Protoloader } from 'grpcity' instead of import GrpcLoader from 'grpcity'
  • remove closeClients()
  • move client() to class Client
  • move realClient to class Client
  • remove clientWithoutCache()
  • use makeClientCredentials() instead of makeCredentials()
  • add makeServerCredentials()
  • remove message()
  • init() no longer support services option
  • initClients() is async func and return new class Client
  • initServer is async func and return new class Server

Client

  • new class Client
  • use get() instead of loader.client()
  • use getReal() instead of loader.clientReal()
  • support clear() to clear client proxy cache and factory cache
  • support client middleware
    • new client context for middleware
    • use use() on add middleware func
    • unary method support middleware
    • async stream support middleware
  • cache loader.initClient() options credentials
  • custom type for method call option

Server

  • use add() instead of addService()
  • use remove() instead of removeService()
  • move makeServerCredentials() to class ProtoLoader
  • use use() instead of addMiddleware()
  • new server middleware context
  • custom type for method call option

Other

  • export grpc status
  • full test for unaryCall and async stream call
  • use jest instead of mocha
  • add example