between clients and servers, or servers and servers, via API • Clients have to care only about the interface, not need to care about the API implementation. • By de fi ning the API schema for the interface, the client can be implemented without waiting for the API implementation. • The frontend can mock the API with the interface de fi nition.
• One codebase, one application • API fi rst • Dependency management • Design, build, release, and run • Con fi guration, credentials, and code • Logs • Disposability • Backing services • Environment parity • Administrative processes • Port binding • Stateless processes • Concurrency • Telemetry • Authentication and authorization https://www.oreilly.com/library/view/beyond-the-twelve-factor/9781492042631/
schema language used to de fi ne gRPC communication interfaces • Automatically generate code based on the API request/response de fi nitions described in the .proto fi le. • Supports various programming languages • The data size is small because it is converted to binary.
• Need a proxy named gRPC-Web to communicate between browsers and servers • Debugging is dif fi cult Wish if we could directly call APIs without proxies…
Fully compatible with gRPC • Can directly send requests to the server from browsers • Support various programming languages • JavaScript, TypeScript, Go, Swift, Kotlin • Can generate type-safe code automatically for clients and servers • https://connectrpc.com/
connect-es Code generation Backend Frontend (FOFSBUFDPEFJONVMUJQMF MBOHVBHFTGSPNBTJOHMF TDIFNBEF fi OJUJPO Generated code guarantees types for requests and responses between clients and backends. So, frontend developers don’t need to care about the interfaces and can focus on implementing the logic and UI
for JavaScript and TypeScript. • connect-es: generate JavaScript/TypeScript code • connect-web: client library to call API with connect • connect-query: Wrapper library around TanStack Query (react-query) • connect-playwright-es: E2E utilities designed to simplify writing Playwright tests for your Connect-ES application. Easy to mock the function with these utilities.
for JavaScript and TypeScript. • connect-es: generate JavaScript/TypeScript code • connect-web: client library to call API with connect • connect-query: Wrapper library around TanStack Query (react-query) • connect-playwright-es: E2E utilities designed to simplify writing Playwright tests for your Connect-ES application. Easy to mock the function with these utilities. *EPO`UFYQMBJOBCPVU 5BO4UBDL2VFSZJOUIJT-5
for JavaScript and TypeScript. • connect-es: generate JavaScript/TypeScript code • connect-web: client library to call API with connect • connect-query: Wrapper library around TanStack Query (reqct-query) • connect-playwright-es: E2E utilities designed to simplify writing Playwright tests for your Connect-ES application. Easy to mock the function with these utilities. *XPO`UFYQMBJO1MBZXSJHIUJO UIJT-5
frontend code without fi nishing the API implementation • We can generate type-safe request/response interfaces between the backend and the frontend in multiple languages from only one protobuf fi le. • Connect is fully compatible with gRPC and allows us to send requests directly from browsers without proxies, such as gRPC-Web. • Connect provides some useful libraries for frontend development