overmindtech / sdp

Protobuf based protocol for describing the state of a system
Other
4 stars 1 forks source link

chore(deps): update dependency @connectrpc/protoc-gen-connect-query to v1 #168

Closed renovate[bot] closed 9 months ago

renovate[bot] commented 9 months ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@connectrpc/protoc-gen-connect-query (source) ^0.6.0 -> ^1.0.0 age adoption passing confidence

Release Notes

connectrpc/connect-query-es (@​connectrpc/protoc-gen-connect-query) ### [`v1.1.1`](https://togithub.com/connectrpc/connect-query-es/releases/tag/v1.1.1) [Compare Source](https://togithub.com/connectrpc/connect-query-es/compare/v1.1.0...v1.1.1) #### What's Changed - Fix dual package hazard in nodejs by [@​paul-sachs](https://togithub.com/paul-sachs) in [https://github.com/connectrpc/connect-query-es/pull/310](https://togithub.com/connectrpc/connect-query-es/pull/310) **Full Changelog**: https://github.com/connectrpc/connect-query-es/compare/v1.1.0...v1.1.1 ### [`v1.1.0`](https://togithub.com/connectrpc/connect-query-es/releases/tag/v1.1.0) [Compare Source](https://togithub.com/connectrpc/connect-query-es/compare/v1.0.0...v1.1.0) #### What's Changed - Update imports to include file extensions by [@​paul-sachs](https://togithub.com/paul-sachs) in [https://github.com/connectrpc/connect-query-es/pull/299](https://togithub.com/connectrpc/connect-query-es/pull/299) and [https://github.com/connectrpc/connect-query-es/pull/307](https://togithub.com/connectrpc/connect-query-es/pull/307) - Added support for cjs output by [@​paul-sachs](https://togithub.com/paul-sachs) in [https://github.com/connectrpc/connect-query-es/pull/303](https://togithub.com/connectrpc/connect-query-es/pull/303) - Loosen peer dependency requirement by [@​paul-sachs](https://togithub.com/paul-sachs) in [https://github.com/connectrpc/connect-query-es/pull/306](https://togithub.com/connectrpc/connect-query-es/pull/306) #### CJS output By default, [protoc-gen-connect-query](https://www.npmjs.com/package/@​connectrpc/protoc-gen-connect-query) (and all other plugins based on [@​bufbuild/protoplugin](https://www.npmjs.com/package/@​bufbuild/protoplugin)) generate ECMAScript `import` and `export` statements. For use cases where CommonJS is difficult to avoid, a new plugin option has been added named `js_import_style` which can be used to generate CommonJS `require()` calls. Here is an example [buf.gen.yaml](https://buf.build/docs/configuration/v1/buf-gen-yaml): ```yaml version: v1 plugins: ### You'll need @​bufbuild/protoc-gen-es v1.6.0 or later - plugin: es out: src/gen opt: js_import_style=legacy_commonjs - plugin: protoc-gen-connect-query out: src/gen opt: js_import_style=legacy_commonjs ``` To view the full PR, see **Added support for cjs output** by [@​paul-sachs](https://togithub.com/paul-sachs) in [https://github.com/connectrpc/connect-query-es/pull/303](https://togithub.com/connectrpc/connect-query-es/pull/303) **Full Changelog**: https://github.com/connectrpc/connect-query-es/compare/v1.0.0...v1.1.0 ### [`v1.0.0`](https://togithub.com/connectrpc/connect-query-es/releases/tag/v1.0.0) [Compare Source](https://togithub.com/connectrpc/connect-query-es/compare/v0.6.0...v1.0.0) #### What's Changed - V1 API: Wrapping react-query by [@​paul-sachs](https://togithub.com/paul-sachs) in [https://github.com/connectrpc/connect-query-es/pull/224](https://togithub.com/connectrpc/connect-query-es/pull/224) #### V1 Release 🚀 Introducing a whole new API for connect-query. This API ties itself more tightly with the fantastic `@tanstack/react-query` in order to improve developer experience and reduce bundle size. At the core of this change is the new `MethodUnaryDescriptor` type, which is essentially just a self contained description of a service method. The new code generator just outputs one of these per method and those are passed to the hooks/methods. This new additional type brings a huge level of flexibility about how we write additional methods, and it's trivial to write your own hooks/methods around these simple types. ##### Example usage ```tsx import { useQuery } from "@​connectrpc/connect-query"; import { say } from "./gen/eliza-ElizaService_connectquery"; ... const { data } = useQuery(say); ``` ##### Breaking changes - `use*Query` hooks now return data instead of just options. - Many `create*` methods have been removed. - `protoc-gen-connect-query` now outputs very simple method descriptors instead of a bunch of hooks per method. ##### Reasoning There are a number of reasons we've decided to make this major breaking change. 1. The API surface is much smaller, leading to less confusion about how to use each method. 2. Smaller core code size and more modular organization leads to better tree shaking (since each generated method doesn't come along with a generated hook). 3. Package names are now explicit about their dependencies, making it easier to develop other packages based on these packages/generated code. 4. More tightly integrating with `@tanstack/react-query@5` provides better usage of Suspense versions of the API. 5. New generated code is easier to expand and build your own custom hooks for. ##### Migration The migration process is easy but manual: ##### Before ```tsx import { getUserOrganization } from "@​apigen/org/alpha/registry/v1alpha1/organization-OrganizationService_connectquery"; import { useQuery } from "@​tanstack/react-query"; ... const getUserOrganizationQuery = useQuery({ ...getUserOrganization.useQuery({ userId: currentUser?.id, organizationId, }), useErrorBoundary: false, enabled: currentUser !== null, }); ``` ##### After ```tsx import { getUserOrganization } from "@​apigen/org/alpha/registry/v1alpha1/organization-OrganizationService_connectquery"; import { useQuery } from "@​connectrpc/connect-query"; ... const getUserOrganizationQuery = useQuery(getUserOrganization, { userId: currentUser?.id, organizationId, }, { useErrorBoundary: false, enabled: currentUser !== null } }); ``` **Full Changelog**: https://github.com/connectrpc/connect-query-es/compare/v0.6.0...v1.0.0

Configuration

📅 Schedule: Branch creation - "before 10am on friday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.

DavidS-ovm commented 9 months ago

@getinnocuous this reads as if it will require some work in the frontend. what do you say?

getinnocuous commented 9 months ago

@getinnocuous this reads as if it will require some work in the frontend. what do you say?

Yes looks that way, much nicer API at least.

DavidS-ovm commented 9 months ago

I'll leave it to you then to schedule merging and porting of this.