Skip to content

v3.0.0-alpha.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@connorslade connorslade released this 04 Sep 22:36
386caad
  • Use an Arc instead of a Rc for HandleError::Panic
  • Add with_response function on Context to overwrite the response.
  • Finish implementing Websockets. 🎉
  • Add chat app example application.
  • Rename Server::start to Server::run to emphasize that it blocks.
  • Pass Arguments to trace formatters instead of a String.
    This can be more efficient if the formatter decides not to format the trace.
  • Attach a unique ID to each socket.
  • Disallow forbidden headers as default headers.
  • Rename extension module to extensions.
  • Added a RouteShorthand extension.
    It allows you to use server.get(...) instead of server.route(Method::GET, ...).
  • Added Redirect shorthand extension.
    It allows you to use ctx.redirect("...") instead of ctx.status(Status::Found).header(HeaderType::Location, "...").
  • Rewrote the router to allow for more compacted routes.
    Parameters and wildcards no longer have to be separated by a slash, they can be separated by any literal.
    This was not implemented before because it it significantly more complicated to implement.
    Here are some examples of what you can do now:
    • /file/{name}.{ext}
    • /hello*world
  • Internal url::decode will not hard fail in the case of invalid url encoded strings.
  • Add PathNormalizer middleware that removes trailing and repeating slashes from paths.
  • Optimize router. Benchmarking is kinda hard but I think this new router is faster even though it is significantly more flexible.
  • Rename HeaderType to HeaderName as that is the correct name.
  • Accept Into<Header> in Context::header and Response::header.
  • Create 'header structs' that can be converted into a Header and simplify working with headers in responses.

What's Changed

Full Changelog: v2.1.0...v3.0.0-alpha.2