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

Port to v2 #389

Merged
merged 5 commits into from
Sep 23, 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
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,22 @@ const queryClient = new QueryClient();
export const App = () => {
const transport = createConnectTransport({
baseUrl: "<your baseUrl here>",
interceptors: [(next) => (request) => {
request.header.append("some-new-header", "some-value");
// Add your headers here
return next(request);
}],
interceptors: [
(next) => (request) => {
request.header.append("some-new-header", "some-value");
// Add your headers here
return next(request);
},
],
});
return (
<TransportProvider transport={transport}>
<QueryClientProvider client={queryClient}>
<YourApp />
<YourApp />
</QueryClientProvider>
</TransportProvider>
);
}
};
```

For more details about what you can do with the transport, see the [Connect-Web documentation](https://connectrpc.com/docs/web/).
Expand Down
2 changes: 1 addition & 1 deletion cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@
"oneof",
"typesafe"
],
"ignorePaths": ["**/*.svg", "**/*.ai", "**/pnpm-lock.yaml", "*.excalidraw"]
"ignorePaths": ["**/*.svg", "**/*.ai", "**/pnpm-lock.yaml", "*.excalidraw", "**/gen", "**/snapshots"]
}
12 changes: 6 additions & 6 deletions examples/react/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
},
"dependencies": {
"@bufbuild/buf": "1.39.0",
"@bufbuild/protobuf": "^1.10.0",
"@bufbuild/protoc-gen-es": "^1.10.0",
"@connectrpc/connect": "^1.4.0",
"@bufbuild/protobuf": "^2.1.0",
"@bufbuild/protoc-gen-es": "^2.1.0",
"@connectrpc/connect": "^2.0.0-beta.1",
"@connectrpc/connect-query": "workspace:*",
"@connectrpc/connect-web": "^1.4.0",
"@connectrpc/protoc-gen-connect-es": "^1.4.0",
"@connectrpc/connect-web": "^2.0.0-beta.1",
"@connectrpc/protoc-gen-connect-query": "workspace:*",
"@tanstack/react-query": "^5.53.3",
"@tanstack/react-query-devtools": "^5.54.0",
Expand All @@ -30,6 +29,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.5.4",
"vite": "^5.4.6"
"vite": "^5.4.6",
"jest": "^29.7.0"
}
}
14 changes: 2 additions & 12 deletions examples/react/basic/src/gen/eliza-BigIntService_connectquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,9 @@
// @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3)
/* eslint-disable */

import { MethodKind } from "@bufbuild/protobuf";
import { CountRequest, CountResponse } from "./eliza_pb";
import { BigIntService } from "./eliza_pb";

/**
* @generated from rpc connectrpc.eliza.v1.BigIntService.Count
*/
export const count = {
localName: "count",
name: "Count",
kind: MethodKind.Unary,
I: CountRequest,
O: CountResponse,
service: {
typeName: "connectrpc.eliza.v1.BigIntService",
},
} as const;
export const count = BigIntService.method.count;
25 changes: 3 additions & 22 deletions examples/react/basic/src/gen/eliza-ElizaService_connectquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,18 @@
// @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3)
/* eslint-disable */

import { MethodKind } from "@bufbuild/protobuf";
import { SayRequest, SayResponse } from "./eliza_pb";
import { ElizaService } from "./eliza_pb";

/**
* Say is a unary RPC. Eliza responds to the prompt with a single sentence.
*
* @generated from rpc connectrpc.eliza.v1.ElizaService.Say
*/
export const say = {
localName: "say",
name: "Say",
kind: MethodKind.Unary,
I: SayRequest,
O: SayResponse,
service: {
typeName: "connectrpc.eliza.v1.ElizaService",
},
} as const;
export const say = ElizaService.method.say;

/**
* SayAgain is a unary RPC. Eliza responds to the prompt with a single sentence.
*
* @generated from rpc connectrpc.eliza.v1.ElizaService.SayAgain
*/
export const sayAgain = {
localName: "sayAgain",
name: "SayAgain",
kind: MethodKind.Unary,
I: SayRequest,
O: SayResponse,
service: {
typeName: "connectrpc.eliza.v1.ElizaService",
},
} as const;
export const sayAgain = ElizaService.method.sayAgain;
14 changes: 2 additions & 12 deletions examples/react/basic/src/gen/eliza-Haberdasher_connectquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,9 @@
// @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3)
/* eslint-disable */

import { MethodKind } from "@bufbuild/protobuf";
import { Nothing } from "./eliza_pb";
import { Haberdasher } from "./eliza_pb";

/**
* @generated from rpc connectrpc.eliza.v1.Haberdasher.Work
*/
export const work = {
localName: "work",
name: "Work",
kind: MethodKind.Unary,
I: Nothing,
O: Nothing,
service: {
typeName: "connectrpc.eliza.v1.Haberdasher",
},
} as const;
export const work = Haberdasher.method.work;
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,9 @@
// @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3)
/* eslint-disable */

import { MethodKind } from "@bufbuild/protobuf";
import { ListRequest, ListResponse } from "./eliza_pb";
import { PaginatedService } from "./eliza_pb";

/**
* @generated from rpc connectrpc.eliza.v1.PaginatedService.List
*/
export const list = {
localName: "list",
name: "List",
kind: MethodKind.Unary,
I: ListRequest,
O: ListResponse,
service: {
typeName: "connectrpc.eliza.v1.PaginatedService",
},
} as const;
export const list = PaginatedService.method.list;
14 changes: 2 additions & 12 deletions examples/react/basic/src/gen/eliza-SecondService_connectquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,11 @@
// @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3)
/* eslint-disable */

import { MethodKind } from "@bufbuild/protobuf";
import { SayRequest, SayResponse } from "./eliza_pb";
import { SecondService } from "./eliza_pb";

/**
* Say is a unary RPC. Eliza responds to the prompt with a single sentence.
*
* @generated from rpc connectrpc.eliza.v1.SecondService.Say
*/
export const say = {
localName: "say",
name: "Say",
kind: MethodKind.Unary,
I: SayRequest,
O: SayResponse,
service: {
typeName: "connectrpc.eliza.v1.SecondService",
},
} as const;
export const say = SecondService.method.say;
14 changes: 2 additions & 12 deletions examples/react/basic/src/gen/eliza-Slouch_connectquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,9 @@
// @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3)
/* eslint-disable */

import { MethodKind } from "@bufbuild/protobuf";
import { Nothing } from "./eliza_pb";
import { Slouch } from "./eliza_pb";

/**
* @generated from rpc connectrpc.eliza.v1.Slouch.Work
*/
export const work = {
localName: "work",
name: "Work",
kind: MethodKind.Unary,
I: Nothing,
O: Nothing,
service: {
typeName: "connectrpc.eliza.v1.Slouch",
},
} as const;
export const work = Slouch.method.work;
Loading