Skip to content
CAI
Software that uses CAICheck a score

scalapb/zio-grpc

67.8

Adequate · 20 September 2026

4k

lines of production code

Scala

with JavaScript

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Scala library that integrates the ZIO functional programming effect system with gRPC, enabling the generation of type-safe client and server code from Protocol Buffer definitions. It supports both JVM and Scala.js environments, providing abstractions for managing gRPC channels, handling streaming RPCs, and processing metadata within ZIO effects. The library facilitates dependency injection and service transformation, allowing developers to build robust, non-blocking gRPC applications with configurable backpressure and scoped resource management.

How it got here

2020 — ZIO 2 migration and Scala.js support

12 changes.

The project underwent a major migration to ZIO 2 and Scala 3, introducing significant API changes such as constructor-based dependency injection and refined metadata handling. This period also saw the removal of legacy Scala 2 compatibility shims and the addition of comprehensive Scala.js end-to-end testing infrastructure. Concurrently, the project launched a new documentation website and upgraded its build system to support modern tooling and multi-project matrix builds.

2021 — ZIO 2 migration and Scala.js support

11 changes.

The project migrated its core server and client abstractions to ZIO 2, introducing scoped resource management, native backpressure, and standardized error handling via StatusException. This effort included implementing full Scala.js support for client-side gRPC calls and metadata, alongside comprehensive updates to example applications to demonstrate the new ZIO-native patterns.

2022–2023 — end-to-end testing and benchmarking

5 changes.

This period focused on expanding test coverage and performance evaluation for gRPC streaming capabilities. The work introduced comprehensive end-to-end tests for backpressure, client behavior, and Scala.js browser environments, alongside new benchmarks to measure server-streaming throughput and latency.

Features

Add Scala.js end-to-end test service definition and type mapping

Introduces a new Protobuf service definition (TestService) and a Scala type mapper for end-to-end testing. The proto file defines a service with unary, server-streaming, client-streaming, and bidi-streaming RPCs, including scenarios for errors, delays, and type mapping. A corresponding Scala file provides a TypeMapper for converting between the generated protobuf message and a custom WrappedString type, enabling type-mapped streaming tests.

e2e/protos · high confidence

Add gRPC service definitions and documentation helper utilities

The documentation module now includes a Protobuf definition for \testservice.proto\ that defines example gRPC services (\ServiceName\ and \SimpleService\) covering unary, server-streaming, client-streaming, and bidirectional streaming RPCs. Additionally, a Scala utility object \S\ has been added to support documentation generation by extracting and formatting code snippets from existing example files based on specific start/end markers.

zio-grpc-docs · high confidence

Add server-streaming benchmark for zio-grpc

Added a new benchmark application (\ServerStreamingBenchmarkApp\) and its supporting protocol buffer definition (\testservice.proto\) and implementation (\GreeterImpl.scala\) to measure the performance of server-streaming RPCs. The benchmark exercises the \SayHelloStreaming\ endpoint with configurable backpressure queue sizes (8192 and 65536) to evaluate throughput and latency under different buffering conditions.

benchmarks · high confidence

Add support for client-provided metadata in Scala.js

The Scala.js implementation of zio-grpc now supports client-provided metadata. This is achieved by introducing a new \SafeMetadata\ class that wraps a JavaScript dictionary of string pairs, along with companion object methods to create instances. Additionally, new \ZChannel\ and \ZManagedChannel\ abstractions are added to manage gRPC channels in the Scala.js environment, enabling the underlying infrastructure for passing this metadata during client calls.

_core/src/main/scalajs/scalapb/zio\grpc · high confidence

Added Scala.js end-to-end test infrastructure

The e2e/src/main area now includes a new test service implementation (TestServiceImpl) and its main entry point (TestServiceMain) to support Scala.js end-to-end testing, replacing the previous example-based client and server files (ExampleClient, ExampleServer) which have been removed.

e2e/src/main · high confidence

Added ZIO-based gRPC client example

A new example application (WebappMain) has been added to the fullapp directory, demonstrating how to use zio-grpc to interact with a gRPC service. The example showcases unary requests, server-streaming requests, and the use of metadata for error simulation, providing a concrete reference for integrating zio-grpc clients in ZIO applications.

examples/fullapp/webapp · high confidence

Added ZIO-based gRPC client example

A new example client application (ExampleClient.scala) has been added to the fullapp client module, demonstrating how to integrate gRPC services using ZIO and scalapb-zio-grpc. This example provides a concrete implementation of a ZIO application that connects to a gRPC server on localhost:9090, utilizing ZManagedChannel for connection management and showcasing the use of GreeterClient for making remote calls within a ZIO effect.

examples/fullapp/client · high confidence

Initial launch of the ZIO gRPC documentation website

The project now includes a dedicated documentation site built with Docusaurus 2, providing users with a 'Get Started' landing page, a sidebar navigation for guides (including installation, generated code, and Scala.js support), and versioned documentation for 0.6.x and 0.5.x. The site features custom theming, syntax highlighting for Scala, Java, and Protobuf, and is configured to automatically deploy via GitHub Actions.

website · high confidence

Introduction of ZioCodeGenerator for ScalaPB integration

The code generator now includes a new \ZioCodeGenerator\ entry point that integrates with ScalaPB to produce ZIO-based gRPC client and server code. This generator defines the structure for generated services, including support for unary, client streaming, server streaming, and bidirectional streaming methods, while introducing concepts like \RequestContext\, \SafeMetadata\, and \ClientTransform\ to handle gRPC metadata and transformations within the ZIO environment.

_code-gen/src/main/scala/scalapb/zio\grpc · high confidence

New ZIO-based gRPC server examples with metadata and dependency injection

Added two new Scala source files in the fullapp server example that demonstrate modern ZIO 2 and zio-grpc patterns. ExampleServer.scala shows a basic service implementation using RequestContext to handle error flags via gRPC metadata, while ExampleServerWithMetadata.scala demonstrates a more complex setup where request context is transformed into a domain User object via a UserRepo dependency, illustrating how to wire services and handle authentication metadata in a ZIO layer.

examples/fullapp/server · high confidence

New fullapp example with Envoy proxy and updated gRPC service definition

Added a new 'fullapp' example demonstrating a zio-grpc server with a Scala.js client, including an index.html entry point, a docker-compose configuration for an Envoy proxy on port 8080, and a README with setup instructions. The example uses a shared protos subproject where the gRPC service has been renamed from 'MyService' to 'Greeter' and the package updated to 'examples'.

examples/fullapp · high confidence

Removals

Removal of ZIO integration support

The ZIO-based gRPC integration has been removed from the library. This change deletes the ZIO code generator (\ZioCodeGenerator\) and all associated core runtime components, including ZIO-specific type aliases (\GIO\, \GStream\), client call implementations (\ZClientCall\, \ClientCalls\), server call handlers (\ZServerCall\, \ZioServerCallHandler\), and channel management utilities. Users relying on ZIO for gRPC communication will no longer have access to these ZIO-native abstractions.

code-gen/src/main/scala/scalapb/grpc, core/src/main/scala/scalapb/grpc · high confidence

Behavioural changes

Client calls now return response metadata and use StatusException for errors

The client-side gRPC implementation has been refactored to expose response metadata (headers and trailers) to users via a new ResponseContext wrapper, and to standardize error handling by replacing the previous Status type with io.grpc.StatusException. This change affects all client call types (unary, server-streaming, client-streaming, and bidi-streaming) in the core client module, ensuring that callers can inspect server-provided metadata and that errors are consistently represented as exceptions rather than opaque status codes.

_core/src/main/scalajvm/scalapb/zio\grpc/client · high confidence

Introduces Scala.js client implementation with StatusException error handling

Adds the \ClientCalls\ and \ZClientCall\ modules for the Scala.js target, enabling client-side gRPC calls (unary and server-streaming) while explicitly marking client-streaming and bidi-streaming as unsupported. The implementation standardizes error handling by wrapping gRPC status information into \StatusException\ instances, ensuring consistent failure modes for users interacting with the Scala.js client.

_core/src/main/scalajs/scalapb/zio\grpc/client · high confidence

Introduces ZIO-native gRPC server and client abstractions with scoped resource management

The library now provides new ZIO-integrated components for managing gRPC servers and clients. Server lifecycle is handled via \Server\ and \ScopedServer\, which wrap the underlying gRPC server in ZIO Scopes to ensure clean shutdown and termination waiting. Client connections are managed through \ZChannel\ and \ZManagedChannel\, which wrap \ManagedChannel\ instances in ZIO Scopes for automatic cleanup and support configurable prefetching for streaming backpressure. Additionally, \SafeMetadata\ is introduced to provide thread-safe, ZIO-effect-based access to gRPC metadata using a semaphore, and \ServiceList\ offers a functional way to compose and bind services to the server.

_core/src/main/scalajvm/scalapb/zio\grpc · high confidence

Migration to Scala 3 and ZIO 2 with updated backpressure and API changes

The library has upgraded its core dependencies to Scala 3.3 and ZIO 2, introducing significant API changes for users. Generated services no longer include the \R\ type parameter, encouraging a constructor-based dependency injection pattern, and context is now passed as a second parameter to handlers. Backpressure support for streaming clients is now configurable via the \ZIO\_GRPC\_BACKPRESSURE\_QUEUE\_SIZE\ environment variable or the \zio\_grpc.backpressure\_queue\_size\ system property. Additionally, response metadata handling has been refined with the renaming of \ClientWithMetadata\ to \ClientWithResponseMetadata\, and the server now supports sending response metadata. The build tooling has also shifted from Travis CI to Mergify, and formatting is managed by Scalafmt 3.7.2.

(repo-wide) · high confidence

New service transformation and context binding APIs

The library introduces new abstractions for transforming and binding gRPC services. \ZBindableService\ and \CanBind\ provide a unified way to bind service implementations to a server by converting various request contexts (like \SafeMetadata\ or \RequestContext\) into the service's expected context. \GenericGeneratedService\ and \Transform\/\GTransform\ allow users to apply transformations to all methods of a service, enabling pre- or post-processing of requests and responses, as well as context and error type mapping. Additionally, \GeneratedClient\ and \ClientTransform\ provide similar transformation capabilities for client-side calls, allowing modification of call options, metadata, deadlines, and timeouts.

_core/src/main/scala/scalapb/zio\grpc · high confidence

Removal of Scala 2.12 JavaConverters compatibility shim

The Scala 2.12-specific compatibility layer for JavaConverters has been removed from the code generator. This change eliminates the legacy wrapper that previously exposed \collection.JavaConverters\, simplifying the internal implementation for this Scala version.

code-gen/src/main/scala-2.12 · high confidence

Removal of Scala 2.13-specific Java collection compatibility shim

The Scala 2.13-specific compatibility layer for Java collection conversions has been removed. This change eliminates the \scalapb.grpc.zio.compat\ object, which previously mapped to \scala.jdk.CollectionConverters\, as this functionality is now natively available in the Scala 2.13 standard library.

code-gen/src/main/scala-2.13 · high confidence

Rename ManagedServer to ScopedServer and update server call handler signatures

The Scala.js server implementation has been refactored to align with ZIO 2's scoping model: the previous ManagedServer has been renamed to ScopedServer, and the server call handlers (ZServerCallHandler) now explicitly accept a RequestContext as a second parameter alongside the request payload for unary, server-streaming, client-streaming, and bidi calls.

_core/src/main/scalajs/scalapb/zio\grpc/server · high confidence

Server-side gRPC handling refactored with ZIO-native backpressure and metadata support

The server implementation in the \scalapb.zio\_grpc.server\ package has been rewritten to use ZIO primitives for managing gRPC calls, introducing configurable backpressure via the \zio\_grpc.backpressure\_queue\_size\ property and supporting response metadata (trailers). New components like \ZServerCall\ and \ListenerDriver\ replace previous mechanisms, allowing for non-blocking stream processing and better control over flow control, while \ZServerCallHandler\ now orchestrates unary and streaming call handlers using these updated ZIO-based abstractions.

_core/src/main/scalajvm/scalapb/zio\grpc/server · high confidence

Updated helloworld example to ZIO 2 and ZIO gRPC 0.6.0

The helloworld example has been upgraded to use ZIO 2 and ZIO gRPC 0.6.0, introducing new patterns for service implementation and client interaction. The example now demonstrates a database-backed Greeter service using ZIO layers, a Welcomer service, and a client that supports passing metadata via SafeMetadata and ZClientInterceptor. Additionally, the example includes a multi-service server setup and a dedicated client metadata demonstration, reflecting the latest API changes in the ZIO gRPC ecosystem.

examples/helloworld, examples/routeguide · high confidence

Test coverage

Add Scala.js end-to-end tests; Added JVM end-to-end tests for gRPC streaming and client behavior; Added Scala.js end-to-end tests for gRPC service interactions; Added end-to-end tests for backpressure handling.

Dependencies

Major build infrastructure and dependency upgrades

The project's build system has been significantly upgraded: sbt is updated from 1.3.7 to 1.9.8, and ScalaPB is upgraded from 0.9.6 to 1.0.6 (with the compiler plugin moving to 0.11.14). ZIO is updated to version 2.1.13, and gRPC is updated to 1.64.0. New sbt plugins have been added to support Scala.js (sbt-scalajs 1.17.0, sbt-scalajs-crossproject 1.2.0, sbt-scalajs-bundler 0.21.1) and multi-project matrix builds (sbt-projectmatrix 0.11.0), while sbt-assembly has been removed. Additionally, the auto-generated metals.sbt file has been deleted.

project · high confidence

Upgrade gRPC to 1.64.0 and ZIO to 2.x across examples and build

The examples (fullapp, helloworld, routeguide) and the main build configuration now use gRPC version 1.64.0 and ZIO 2.x (via Version.zio), replacing the previous gRPC 1.26.0 and ZIO 1.0.0-RC17. The build has been migrated to sbt-projectmatrix to support Scala 2.12, 2.13, and 3.3.6, with the code generator package renamed to scalapb.zio\_grpc. The website dependencies have been updated to Docusaurus 2.2.0, React 16.14.0, and associated Algolia search libraries.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 68.

Lenses

  • Code Health 98
  • Architecture 100
  • Maturity 57
  • Readiness 65
  • Security 82

Changes since last survey

  • 300 commits — 276 feature/other, 24 fixes

By area

  • (root) — 56 commits
  • core/src — 42 commits
  • project/plugins.sbt — 42 commits
  • examples/fullapp — 37 commits
  • project/Versions.scala — 33 commits
  • website/yarn.lock — 21 commits
  • .github/workflows — 16 commits
  • e2e/src — 11 commits
  • examples/helloworld — 10 commits
  • project/build.properties — 7 commits
  • website/docusaurus.config.js — 4 commits
  • code-gen/src — 3 commits
  • examples/routeguide — 3 commits
  • website/versioned_docs — 3 commits
  • (repo) — 2 commits
  • benchmarks/src — 2 commits
  • docs/basics.md — 2 commits
  • .github/dependabot.yml — 1 commit
  • docs/backpressure.md — 1 commit
  • docs/context.md — 1 commit

Notable commits

  • fix: Attempt to fix flaky test
  • fix: Fix BindableServiceSpec
  • fix: Fix Java 8 compatibility
  • fix: Fix Scala.js implementation
  • fix: Fix backpressure queue size property name
  • fix: Fix client connection leak on non-failure, non-interruption cases (#648)
  • fix: Fix docs for zio update
  • fix: Fix for versioned docs
  • fix: Fix java version
  • fix: Fix resolves deprecation in sbt
  • fix: Fix sbt syntax deprecation
  • fix: Fix tests for renames
  • fix: Fix tests for renames
  • fix: Fix tutorial to include sayHelloAgain in the other implementation.
  • fix: Revert "Update sbt to 1.8.0 (#443)"
  • fix: Revert "fix: cleanup call fiber on exit (#515)" (#539)
  • fix: Scalafmt fix
  • fix: Update formatting for other examples and fix sbt deprecation warning
  • fix: fix examples
  • fix: fix: cleanup call fiber on exit (#515)
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

scalapb/zio-grpc was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 8301b09caf6cf35a904983d1fa66a311bda9aa15 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.