Releases: webrpc/gen-typescript
Releases · webrpc/gen-typescript
v0.15.1
What's Changed
- Add missing types to request header by @AlexanderKolberg in #24
Full Changelog: v0.15.0...v0.15.1
v0.15.0
What's Changed
- render webrpcHeader on client and server if enabled by @LukasJenicek in #23
Full Changelog: v0.14.1...v0.15.0
v0.14.1
What's Changed
- Fix SSE timeout bug by @AlexanderKolberg in #19
- Trim trailing slashes in hostname by @attente in #18
New Contributors
Full Changelog: v0.13.0...v0.14.1
v0.14.0: Fix SSE timeout bug
v0.13.0: Expose as Go module
Merge pull request #16 from webrpc/gomod Expose as a Go module with //go:embed FS
v0.12.0
v0.11.2
Fixes webrpc/webrpc#205
By @kolberg-dev.
v0.11.1
- Tested with webrpc-gen@v0.11.0 ✅
Return WebrpcRequestFailedError on net::ERR_CONNECTION_REFUSED.
v0.11.0 schema errors
- Tested with webrpc-gen@v0.11.0 ✅
See full webrpc@v0.11.0 release.
Note: Schema errors are implemented on client side only for now. TODO: Server side support.
typescript@v0.11.0 breaking client changes
- All errors thrown by webrpc client are now instance of
WebrpcError, which extends JavaScriptError. No need to re-throw errors anymore. error.msgerror.message- by default, the error messages are "human-friendly", they don't contain any details about the backend error cause
- underlying backend error (for developers) is optionally available as
error.cause? error.codeorerror.messagecan be used as input for user-friendly error i18n translations
You can now check for explicit error class instance (as defined in RIDL schema) or against a generic WebrpcError class.
try {
const resp = await testApiClient.getUser();
// setUser(resp.user)
} catch (error) {
if (error instanceof RateLimitedError) {
// retry with back-off time
}
if (error instanceof UnauthorizedError) {
// render sign-in page
}
if (error instanceof WebrpcError) {
console.log(error.status) // print response HTTP status code (ie. 4xx or 5xx)
console.log(error.code) // print unique schema error code; generic endpoint errors are 0
console.log(error.message) // print error message
console.log(error.cause) // print the underlying backend error -- ie. "DB error" - useful for debugging / reporting to Sentry
}
// setError(error.message)
}v0.10.0: Interoperability tests
- Tested with webrpc-gen@v0.10.0 ✅
- Implemented interoperability tests https://github.com/webrpc/gen-typescript/tree/master/tests