Releases: cloudwego/volo
Volo-HTTP 0.3.0
What's Changed
Notable Changes
Since Volo-HTTP 0.2.14
Bugfix
- Fixed the issue where the
Form
was rejected due to incorrect judgment #538 - Fixed an issue where DNS resolution would always prefer IPv4 addresses #538
Break Changes
Adjust positions of some mods #499
Because the positions of the modules were confusing before, we adjusted the positions of some modules for a better user experience.
volo_http::json::Json
->volo_http::server::extract::Json
volo_http::extension::Extension
->volo_http::utils::Extension
volo_http::cookie::CookieJar
->volo_http::utils::cookie::CookieJar
In addition, Json
and Extension
were not be re-exported in volo_http
, user should import them by its full path.
All Body
s (http_body::Body
) are unified into volo_http::body::Body
#504
For a more unified experience, we wrap hyper::body::Incoming
by volo_http::body::Body
, and default generic types of Router
, MethodRouter
, Route
and FromRequest
have been updated from Incoming
to Body
.
And because Body
is unified, ClientRequest
and ServerRequest
are unified into Request
, and ClientResponse
and ServerResponse
are unified into Response
. Currently XxxRequest
and XxxResponse
are not removed, but marked as deprecated.
If you are using Router
(and MethodRouter
, Route
) and specify Incoming
as its generic type, update it to Body
or remove the generic type directly.
If you implemented FromRequest
without use generic type (use default generic type), the argument type should be updated.
If you used ServerRequest
and ClientRequest
, replace it to Request
. If you used ServerResponse
and ClientResponse
, replace it to Response
.
// old
let _: Router<Incoming> = Router::new().route(...);
// new
let _: Router<Body> = Router::new().route(...);
// or remove generic type
let _: Router = Router::new().route(...);
// old
impl FromRequest for Foo {
type Rejection = ...;
async fn from_request(
cx: &mut ServerContext,
parts: Parts,
body: Incoming,
) -> Result<Self, Self::Rejection> {
}
}
// new
impl FromRequest for Foo {
type Rejection = ...;
async fn from_request(
cx: &mut ServerContext,
parts: Parts,
body: Body,
) -> Result<Self, Self::Rejection> {
}
}
// or use generic type B
impl<B> FromRequest<B> for Foo
where
B: Body + Send,
B::Data: Send,
B::Error: Send,
{
type Rejection = ...;
async fn from_request(
cx: &mut ServerContext,
parts: Parts,
body: B,
) -> Result<Self, Self::Rejection> {
}
}
Most client methods no longer return Result
#509
For a better user experience, we changed the return value of some methods of client that originally returned Result<Self>
to Self
.
In other words, chain calls can be used fluently without adding unwrap
, expect
or ?
in between, they can be removed.
// old
let _ = client.get("http://example.com/").unwrap().send().await;
// new
let _ = client.get("http://example.com/").send().await;
Refactor ClientBuilder
, Target
and CallOpt
#522 #528
In order to make the service function more independent, and unify the user experience of Volo-Thrift, Volo-gRPC and Volo-HTTP, while retaining the characteristics of Volo-HTTP, we refactored ClientBuilder
, Target
and CallOpt
.
ClientBuilder::caller_name
andClientBuilder::callee_name
are renamed toClientBuilder::user_agent
andClientBuilder::default_host
ClientBuilder::fail_on_status
has been removed, you should useFailOnStatus
layer insteadRequestBuilder::set_request_timeout
has been removed, users should useRequestBuilder::with_callopt
andCallOpt::new().with_timeout(...)
instead
// old
let mut builder= ClientBuilder::new();
builder.caller_name(...).callee_name(...).fail_on_status(...);
let client = builder.build();
client.get(...).set_request_timeout(...).send().await;
// new
let mut builder= ClientBuilder::new();
builder.user_agent(...).default_host(...).layer_outer(FailOnStatus::xxx());
let client = builder.build();
client.get(...).with_callopt(CallOpt::new().with_timeout(...)).send().await;
And if you are using customized service discover, you should also pay attention to the following changes:
TargetParser
has been removed, you should implementvolo::client::Apply
for your service discover
Detailed Pull Requests
- chore(volo-http): add docs for test helpers by @yukiiiteru in #497
- chore(volo-http): adjust positions of some mods by @yukiiiteru in #499
- chore(volo-http): refactor
RequestPartsExt
by @yukiiiteru in #501 - chore(volo-http): refactor websocket by @yukiiiteru in #503
- chore(volo-http): wrap
hyper::body::Incoming
byBody
by @yukiiiteru in #504 - chore(volo-http): add mock transport service for client by @yukiiiteru in #506
- feat(http): avoid unnecessary router params vec expansion by @StellarisW in #508
- chore(volo-http): use less
Result
in client by @yukiiiteru in #509 - feat(http): add multipart for server by @StellarisW in #511
- feat(http): add cookie feature for client by @StellarisW in #512
- chore(volo-http): implement
source
forError
s by @yukiiiteru in #519 - chore(volo-http): add TimeoutLayer and FailOnStatus layer by @yukiiiteru in #522
- chore(volo-http): refactor
ClientBuilder
,Target
andCallOpt
by @yukiiiteru in #528 - chore(volo-http): add feature
json-utf8-lossy
by @yukiiiteru in #530 - chore(volo-http): fix previously missed changes to
Body
by @yukiiiteru in #531 - fix(volo-http): fix wrong rule of setting header
Host
by @yukiiiteru in #532 - chore(volo-http): combine C/S Request and C/S Response types by @yukiiiteru in #534
- feat(volo-http): add client ip by @StellarisW in #535
- chore(volo-http): introduce
hyper_util::server::auto
by @yukiiiteru in #537 - fix(volo-http): add mime parsing in server, do not always prefer ipv4 in client dns by @yukiiiteru in #538
Full Changelog: volo-http-0.2.14...volo-http-0.3.0
Volo-HTTP 0.3.0-rc.3
What's Changed
- fix(volo-http): fix wrong rule of setting header
Host
by @yukiiiteru in #532
Full Changelog: volo-http-0.3.0-rc.2...volo-http-0.3.0-rc.3
Volo-HTTP 0.3.0-rc.2
What's Changed
ClientBuilder
,Target
andCallOpt
have been refactoredTimeout
andFailOnStatus
now provided asLayer
s- Add feature
json-utf8-lossy
for using featuresonic-rs/utf8_lossy
- chore(volo-http): add TimeoutLayer and FailOnStatus layer by @yukiiiteru in #522
- chore(volo-http): refactor
ClientBuilder
,Target
andCallOpt
by @yukiiiteru in #528 - chore(volo-http): add feature
json-utf8-lossy
by @yukiiiteru in #530 - chore(volo-http): fix previously missed changes to
Body
by @yukiiiteru in #531
Full Changelog: volo-http-0.3.0-rc.1...volo-http-0.3.0-rc.2
Volo-Thrift 0.10.5
What's Changed
- fix(volo-build): escape keywords in code generation for idl service method arguments by @Ggiggle in #496
- chore(volo-http): add docs for test helpers by @yukiiiteru in #497
- chore: add tests by @Millione in #498
- chore(volo-http): adjust positions of some mods by @yukiiiteru in #499
- chore(volo-http): refactor
RequestPartsExt
by @yukiiiteru in #501 - chore(volo-http): refactor websocket by @yukiiiteru in #503
- chore: fix new clippy rule
empty_line_after_doc_comments
by @yukiiiteru in #505 - chore(volo-http): wrap
hyper::body::Incoming
byBody
by @yukiiiteru in #504 - chore(volo-http): add mock transport service for client by @yukiiiteru in #506
- chore(volo-grpc): fix clippy rule needless_lifetimes by @yukiiiteru in #507
- feat(http): avoid unnecessary router params vec expansion by @StellarisW in #508
- chore(volo-http): use less
Result
in client by @yukiiiteru in #509 - fix(volo-cli): use the raw given path of local idl file by @Ggiggle in #502
- feat(http): add multipart for server by @StellarisW in #511
- chore: fix nightly clippy rule
needless_lifetimes
by @yukiiiteru in #516 - fix(volo): make sure hotrestart sockdir exists by @Millione in #517
- feat(http): add cookie feature for client by @StellarisW in #512
- chore(ci): do not use
apt
for self-hosted runners by @yukiiiteru in #518 - chore(volo-http): implement
source
forError
s by @yukiiiteru in #519 - fix(volo-build): not add vologen prefix for method arguments type with rust type kind by @Ggiggle in #520
- chore(ci): temporarily disable linux aarch64 tests by @PureWhiteWu in #521
- chore(volo-http): add TimeoutLayer and FailOnStatus layer by @yukiiiteru in #522
- chore: update dependency to latest by @PureWhiteWu in #524
- fix(#515): codegen and default problem by @PureWhiteWu in #525
Full Changelog: volo-thrift-0.10.4...volo-thrift-0.10.5
Volo-build 0.10.17
What's Changed
- fix(volo-build): escape keywords in code generation for idl service method arguments by @Ggiggle in #496
- chore(volo-http): add docs for test helpers by @yukiiiteru in #497
- chore: add tests by @Millione in #498
- chore(volo-http): adjust positions of some mods by @yukiiiteru in #499
- chore(volo-http): refactor
RequestPartsExt
by @yukiiiteru in #501 - chore(volo-http): refactor websocket by @yukiiiteru in #503
- chore: fix new clippy rule
empty_line_after_doc_comments
by @yukiiiteru in #505 - chore(volo-http): wrap
hyper::body::Incoming
byBody
by @yukiiiteru in #504 - chore(volo-http): add mock transport service for client by @yukiiiteru in #506
- chore(volo-grpc): fix clippy rule needless_lifetimes by @yukiiiteru in #507
- feat(http): avoid unnecessary router params vec expansion by @StellarisW in #508
- chore(volo-http): use less
Result
in client by @yukiiiteru in #509 - fix(volo-cli): use the raw given path of local idl file by @Ggiggle in #502
- feat(http): add multipart for server by @StellarisW in #511
- chore: fix nightly clippy rule
needless_lifetimes
by @yukiiiteru in #516 - fix(volo): make sure hotrestart sockdir exists by @Millione in #517
- feat(http): add cookie feature for client by @StellarisW in #512
- chore(ci): do not use
apt
for self-hosted runners by @yukiiiteru in #518 - chore(volo-http): implement
source
forError
s by @yukiiiteru in #519 - fix(volo-build): not add vologen prefix for method arguments type with rust type kind by @Ggiggle in #520
- chore(ci): temporarily disable linux aarch64 tests by @PureWhiteWu in #521
- chore(volo-http): add TimeoutLayer and FailOnStatus layer by @yukiiiteru in #522
- chore: update dependency to latest by @PureWhiteWu in #524
- fix(#515): codegen and default problem by @PureWhiteWu in #525
Full Changelog: volo-build-0.10.14...volo-build-0.10.17
Volo-HTTP 0.3.0-rc.1
What's Changed
- Support
MultiPart
at server side - Support
CookieLayer
(a cookie jar) at client side - Add more test utilities for unit testing
Following is all pull requests of this version
Features
- feat(http): add multipart for server by @StellarisW in #511
- feat(http): add cookie feature for client by @StellarisW in #512
Others
- chore(volo-http): add docs for test helpers by @yukiiiteru in #497
- chore(volo-http): adjust positions of some mods by @yukiiiteru in #499
- chore(volo-http): refactor
RequestPartsExt
by @yukiiiteru in #501 - chore(volo-http): refactor websocket by @yukiiiteru in #503
- chore(volo-http): wrap
hyper::body::Incoming
byBody
by @yukiiiteru in #504 - chore(volo-http): add mock transport service for client by @yukiiiteru in #506
- feat(http): avoid unnecessary router params vec expansion by @StellarisW in #508
- chore(volo-http): use less
Result
in client by @yukiiiteru in #509 - chore(volo-http): implement
source
forError
s by @yukiiiteru in #519
Full Changelog: volo-http-0.2.14...volo-http-0.3.0-rc.1
Volo-Thrift 0.10.4
Full Changelog: volo-thrift-0.10.0...volo-thrift-0.10.4
Volo-HTTP 0.2.14
What's Changed
- fix(volo-http): append query for
StripPrefixLayer
by @yukiiiteru in #489 - fix: faststr compile needs to enable serde feature && update dep to latest by @PureWhiteWu in #493
Full Changelog: volo-http-0.2.13...volo-http-0.2.14
Volo-gRPC 0.10.4
volo-grpc-0.10.4 fix: faststr compile needs to enable serde feature && update dep to l…
Volo-cli 0.10.3
volo-cli-0.10.3 fix: faststr compile needs to enable serde feature && update dep to l…