diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 5f2482c..4d79c8e 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -1,3 +1,6 @@ +# Launch this workflow with the "Run workflow" button in the Actions tab of the repository. +# +# See https://github.com/github/twirp-rs/blob/main/CONTRIBUTING.md#releasing for more details. name: Create release PR permissions: diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index bdd70eb..317cdb3 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,4 +1,7 @@ -name: Release and unpublished twirp/twirp-build packages +# This workflow only publishes releases for PR's created by create-release-pr.yml +# +# See https://github.com/github/twirp-rs/blob/main/CONTRIBUTING.md#releasing for more details. +name: Release any unpublished twirp/twirp-build packages permissions: contents: write diff --git a/Cargo.lock b/Cargo.lock index 167ee8f..ae699bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1281,7 +1281,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "twirp" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "async-trait", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "twirp-build" -version = "0.8.0" +version = "0.9.0" dependencies = [ "prettyplease", "proc-macro2", diff --git a/crates/twirp-build/CHANGELOG.md b/crates/twirp-build/CHANGELOG.md new file mode 100644 index 0000000..9f5a72b --- /dev/null +++ b/crates/twirp-build/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.9.0](https://github.com/github/twirp-rs/compare/twirp-build-v0.8.0...twirp-build-v0.9.0) - 2025-07-31 + +- See [the changelog for twirp](https://github.com/github/twirp-rs/blob/main/crates/twirp/CHANGELOG.md) for this release. diff --git a/crates/twirp-build/Cargo.toml b/crates/twirp-build/Cargo.toml index 908c318..40a7a96 100644 --- a/crates/twirp-build/Cargo.toml +++ b/crates/twirp-build/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "twirp-build" -version = "0.8.0" +version = "0.9.0" edition = "2021" description = "Code generation for async-compatible Twirp RPC interfaces." readme = "README.md" diff --git a/crates/twirp/CHANGELOG.md b/crates/twirp/CHANGELOG.md new file mode 100644 index 0000000..d68fb27 --- /dev/null +++ b/crates/twirp/CHANGELOG.md @@ -0,0 +1,50 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.9.0](https://github.com/github/twirp-rs/compare/twirp-build-v0.8.0...twirp-build-v0.9.0) - 2025-07-31 + +### Breaking + +- Remove `SERVICE_FQN` to avoid upgrade confusion ([#222](https://github.com/github/twirp-rs/pull/222)) + +#### Breaking: Allow custom headers and extensions for twirp clients and servers; unify traits; unify error type ([#212](https://github.com/github/twirp-rs/pull/212)) + +- No more `Context`. The same capabilities now exist via http request and response [Extensions](https://docs.rs/http/latest/http/struct.Extensions.html) and [Headers](https://docs.rs/http/latest/http/header/struct.HeaderMap.html). +- Clients and servers now share a single trait (the rpc interface). +- It is possible to set custom headers on requests (client side) and it's possible for server handlers to read request headers and set custom response headers. +- The same ☝🏻 is true for extensions to allow interactivity with middleware. +- All the above is accomplished by using `http::request::Request` and `http::response::Response` where `In` and `Out` are the individual rpc message types. +- We have unifyied and simplified the error types. There is now just `TwirpErrorResponse` which models the [twirp error response spec](https://twitchtv.github.io/twirp/docs/spec_v7.html#error-codes). + + +#### Breaking: Generate service fqn ([#221](https://github.com/github/twirp-rs/pull/221)) + +Applications will need to remove any manual service nesting they are doing today. + +In 0.8.0, server consumers of this library have to know how to properly construct the fully qualified service path by using `nest` on an `axum` `Router` like so: + +```rust +let twirp_routes = Router::new() + .nest(haberdash::SERVICE_FQN, haberdash::router(api_impl)); +``` + +This is unnecessary in 0.9.0 (the generated `router` function for each service does that for you). Instead, you would write: + +``` rust +let twirp_routes = haberdash::router(api_impl); +``` + +It is still canonical (but not required) to then nest with a `/twirp` prefix (the examples show this). + +### Other + +- Allow mocking out requests ([#220](https://github.com/github/twirp-rs/pull/220)) +- Swap twirp and twirp-build readmes. Replace the repo readme with a symlink to twirp's readme. ([#215](https://github.com/github/twirp-rs/pull/215)) +- Update the content of the readme ([#216](https://github.com/github/twirp-rs/pull/216)) +- Include the readme in rustdoc ([#225](https://github.com/github/twirp-rs/pull/225)) diff --git a/crates/twirp/Cargo.toml b/crates/twirp/Cargo.toml index a5d3fd7..2dbabc4 100644 --- a/crates/twirp/Cargo.toml +++ b/crates/twirp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "twirp" -version = "0.8.0" +version = "0.9.0" edition = "2021" description = "An async-compatible library for Twirp RPC in Rust." readme = "README.md"