Releases: webrpc/gen-typescript
Releases · webrpc/gen-typescript
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.msg
error.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.code
orerror.message
can 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
v0.9.0: Update to webrpc@v0.9.0
Update templates to webrpc@v0.9.0 schema (#4) * Update to webrpc@v0.9.0 JSON schema * Fix generated code * Switch webrpc to https://github.com/webrpc/webrpc/pull/171 * Update RIDL to v0.9.0 * Print all make commands * Regenerate examples
v0.7.3: Fixes runtime template error in types.go.tmpl
types.go.tmpl:27:13: executing "types" at <eq (get $meta "json") "-">: error calling eq: incompatible types for comparison
Fixes webrpc/webrpc#167
v0.7.2: Adds wrapper around fetch() to add native browser support
See #1
Tested with webrpc-gen v0.7.0. ✅
v0.7.1: Standalone TypeScript generator templates
Tested with webrpc-gen v0.7.0. ✅
This version of TypeScript generator spits out generated code that is fully backward-compatible with webrpc-gen v0.6.0.
Previous version (v0.7.0) rendered an extra line compared to webrpc-gen v0.6.0.