Skip to content
CAI
Software that uses CAICheck a score

scalapb/zio-grpc

54.7

Weak · 6 November 2026

3.1k

lines of production code

Scala

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a ZIO-native gRPC library for Scala that generates client and server stubs from Protocol Buffer definitions. It provides core infrastructure for binding services, handling streaming RPCs, and managing request/response metadata within the ZIO effect system. The codebase also includes comprehensive end-to-end testing for JVM and Scala.js environments, along with example applications demonstrating dependency injection and context transformation.

How it got here

2020 — ZIO 2 and Scala 3 migration

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 ZIO-specific code generator, replaced by a new ScalaPB-integrated generator and native service binding mechanisms. Infrastructure upgrades included moving to sbt-projectmatrix, adding Scala.js support, and launching a new documentation website.

2021 — ZIO 2 migration and example expansion

8 changes.

The project migrated examples to ZIO 2 and introduced breaking API changes to expose gRPC response metadata via new context types. Comprehensive examples were added to demonstrate ZIO-based client and server implementations, including dependency injection, metadata handling, and Dockerized full-stack setups.

2023–2026 — end-to-end testing and benchmarking infrastructure

5 changes.

This period focused on establishing comprehensive end-to-end testing infrastructure for Scala.js web clients and gRPC backpressure mechanics, alongside adding server-streaming benchmarks to evaluate performance. The work also included pinning the Nixpkgs dependency to ensure reproducible builds.

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 ZIO-based RouteGuide example

The routeguide example now provides a complete client and server implementation using ZIO and zio-grpc. The server exposes the standard gRPC RouteGuide service (GetFeature, ListFeatures, RecordRoute, RouteChat) backed by a JSON feature database, while the client demonstrates how to connect, invoke unary and streaming RPCs, and handle responses using ZIO effects.

examples/routeguide · 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

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

Added example demonstrating client-side metadata handling

The helloworld example now includes a new client implementation that shows how to attach custom metadata (such as a user key) to gRPC calls using ZIO's effect system. This example illustrates two approaches: using a client layer with dynamic metadata injection via \withMetadataZIO\, and using a scoped client with fixed metadata that can be overridden per-call.

helloworld · 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

Introduces ZBindableService and ServiceList for ZIO-native service binding

The core library now provides a new \ZBindableService\ trait and \ServiceList\ class to bind gRPC service implementations to a server using ZIO layers. This replaces the previous binding mechanism, allowing services to be added via \ServiceList.add\ or \ServiceList.addFromEnvironment\ and composed into a \ZLayer\ for server startup. The change also introduces \ZTransform\ and \GTransform\ for applying context and error transformations to generated services, and adds \ZClientInterceptor\ for client-side header manipulation.

core · 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 2-based gRPC example with layered services and database integration

The helloworld example has been updated to use ZIO 2 and ZIO-GRPC 0.6.0-test1, introducing a new project structure with dedicated server and client implementations. The example now demonstrates advanced patterns including multiple gRPC services (Greeter and Welcomer) and dependency injection via ZIO layers, specifically showcasing a GreeterWithDatabase service that integrates a mock UserDatabase layer. It also includes a MultipleServices entry point that registers both services and enables the gRPC reflection service for easier testing.

examples/helloworld · high confidence

New fullapp example with updated gRPC service and Docker setup

A new 'fullapp' example has been added to demonstrate a zio-grpc server interacting with a Scala.js client. This example includes a Docker Compose configuration to run an Envoy proxy on port 8080, which forwards requests to the gRPC server on port 9000. The underlying gRPC service definition has been renamed from 'MyService' to 'Greeter' and moved to a shared 'protos' subproject, with the package namespace updated to 'examples'.

examples/fullapp · high confidence

New gRPC server examples demonstrating context transformation and dependency injection

Added two new example server implementations in the \examples/fullapp/server\ directory. \ExampleServer.scala\ demonstrates a basic gRPC service using ZIO and scalapb-zio-grpc, including handling request metadata to conditionally serve errors. \ExampleServerWithMetadata.scala\ provides a more advanced example showing how to transform request context (extracting a user from metadata) and inject dependencies (UserRepo, GreetingsRepo) into the gRPC service implementation using ZIO layers.

fullapp · high confidence

Removals

Removal of ZIO gRPC code generator

The ZIO-specific gRPC code generator (\ZioCodeGenerator.scala\) has been removed from the codebase. This eliminates the ability to automatically generate Scala client and server stubs for gRPC services using the ZIO runtime, meaning users can no longer use this tool to produce ZIO-integrated gRPC bindings.

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

Behavioural changes

Client calls now expose response metadata (trailers) via new context types

Users can now access response metadata (trailers) returned by gRPC servers. This is enabled by new \ResponseContext\ and \ResponseFrame\ types that carry headers, messages, and trailers, and a breaking change in \UnaryClientCallListener\ where the client call result type changed from \(Metadata, Res)\ to \ResponseContext\[Res\]\ and errors now use \StatusException\ instead of \Status\.

repository · 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

Pin Nixpkgs version via JSON manifest

The Nix build environment now uses a pinned version of nixpkgs defined in nix/nixpkgs.json. This change replaces any previous implicit or unversioned dependency with a specific commit (rev 6510408) and its corresponding SHA-256 hash, ensuring reproducible builds by fetching the exact nixpkgs source from the GitHub archive.

nix · 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

Test coverage

Add Scala.js end-to-end browser testing infrastructure; Added Scala.js end-to-end tests for gRPC service interactions; Added end-to-end tests for gRPC backpressure, client calls, and service binding.

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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 54 → 55 (+0.7)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 66 → 66 (+0.0)
  • Architecture 99 → 99 (+0.0)
  • Maturity 63 → 68 (+5.1)
  • Readiness 34 → 35 (+0.5)
  • Security 81 → 73 (-7.6)
  • Performance 100 → 100 (+0.0)

Resolved (5)

  • Documentation: no installation or build instructions (docs/scala.js.md)
  • Off-boarding risk: anonymized user #1
  • Outdated: io.github.cquiroz:scala-java-time_2.12
  • Outdated: io.grpc:grpc-netty
  • Outdated: io.grpc:grpc-services

New (3)

  • Dependency hygiene PARTLY measured — sbt declarations read, dependency currency not (Maven Central unreachable)
  • Medium CVE: [GHSA redacted] (package-lock.json)
  • Off-boarding risk: anonymized user #1

Architecture

  • Unchanged — 0 containers · 3 contexts · 3 edges

Written by cca.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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit d858097c4df010175d9fca9958bcf00d53ebc116 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.