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

Bump the connect-and-protobuf group with 2 updates #160

Merged
Merged
Show file tree
Hide file tree
Changes from 6 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
31 changes: 17 additions & 14 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.9.0",
"prettier": "^3.2.5",
"typescript": "^5.5.4"
"typescript": "~5.5.4"
Copy link
Member

Choose a reason for hiding this comment

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

Switched to only latest patch version bc 5.6 and above is not compatible with @typescript-eslint/estree.

},
"dependencies": {
"@types/jasmine": "^5.1.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/connect-playwright-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"@bufbuild/buf": "^1.43.0",
"@bufbuild/protobuf": "^2.1.0",
"@bufbuild/protoc-gen-es": "^2.1.0",
"@connectrpc/connect": "^2.0.0-alpha.1",
"@connectrpc/connect-web": "^2.0.0-alpha.1",
"@connectrpc/connect": "^2.0.0-beta.1",
"@connectrpc/connect-web": "^2.0.0-beta.1",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"esbuild": "^0.24.0",
"prettier": "^3.3.2",
"typescript": "^5.5.4"
"typescript": "~5.5.4"
},
"dependencies": {
"@connectrpc/connect-playwright": "^0.4.0",
Expand Down
12 changes: 4 additions & 8 deletions packages/connect-playwright-example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
// limitations under the License.

import { useCallback, useState, FormEvent, FC } from "react";
import {
ConnectError,
createPromiseClient,
PromiseClient,
} from "@connectrpc/connect";
import { ConnectError, createClient, Client } from "@connectrpc/connect";
import {
createGrpcWebTransport,
createConnectTransport,
Expand All @@ -30,7 +26,7 @@ interface ChatMessage {
}

const baseUrl = "https://demo.connectrpc.com";
let elizaClient: PromiseClient<typeof ElizaService>;
let elizaClient: Client<typeof ElizaService>;
Copy link
Member

Choose a reason for hiding this comment

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

Fine to update to the beta here. This change is expected.


// Read the transport and format parameters from the URL
// Note that users do not need to worry about this since this is just for
Expand All @@ -41,15 +37,15 @@ const transportParam = params.get("transport");
const useBinaryFormat = params.get("format") === "binary";

if (transportParam === "grpcweb") {
elizaClient = createPromiseClient(
elizaClient = createClient(
ElizaService,
createGrpcWebTransport({
baseUrl,
useBinaryFormat,
}),
);
} else {
elizaClient = createPromiseClient(
elizaClient = createClient(
ElizaService,
createConnectTransport({
baseUrl,
Expand Down
2 changes: 2 additions & 0 deletions packages/connect-playwright/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: v2
# Deletes the directories specified in the `out` field for all plugins before running code generation.
clean: true
plugins:
- local: protoc-gen-es
out: src/testdata/gen
Expand Down
23 changes: 9 additions & 14 deletions packages/connect-playwright/src/testdata/gen/test_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,14 @@

import type { GenFile, GenService } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
import type {
Int32ValueSchema,
StringValueSchema,
} from "@bufbuild/protobuf/wkt";
import type { Int32ValueSchema, StringValueSchema } from "@bufbuild/protobuf/wkt";
Copy link
Member

Choose a reason for hiding this comment

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

Looks like "generate" and "format" are racing here. We should ignore src/testdata in "format" in packages/connect-playwright/package.json.

import { file_google_protobuf_wrappers } from "@bufbuild/protobuf/wkt";

/**
* Describes the file test.proto.
*/
export const file_test: GenFile =
/*@__PURE__*/
fileDesc(
"Cgp0ZXN0LnByb3RvEgR0ZXN0MusBCgtUZXN0U2VydmljZRJFCghVbmFyeU9uZRIbLmdvb2dsZS5wcm90b2J1Zi5JbnQzMlZhbHVlGhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlEkUKCFVuYXJ5VHdvEhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUaHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUSTgoPU2VydmVyU3RyZWFtaW5nEhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUaHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUwAWIGcHJvdG8z",
[file_google_protobuf_wrappers],
);
export const file_test: GenFile = /*@__PURE__*/
fileDesc("Cgp0ZXN0LnByb3RvEgR0ZXN0MusBCgtUZXN0U2VydmljZRJFCghVbmFyeU9uZRIbLmdvb2dsZS5wcm90b2J1Zi5JbnQzMlZhbHVlGhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlEkUKCFVuYXJ5VHdvEhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUaHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUSTgoPU2VydmVyU3RyZWFtaW5nEhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUaHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUwAWIGcHJvdG8z", [file_google_protobuf_wrappers]);

/**
* @generated from service test.TestService
Expand All @@ -45,21 +38,23 @@ export const TestService: GenService<{
methodKind: "unary";
input: typeof Int32ValueSchema;
output: typeof StringValueSchema;
};
},
/**
* @generated from rpc test.TestService.UnaryTwo
*/
unaryTwo: {
methodKind: "unary";
input: typeof Int32ValueSchema;
output: typeof StringValueSchema;
};
},
/**
* @generated from rpc test.TestService.ServerStreaming
*/
serverStreaming: {
methodKind: "server_streaming";
input: typeof Int32ValueSchema;
output: typeof StringValueSchema;
};
}> = /*@__PURE__*/ serviceDesc(file_test, 0);
},
}> = /*@__PURE__*/
serviceDesc(file_test, 0);