Skip to content

Releases: rust-dd/tako

v2.0.1

Choose a tag to compare

@dancixx dancixx released this 08 Jun 11:22
6821fd7
  • plugins: the compression middleware now uses Iterator::find for Accept-Encoding negotiation (choose_encoding) instead of a manual loop. Behavior identical.
  • Internal refactor: every source file over 400 lines (31 files across all crates) split into responsibility-based submodules. Public paths preserved via re-exports — module structure only, no functional change.

v2.0.0

Choose a tag to compare

@dancixx dancixx released this 29 May 11:46
59e0d76

See MIGRATION_1_TO_2.md for an upgrade walkthrough covering every breaking change, including code-mod recipes for the macros and typed-state APIs.

Added

  • Per-router typed stateRouter::with_state(T) replaces the old per-type GLOBAL_STATE slot; multiple routers in the same process can now hold independent state of the same type.
  • Sub-routing primitivesRouter::nest("/path", child) and Router::scope("/api", |s| { … }) replace Router::merge and add a real prefix-stripping pass.
  • Result-aware handlers — handlers may return Result<R, E> whereE: Responder; error_handler is paired with a new client_error_handler, and use_problem_json() emits RFC 7807 application/problem+json bodies.
  • Method-aware routing — non-matched verbs now return 405 Method Not Allowed with the proper Allow header instead of 404.
  • Server::builder() — unified bootstrap across HTTP/1.1, HTTP/2, HTTP/3, TLS, mTLS, and Unix sockets; replaces the matrix of serve_* / serve_tls_* entry points.
  • TLS knobsTlsCert::{Pem, Der, Resolver}, ReloadableResolver, ClientAuth for full mTLS, SNI-based cert selection, and hot reload.
  • ConnInfo — unified peer extension; replaces the SocketAddr / UnixPeerAddr split.
  • Runtime-agnostic ServerHandle — graceful-shutdown handle that works uniformly across the Tokio and Compio runtimes.
  • Thread-per-core runtime (per-thread, per-thread-compio features) — N×current-thread workers + SO_REUSEPORT bootstrap.

Changed

  • MSRV: 1.95 — bumped from 1.87.
  • Edition: 2024 — workspace-wide.
  • Macros — route paths support both {id} and {id: u64} forms; no Params struct is materialised unless a typed slot exists.
  • Workspace is fully publishable — every internal sub-crate now publishes on crates.io as tako-rs-core, tako-rs-extractors, tako-rs-macros, tako-rs-plugins, tako-rs-server, tako-rs-server-pt, tako-rs-streams alongside the umbrella tako-rs crate. Use the umbrella crate; the sub-crates are considered implementation detail.
  • tako-core-local — the separate !Send router was removed; the unified Router is Send + Sync and serves both runtimes.
  • Compio runtime — feature flags compio, compio-tls, compio-ws now compose cleanly with the rest of the framework. Compio is treated as a first-class runtime alongside Tokio.

Removed

  • serve_* family of free functions — use Server::builder().
  • Router::merge — use nest / scope instead.
  • Router::state(T) global slot — use Router::with_state(T).
  • 1.x Params global struct — typed extractors replace it.

Security

  • cargo deny check is a CI gate; the v2 advisories schema fails the build on unignored vulnerabilities, unsoundness, and unmaintained crates.
  • mTLS support via ClientAuth for hardened internal endpoints.

Deferred to 2.x (not in this release)

The migration guide enumerates these in full; tracked separately from breaking changes:

  • tako-stores-redis / tako-stores-postgres companion crates (multi-replica SessionStore / RateLimitStore / IdempotencyStore backends).
  • TlsCert::Acme (rustls-acme integration).
  • HTTP/3 qlog (needs quinn bump).
  • Multipart / byteranges responder + Linux sendfile(2) path on FileStream.
  • Real WebTransport CONNECT handshake (currently aliased to raw-QUIC).
  • gRPC reflection / health protobuf-generated stubs.
  • Cluster SignalBus Redis / NATS / Kafka implementations.
  • v2 client HTTP/2 + HTTP/3 + reqwest-style middleware.
  • Hot-reload Arc<Router> swap.

What's Changed

Full Changelog: v1.1.2...v2.0.0

v1.1.2

Choose a tag to compare

@dancixx dancixx released this 10 Apr 22:41
2fe1a55

Performance improvements

  • RPITIT handler dispatch — Handler trait switched to return-position impl trait, eliminating double Box::pin allocation per request (1 heap alloc instead of 2)
  • Lock-free route configRwLock<Option<Duration>> and RwLock<Option<SimdJsonMode>> replaced with OnceLock for zero-overhead reads on the hot path
  • Static router reference — Router is leaked into &'static to eliminate all Arc refcount bumps per connection and per request
  • Middleware emptiness flagsAtomicBool flags on Router and Route skip ArcSwap::load() when no middleware is registered
  • HTTP/1.1 pipeline flush — Enabled pipeline_flush(true) on the hyper HTTP/1 builder for better pipelining throughput
  • Method clone eliminatedreq.method().clone() removed from dispatch hot path, using direct reference instead
  • Inline dispatch#[inline] added to the dispatch function

v1.1.1

Choose a tag to compare

@dancixx dancixx released this 01 Apr 07:06
8996eef

What's Changed

  • feat: JWT middleware refactored to trait-based design (JwtVerifier trait) — no mandatory JWT dependency
  • feat: jwt-simple crate moved behind optional jwt-simple feature flag
  • fix: compiler error

Breaking Changes

  • jwt-simple is no longer included by default. Enable the jwt-simple feature to restore the previous AnyVerifyKey / MultiKeyVerifier API.
  • New JwtVerifier trait allows plugging in any JWT library.

tako v.1.1.0

Choose a tag to compare

@dancixx dancixx released this 11 Mar 22:51
0752f44

Performance-focused release — routing, body handling, middleware, and connection setup all received significant optimizations.

Highlights

  • O(1) method dispatch via MethodMap — fixed-size array replaces HashMap for HTTP method routing
  • Zero-allocation body — new TakoBody enum avoids boxing for Full, Empty, and Incoming variants
  • Lock-free middlewareArcSwap replaces RwLock for route middleware storage
  • TCP_NODELAY on all connections — eliminates Nagle's algorithm latency
  • Custom path params deserializer — zero-copy str::parse() instead of JSON intermediary
  • LTO + codegen-units=1 in release profile for maximum binary optimization
  • 111 tests across 8 test suites · 36 examples

What's New (since v1.0.0)

Performance

Optimization Before After
Method dispatch HashMap<Method, _> lookup MethodMap fixed-size array (O(1) index)
Response body Always-boxed BoxBody TakoBody enum — Full/Empty/Incoming unboxed
Middleware reads RwLock<Vec<BoxMiddleware>> ArcSwap<Vec<BoxMiddleware>> (lock-free)
TCP connections Default (Nagle on) TCP_NODELAY enabled
Path params serde_json round-trip Custom Deserializer with str::parse()
Release binary Default LTO lto = "fat", codegen-units = 1

Routing Rework

  • Complete routing rewrite for performance
  • MethodMap stores handlers in a [Option<RouteEntry>; 9] array indexed by method
  • Dispatch is a direct array index — no hashing, no branching

Auth Handlers

  • Improved BasicAuth, BearerAuth, and JwtAuth handler ergonomics

Middleware & Routing Logic

  • Updated middleware chaining and routing dispatch
  • ArcSwap load guard pattern for zero-contention middleware reads

Examples

  • All 36 examples restructured as standalone crates with their own Cargo.toml
  • Added streams-compio and tls-compio examples
  • Fixed dependency declarations across all example crates

Fixes

  • Fixed vespera_core compatibility (pinned to v0.1.43) for OpenAPI integration
  • Fixed Compio feature dead-code warnings (BodyInner::Incoming, incoming())
  • Fixed missing dependencies in example crates (graphql-generic-ws, openapi, openapi-utoipa, streams)

Breaking Changes

None. All changes are internal optimizations. Existing v1.0.0 code compiles without changes.

Full Changelog: tako-v.1.0.0...tako-v.1.1.0

tako v.1.0.0

Choose a tag to compare

@dancixx dancixx released this 02 Mar 13:59
c183533

The first stable release of Tako — a lightweight, high-performance async web framework for Rust built on Hyper 1.x and Tokio, with optional Compio runtime support.

Highlights

  • Graceful shutdown across all server variants with configurable drain timeout
  • 8 transports — HTTP/1.1, HTTP/2, HTTP/3, WebTransport, Unix sockets, raw TCP/UDP, PROXY protocol
  • HTTP/2 on Compio — full ALPN-based H2 via SendWrapper pattern
  • Background job queue — named queues, retry policies (fixed/exponential), delayed jobs, dead letter queue
  • Route-level SIMD JSON configSimdJsonMode::Always | Never | Threshold(n) per route
  • 10 middleware · 5 plugins · 22+ extractors · 106 tests · 29 examples

What's New (since v0.7.2)

Transports

Transport Tokio Compio Shutdown
HTTP/1.1
HTTP/2 (TLS+ALPN)
HTTP/3 (QUIC)
WebTransport
Unix Domain Socket
Raw TCP
Raw UDP
PROXY protocol v1/v2

Core

  • serve_with_shutdown() — graceful shutdown for all server variants
  • router.error_handler() — global 5xx error hook
  • Per-router and per-route timeouts with custom fallback
  • Config<T> — env-var configuration loader
  • Job queueQueue::builder().workers(4).retry(RetryPolicy::exponential(3, 500ms)).build() with push(), push_delayed(), dead letter queue, graceful shutdown()

New Middleware

SecurityHeaders · RequestId · SessionMiddleware · Csrf · UploadProgress · BodyLimit (stream enforcement) · ApiKeyAuth

New Extractors

Accept · Protobuf<T>

Performance

  • SIMD JSON auto-dispatch with route-level SimdJsonMode config (default threshold: 2 MB)
  • Query/Form single-pass deserialization via serde_urlencoded (eliminated double JSON serialization)

Stability

  • Eliminated all runtime .unwrap() panics (TLS cert loading, compression, config)
  • Fixed Compio + HTTP/3 and Compio + HTTP/2 feature conflicts

Full Inventory

Middleware (10): ApiKeyAuth · BasicAuth · BearerAuth · BodyLimit · Csrf · JwtAuth (14 algorithms) · RequestId · SecurityHeaders · SessionMiddleware · UploadProgress

Plugins (5): CorsPlugin · CompressionPlugin (Gzip/Brotli/DEFLATE/Zstd) · RateLimiterPlugin · MetricsPlugin (Prometheus/OTel) · IdempotencyPlugin

Extractors (22+): Accept · AcceptLanguage · BasicCredentials · BearerToken · Bytes · CookieJar · PrivateCookieJar · SignedCookieJar · Form<T> · HeaderMap · IpAddr · Json<T> · SimdJson<T> · Jwt<C> · Multipart · PathParams · Path<T> · Protobuf<T> · Query<T> · RangeHeader · State<T> · &mut Request

106 tests across 8 test suites · 29 examples including gRPC, WebTransport, job queue, GraphQL, OpenTelemetry

Breaking Changes

None. All new features are additive and feature-gated. Existing v0.7.x code compiles without changes.

Full Changelog: tako-v.0.7.1-2...tako-v.1.0.0

tako v.0.7.1-2

Choose a tag to compare

@dancixx dancixx released this 14 Jan 08:51

tako v.0.7.0

Choose a tag to compare

@dancixx dancixx released this 12 Jan 18:41

What's Changed

Notes

Compio support is experimental. If you want to use WebSocket then pick tokio runtime

Full Changelog: tako-v.0.6.1...tako-v.0.7.0

tako-v.0.6.1

Choose a tag to compare

@dancixx dancixx released this 30 Nov 10:43

What's Changed

  • feat: zero copy extractor by @dancixx in #12
  • feat: Fix build on FreeBSD by updating jwt-simple to use "pure-rust" by @yonas in #13
  • chore: Format fixes via cargo fmt. by @yonas in #15

New Contributors

  • @yonas made their first contribution in #13

Full Changelog: tako-v.0.6.0...tako-v.0.6.1

tako-v.0.6.0

Choose a tag to compare

@dancixx dancixx released this 17 Nov 15:03

tako-v.0.6.0

Features

  • Signals system + examples (#11)
  • Metrics plugin
  • State extractor, protocol version guard
  • Automatic fallback port if requested port is unavailable

Fixes

  • Updated CORS defaults
  • Stable global middleware execution
  • Naming/visibility cleanups
  • Import/module export fixes
  • Misc feature-flag fix

Refactors / Internals

  • Switch to http/http-body
  • Replace Incoming with TakoBody
  • Remove lifetimes from header map / path types
  • Introduce internal RwLock usage
  • Version bumps + doc updates

Migration notes

  • Update body types + imports to http/http-body
  • Replace Incoming with TakoBody
  • Adjust code using header/path lifetimes
  • Revisit CORS + middleware behavior if relying on old defaults

Full Changelog: tako-v.0.5.0...tako-v.0.6.0