Skip to content

v0.5.0 - rkyv, brotli, cache-control, packer lib+bin, tested

Choose a tag to compare

@peku33 peku33 released this 17 Apr 16:27
· 5 commits to master since this release

Migrating from 0.4.x to 0.5.x

The 0.5.0 is almost a complete rewrite, however the general idea remains the same.

  • We still have two parts - packer and loader. There is also a common crate and tests crate, however they are not meant to be used directly.
  • Lots of internals were changed, including rkyv for serialization / zero-copy deserialization. This of course makes packs built with previous versions incompatible with current loader and vice versa.
  • We are now built around http crate, which makes web-static-pack compatible with hyper 1.0 without depending on it directly.

BREAKING CHANGES

  • Packer is now built around subcommands. The previous behavior was moved to directory-single subcommand, and root_path parameter was dropped. See examples.
  • Since we no longer depend on hyper in any way (the http crate is common interface), hyper_loader feature is no longer present in loader.
  • let loader = loader::Loader::new(...) is now let pack_archived = loader::load(...). This value is still used for Responder::new.
  • hyper_loader::Responder is now just responder::Responder, and it's now built around http crate, compatible with hyper 1.0.
  • Responder was rewritten. It now accepts (method, path, headers) not whole request. request_respond_or_error and parts_respond_or_error are squashed to respond. request_respond and parts_respond are squashed to respond_flatten.

New features and improvements

  • True zero-copy deserialization with rkyv.
  • brotli compression support.
  • cache-control support.
  • Packer is now a lib + bin, making it usable in build.rs. Multiple useful methods were exposed.
  • Good test coverage, including integration tests.
  • Lots of internal improvements.