From a4d83f9c5e947ffd9e9108e0812f41dde07e3f2c Mon Sep 17 00:00:00 2001 From: Tate Thurston Date: Wed, 16 Feb 2022 11:42:04 -0800 Subject: [PATCH] v0.0.46 (#129) Co-authored-by: Tate --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 633d219d..ea617f1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## v0.0.46 + +This version has 3 breaking changes: + +1. (Only impacts TypeScript users) The 'Service' naming suffix has been removed from the generated TypeScript types for services. Given the following proto: + +```proto +service Haberdasher { + rpc MakeHat(Size) returns (Hat); +} +``` + +The generated service type will now be `Haberdasher` instead of `HaberdasherService`. This enables better out of the box compatibility with [buf](https://buf.build/) which expects all service names to end with `Service`. Following this recommendation would generate TwirpScript types with 'ServiceService' suffixes. + +`Service => ` + +2. The 'Handler' suffix has been removed from the generated `createHandler` helper. + +Given the proto above, the generated helper is now `createHaberdasher` instead of `createHaberdasherHandler`. + +`createHandler=> create` + +3. (Only impacts TypeScript users) `optional` types now accept `null` and `undefined`. This enables better compatibility with other tools that may type optionals as `some type | null` + +Changes: + +- remove naming suffixes by @tatethurston in https://github.com/tatethurston/TwirpScript/pull/125 +- add exclude option to twirp.json by @tatethurston in https://github.com/tatethurston/TwirpScript/pull/127 +- add null to optional ts types by @tatethurston in https://github.com/tatethurston/TwirpScript/pull/128 + +**Full Changelog**: https://github.com/tatethurston/TwirpScript/compare/v0.0.45...v0.0.46 + ## v0.0.45 - no longer generate `_readMessageJSON` for empty messages diff --git a/package.json b/package.json index a409151d..81d75f17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "twirpscript", - "version": "0.0.45", + "version": "0.0.46", "description": "A protobuf RPC framework for JavaScript and TypeScript", "license": "MIT", "author": "Tate Thurston ",