Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: Update to Protobuf-ES 2.0.0 #1189

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions packages/connect-cloudflare/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
version: v1
# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml
version: v2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This slipped through while merging main into v2.

# Deletes the directories specified in the `out` field for all plugins before running code generation.
clean: true
plugins:
- plugin: es
- local: protoc-gen-es
include_imports: true
out: ./conformance/gen
opt: target=ts,import_extension=.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions packages/connect-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
"private": true,
"type": "module",
"scripts": {
"pregenerate": "rm -rf conformance/gen/*",
"generate": "buf generate --include-imports .",
"generate": "buf generate",
"conformance": "tsc --noEmit && npm run conformance:server && npm run conformance:client",
"conformance:server": "npx wrangler deploy -c ./conformance/wrangler-server.toml && connectconformance --mode server --conf ./conformance/conformance-cloudflare-server.yaml -v ./conformance/server.ts",
"conformance:client": "npx wrangler deploy -c ./conformance/wrangler-client.toml && connectconformance --mode client --conf ./conformance/conformance-cloudflare-client.yaml -v --known-failing @./conformance/known-failing-client.txt --bind 0.0.0.0 --port 8181 --cert $CLOUDFLARE_WORKERS_REFERENCE_SERVER_CERT --key $CLOUDFLARE_WORKERS_REFERENCE_SERVER_KEY -- ./conformance/client.ts"
},
"dependencies": {
"@bufbuild/protobuf": "^2.0.0-beta.3",
"@bufbuild/protobuf": "^2.0.0",
"@connectrpc/connect": "2.0.0-alpha.1",
"@connectrpc/connect-node": "2.0.0-alpha.1"
},
Expand All @@ -19,6 +18,6 @@
"wrangler": "^3.68.0",
"tsx": "^4.16.5",
"@connectrpc/connect-conformance": "^2.0.0-alpha.1",
"@bufbuild/protoc-gen-es": "^2.0.0-beta.3"
"@bufbuild/protoc-gen-es": "^2.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/connect-conformance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"build:esm": "tsc --project tsconfig.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm"
},
"dependencies": {
"@bufbuild/protobuf": "^2.0.0-beta.3",
"@bufbuild/protobuf": "^2.0.0",
"@connectrpc/connect": "2.0.0-alpha.1",
"fflate": "^0.8.1",
"tar-stream": "^3.1.7",
"undici": "^5.28.4"
},
"devDependencies": {
"@bufbuild/buf": "^1.36.0",
"@bufbuild/protoc-gen-es": "^2.0.0-beta.3",
"@bufbuild/protoc-gen-es": "^2.0.0",
"@types/node-forge": "^1.3.9",
"@types/tar-stream": "^3.1.3",
"@types/debug": "^4.1.12"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions packages/connect-express/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: v1
# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml
version: v2
# Deletes the directories specified in the `out` field for all plugins before running code generation.
clean: true
inputs:
- module: buf.build/connectrpc/eliza
plugins:
- plugin: es
- local: protoc-gen-es
out: src/testdata/gen
opt: ts_nocheck=false,target=ts,import_extension=.js
5 changes: 2 additions & 3 deletions packages/connect-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
},
"scripts": {
"clean": "rm -rf ./dist/*",
"pregenerate": "rm -rf src/testdata/gen/*",
"generate": "buf generate buf.build/connectrpc/eliza",
"generate": "buf generate",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
Expand All @@ -37,7 +36,7 @@
"tsx": "^4.16.5"
},
"peerDependencies": {
"@bufbuild/protobuf": "^2.0.0-beta.3",
"@bufbuild/protobuf": "^2.0.0",
"@connectrpc/connect": "2.0.0-alpha.1",
"@connectrpc/connect-node": "2.0.0-alpha.1"
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/connect-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@connectrpc/connect-conformance": "^2.0.0-alpha.1"
},
"peerDependencies": {
"@bufbuild/protobuf": "^2.0.0-beta.3",
"@bufbuild/protobuf": "^2.0.0",
"fastify": "^4.22.1",
"@connectrpc/connect": "2.0.0-alpha.1",
"@connectrpc/connect-node": "2.0.0-alpha.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"node": ">=16.0.0"
},
"peerDependencies": {
"@bufbuild/protobuf": "^2.0.0-beta.3",
"@bufbuild/protobuf": "^2.0.0",
"next": "^13.2.4 || ^14.2.5",
"@connectrpc/connect": "2.0.0-alpha.1",
"@connectrpc/connect-node": "2.0.0-alpha.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"undici": "^5.28.4"
},
"peerDependencies": {
"@bufbuild/protobuf": "^2.0.0-beta.3",
"@bufbuild/protobuf": "^2.0.0",
"@connectrpc/connect": "2.0.0-alpha.1"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/connect-web-bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ usually do. We repeat this for an increasing number of RPCs.

| code generator | RPCs | bundle size | minified | compressed |
| -------------- | ---: | ----------: | --------: | ---------: |
| Connect-ES | 1 | 276,258 b | 176,396 b | 35,777 b |
| Connect-ES | 4 | 280,524 b | 179,498 b | 36,547 b |
| Connect-ES | 8 | 285,394 b | 183,929 b | 37,515 b |
| Connect-ES | 16 | 294,536 b | 191,553 b | 38,996 b |
| Connect-ES | 1 | 276,454 b | 176,396 b | 35,777 b |
| Connect-ES | 4 | 280,720 b | 179,498 b | 36,547 b |
| Connect-ES | 8 | 285,590 b | 183,929 b | 37,515 b |
| Connect-ES | 16 | 294,732 b | 191,553 b | 38,996 b |
| gRPC-Web | 1 | 876,563 b | 548,495 b | 52,300 b |
| gRPC-Web | 4 | 928,964 b | 580,477 b | 54,673 b |
| gRPC-Web | 8 | 1,004,833 b | 628,223 b | 57,118 b |
Expand Down
Loading