Skip to content

v0.2.1

Choose a tag to compare

@0xrinful 0xrinful released this 21 Sep 03:02
· 8 commits to main since this release

Rush v0.2.1

Breaking Changes

1. Complete Middleware System Redesign

Two-level middleware architecture:

  • Global middleware (r.Use()) wraps the entire router — affects all routes and error handlers.
  • Group middleware is order-dependent and accumulative — routes inherit middleware defined above them.
  • Single-route middleware with .With() method for isolated application.

Fix: Stateful middlewares now work correctly.
Previously, middleware chains were stored per-route, causing stateful middleware to malfunction.
Global middlewares now wrap the router properly.


2. Options Handler Renamed

  • r.Options (breaking) → now a method for registering OPTIONS routes.
  • r.AutoOptions → new property for setting the global OPTIONS handler.

This change makes the API more consistent:

  • Use r.Options(pattern, handler) for route-specific OPTIONS handlers.
  • Use r.AutoOptions = handler for the default/global OPTIONS behavior.