Skip to content

Releases: connectrpc/connect-query-es

v0.5.2

06 Oct 18:42
9c079bf
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.1...v0.5.2

v0.5.1

26 Sep 14:05
b1149da
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.4.4...v0.5.1

Summary of breaking changes

Changes in @connectrpc/connect-query

Breaking changes

  • Removed UnaryHooks type and replaced with UnaryFunctionsWithHooks
  • Updated createUnaryHooks to only return the hooks and not other functions

New functions

createUnaryFunctions

Introduced createUnaryFunctions which can be used with the new createUnaryHooks to do the same thing as the old createUnaryHooks. The reasoning behind this change is to prep the core library, connect-query, to be able to used separately from React itself and this is just the first step in that direction.

Changes in code generated by protoc-gen-connect-query and protoc-gen-connect-query-react

New functions

Each service method now generates two new functions associated to the method:

method.createUseInfiniteQueryOptions

This method creates options that will pass to useInfiniteQuery. It is identical to method.useInfiniteQuery except it needs to be passed a transport directly.

createUseMutationOptions

This method creates options that will pass to useMutation. It is identical to method.useMutation except it needs to be passed a transport directly.

We added these methods to better future-proof the code for incoming changes to React (React Server Components, etc).

Migration

  • Replace any usages of the type UnaryHooks with UnaryFunctionsWithHooks
  • Find any usages of createUnaryHooks and use a combination of createUnaryHooks and createUnaryFunctions

Before

const say = createUnaryHooks(ExampleService);

After

const say = {
  ...createUnaryHooks(ExampleService),
  ...createUnaryFunctions(ExampleService),
}

v0.4.4

13 Sep 17:35
9255864
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.4.3...v0.4.4

v0.4.3

11 Sep 18:17
d763f1e
Compare
Choose a tag to compare

What's Changed

Testing simplification

Exported serviced type allows you to directly use service with createRouterTransport from @connectrpc/connect with the exported service:

import { createRouterTransport } from "@connectrpc/connect";
import { ElizaService } from "./gen/eliza-ElizaService_connectquery";

...

const transport = createRouterTransport(({ service }) => {
  service(ElizaService, {
    say: () => ({
      sentence: "Hello, world!",
    }),
  });
});

For more details, see example test here.

Full Changelog: v0.4.2...v0.4.3

v0.4.2

21 Aug 19:08
cf71de2
Compare
Choose a tag to compare

What's Changed

To keep Connect well-maintained and responsive to its users' needs over the long term, we're preparing to donate it to a foundation. (More details on that soon!) To cleanly separate Connect from Buf's other code, we're moving development to the connectrpc GitHub organization and to the connectrpc organization on npmjs.com.

This is the first release that publishes packages with the new @connectrpc scope. To make the switch seamless, we are introducing a small tool that updates all references in your project automatically, @connectrpc/connect-migrate.

The switch is as simple as running a single command:

$ npx @connectrpc/connect-migrate@latest
Scanning... ✓
    1 package.json file
    1 lock file
    5 source files
Updating source files... 
  src/client.ts ✓
  src/server.ts ✓
  src/webclient.ts ✓
Updating packages... ✓
  package.json ✓
Updating lock file... 
  package-lock.json ✓
Old package New package
@bufbuild/connect v0.13.0 @connectrpc/connect v0.13.1
@bufbuild/connect-web v0.13.0 @connectrpc/connect-web v0.13.1
@bufbuild/connect-fastify v0.13.0 @connectrpc/connect-fastify v0.13.1
@bufbuild/connect-node v0.13.0 @connectrpc/connect-node v0.13.1
@bufbuild/connect-next v0.13.0 @connectrpc/connect-next v0.13.1
@bufbuild/connect-express v0.13.0 @connectrpc/connect-express v0.13.1
@bufbuild/protoc-gen-connect-es v0.13.0 @connectrpc/protoc-gen-connect-es v0.13.1
@bufbuild/connect-query v0.4.1 @connectrpc/connect-query v0.4.2
@bufbuild/protoc-gen-connect-query v0.4.1 @connectrpc/protoc-gen-connect-query v0.4.2
@bufbuild/protoc-gen-connect-query-react v0.4.1 @connectrpc/protoc-gen-connect-query-react v0.4.2

Full Changelog: v0.4.1...v0.4.2

v0.4.1

11 Aug 21:34
0b1c375
Compare
Choose a tag to compare

What's Changed

  • Use corepack to guarantee pnpm version by @paul-sachs in #60
  • Update protoc-gen-connect-query to output RPC idempotency by @timostamm in #63
  • Feat: Additional plugin to generate connect-query with hooks by @vctqs1 in #59
  • Update readme with some references to react specific plugin by @paul-sachs in #64
  • Release protoc-gen-connect-query-react by @paul-sachs in #65
  • Add import-hook-form to table of contents in protoc-gen-connect-query-react readme by @vctqs1 in #68
  • Update references by @smaye81 in #72
  • Fix: react-query typescript in connect-query-plugin by @vctqs1 in #69

New Contributors

Full Changelog: v0.4.0...v0.4.1