Releases: webrpc/gen-typescript
Releases · webrpc/gen-typescript
v0.22.5
What's Changed
- A proper fix for the Webrpc header name by @VojtechVitek in #49
Full Changelog: v0.22.4...v0.22.5
v0.22.4
What's Changed
- Hotfix for Webrpc header name by @VojtechVitek in #48
Full Changelog: v0.22.3...v0.22.4
v0.22.3
What's Changed
- Fix Webrpc client header, should be enabled by default by @VojtechVitek in #47
There's a bug in this release. Please don't use it.
Full Changelog: v0.22.2...v0.22.3
v0.22.1
v0.22.0
v0.21.0
What's Changed
- Add query keys by @AlexanderKolberg in #41
- Stricter TypeScript by @AlexanderKolberg in #40
Features
Query Keys for React Query / SWR
The generated client now includes a queryKey property with type-safe query key generators for each endpoint. This makes it easy to use with popular data-fetching
libraries like tanstack query and Vercel's SWR
import { useQuery } from '@tanstack/react-query'
import { Example } from './client.gen'
const client = new Example('http://localhost:3000', fetch)
function UserProfile({ userId }) {
const { data } = useQuery({
queryKey: client.queryKey.getUser({ userId }),
queryFn: ({ signal }) => client.getUser({ userId }, undefined, signal)
})
return <div>{data?.user.name}</div>
}The query keys follow the pattern [ServiceName, methodName, request?]
Full Changelog: v0.20.2...v0.21.0
v0.19.0
What's Changed
- Improve TypeScript around error messages by @VojtechVitek in #34
Full Changelog: v0.18.0...v0.19.0
v0.18.0
What's Changed
- Use WebrpcClientAbortedError on abort signal by @VojtechVitek in #32
- Add default HTTP status to error definitions by @VojtechVitek in #33
- Add default HTTP status to schema errors too by @VojtechVitek in #35
Full Changelog: v0.17.0...v0.18.0
v0.17.0
What's Changed
- Add JSDoc comments, support @deprecated annotation by @VojtechVitek in #28
Full Changelog: v0.16.3...v0.17.0
v0.16.3
What's Changed
- Fix typescript possible undefined values by @ScreamingHawk in #27
New Contributors
- @ScreamingHawk made their first contribution in #27
Full Changelog: v0.16.2...v0.16.3