Skip to content

fix: trim runtime dependencies (#36) - #42

Merged
stevendborrelli merged 1 commit into
mainfrom
trim-runtime-deps
Sep 21, 2026
Merged

stevendborrelli merged 1 commit into
mainfrom
trim-runtime-deps

Conversation

@stevendborrelli

Copy link
Copy Markdown
Member

Description of your changes

Reduce SDK size by removing build dependencies.

ts-proto is a build-time protoc plugin, but it was declared as a runtime dependency, so it shipped into every function image along with ts-poet and dprint-node - a 24MB native binary that does not compress away.

The generated wire code imports @bufbuild/protobuf, which was never declared; it resolved only because ts-proto depends on it. Declare it first, then move ts-proto to devDependencies, so the runtime tree is never broken in between.

google-protobuf, @types/google-protobuf and @grpc/proto-loader are not imported anywhere. The first two are leftovers from the pre-ts-proto --ts_out path, whose commented-out invocation is also removed here. @grpc/grpc-js declares proto-loader itself, so dropping it changes nothing on disk.

Production dependency tree: 70MB -> 44MB.

Fixes #

I have:

ts-proto is a build-time protoc plugin, but it was declared as a runtime
dependency, so it shipped into every function image along with ts-poet
and dprint-node — a 24MB native binary that does not compress away.

The generated wire code imports @bufbuild/protobuf, which was never
declared; it resolved only because ts-proto depends on it. Declare it
first, then move ts-proto to devDependencies, so the runtime tree is
never broken in between.

google-protobuf, @types/google-protobuf and @grpc/proto-loader are not
imported anywhere. The first two are leftovers from the pre-ts-proto
--ts_out path, whose commented-out invocation is also removed here.
@grpc/grpc-js declares proto-loader itself, so dropping it changes
nothing on disk.

Production dependency tree: 70MB -> 44MB.

Signed-off-by: Steven Borrelli <steve@borrelli.org>
@stevendborrelli
stevendborrelli merged commit 6511f1c into main Sep 21, 2026
7 checks passed
@stevendborrelli
stevendborrelli deleted the trim-runtime-deps branch September 21, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant