Skip to content

proto-loader: Update protobufjs dependency to 8.x - #3067

Open
slagiewka wants to merge 4 commits into
grpc:masterfrom
slagiewka:protobufjs_8
Open

proto-loader: Update protobufjs dependency to 8.x#3067
slagiewka wants to merge 4 commits into
grpc:masterfrom
slagiewka:protobufjs_8

Conversation

@slagiewka

@slagiewka slagiewka commented Jul 7, 2026

Copy link
Copy Markdown

The only breaking change in the 8.x train is the Edition 2024 support

I took the liberty to bump the version number by a minor the same way 7b4704c did.

Fixes #3062

slagiewka added 2 commits July 9, 2026 21:51
Instead of keeping internal "declare module" override, use the upstream
version added in protobufjs/protobuf.js#2232 and
released in v8.2.0.
@slagiewka

Copy link
Copy Markdown
Author

Since v8 has vastly improved typings that proto-loader can now use. This surfaces the difference in enumType.toDescriptor() as well as allows us to pass keepCase to Root.fromDescriptor.

CC: @dcodeIO

`windows-latest` defaults to `windows-2025` since September 2025[^1] and
ships CMake v4. This project still has requirements for specific v3
CMake.

[^1]:https://github.blog/changelog/2025-07-31-github-actions-new-apis-and-windows-latest-migration-notice/
@slagiewka

Copy link
Copy Markdown
Author

@murgatroid99 I've pushed one extra commit for the Windows build - seems like it's just due to the runner image update. This should confirm that.

@ScottMansfield

Copy link
Copy Markdown

One argument for this that hasn't been made on either this PR or #3062: the 8.x train also removes protobufjs's entire transitive dependency set, which is a meaningful install-size win for everything downstream of proto-loader.

protobufjs dependencies installed
7.6.5 long, @types/node, + 9 × @protobufjs/* 5.66 MB, 13 pkgs
8.7.2 long 3.67 MB, 2 pkgs
−1.99 MB, −11 pkgs

Measured with a clean npm i protobufjs@<v> into an empty directory, Node v26.7.0.

The @types/node half of that has its own history — protobufjs/protobuf.js#1026, #1558, #2019 and #2030 — and it wasn't only about the ~2.7 MB. From #2019:

Adding @types/node to my web projects ends up polluting the global scope… setTimeout infers its return type as Timeout instead of number.

It was resolved upstream in 8.4.0, but every package still on ^7 keeps its consumers pinned behind that fix, since no ^7.x release can reach it.

I ran into this from the other direction while auditing a dependency tree that had both proto-loader and another ^7 consumer: as long as any package in the tree requires ^7, a second consumer moving to ^8 just installs both majors side by side rather than saving anything —

v8.7.2  3.8M  node_modules/protobufjs
v7.6.5  3.1M  node_modules/.../node_modules/protobufjs

so the ecosystem benefit only materialises once the remaining ^7 holdouts move. proto-loader is one of the more widely-depended-on ones, which is why this PR matters beyond Edition 2024 support.

No action needed on my part — just adding the numbers in case they're useful for prioritising the review. Happy to test against a real tree if that helps.

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.

Upgrade to protobufjs version 8

4 participants