Skip to content

Commit

Permalink
v0.0.46 (#129)
Browse files Browse the repository at this point in the history
Co-authored-by: Tate <tate@transcriptic.com>
  • Loading branch information
tatethurston and Tate authored Feb 16, 2022
1 parent 8d57a00 commit a4d83f9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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>Service => <Service>`

2. The 'Handler' suffix has been removed from the generated `create<Service>Handler` helper.

Given the proto above, the generated helper is now `createHaberdasher` instead of `createHaberdasherHandler`.

`create<Service>Handler=> create<Service>`

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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <tatethurston@gmail.com>",
Expand Down

0 comments on commit a4d83f9

Please sign in to comment.