Skip to content

Releases: arkstack-hq/clear-router

2.1.9

Choose a tag to compare

@3m1n3nc3 3m1n3nc3 released this 14 Mar 14:52

What's Changed

  • feat: implement group context isolation for async route registration in Router

Full Changelog: 2.1.8...2.1.9

2.1.8

Choose a tag to compare

@3m1n3nc3 3m1n3nc3 released this 12 Mar 13:52

What's Changed

  • feat: enhance Router to support single and array middlewares for HTTP methods
  • feat: add support for middleware in apiResource.

Full Changelog: 2.1.6...2.1.8

2.1.6

Choose a tag to compare

@3m1n3nc3 3m1n3nc3 released this 03 Mar 14:01

Changed

  • Refactored allRoutes() to return raw route objects instead of mapped info for better flexibility in route inspection and tooling.

Added

  • Added controllerName, middlewareCount, handlerType and actionName properties to Route class for improved route context handling.

Full Changelog: 2.1.5...2.1.6

2.1.5

Choose a tag to compare

@3m1n3nc3 3m1n3nc3 released this 03 Mar 12:46

Added

  • Added support for async group callbacks in Express and H3 routers (await Router.group(...)).
  • Updated type definitions and exports configuration in package.json and tsdown.config.ts
  • Improved module exports and build configuration

Full Changelog: 2.1.1...2.1.5

2.1.1

Choose a tag to compare

@3m1n3nc3 3m1n3nc3 released this 03 Mar 04:56

Added

  • Added route parameter to Router.bindRequestToInstance for improved route context handling.
  • Added route property to ClearRequest for enhanced route context access.

Full Changelog: 2.1.0...2.1.1

2.1.0

Choose a tag to compare

@3m1n3nc3 3m1n3nc3 released this 03 Mar 04:34

Added

  • Added new core abstractions src/Controller.ts and src/Route.ts for shared request-state and route metadata handling across Express and H3 routers.
  • Added ClearRequest as a first-class request wrapper in route/controller binding flow, with per-request hydration of body, query, and params.
  • Added callback route handler context binding so this points to the current route instance during execution (Express and H3).
  • Added controller instance context binding so this.ctx and this.clearRequest are populated before controller method execution.
  • Added route instance request hydration for callback handlers with ctx, body, query, params, and clearRequest on this.
  • Added shared request-to-instance binding flow for both controller instances and callback route instances.
  • Added normalized handler invocation contract where route handlers receive ctx as first argument and req (ClearRequest) as second argument.
  • Added TypeScript tests validating callback handler this binding for both Express and H3.
  • Added TypeScript tests validating controller instance hydration and handler argument behavior.
  • Added TypeScript tests validating callback route this hydration (ctx/body/query/params/clearRequest) in Express and H3.

Changed

  • Updated import statements to use single quotes consistently.
  • Removed unnecessary semicolons and adjusted line endings for consistency.
  • Refactored router classes in both Express and H3 to improve readability.
  • Enhanced error handling and logging in route definitions.
  • Updated tests to align with new formatting and ensure consistency.
  • Added ESLint configuration for improved code quality and style enforcement.
  • Changed internal route storage from plain object/array-style entries to Route class instances.
  • Updated router application pipeline to bind request data through a shared instance-binding step for controller and callback handlers.
  • Updated API documentation to explicitly describe callback handler this binding and hydrated route instance fields.
  • Updated README, Express, H3, and testing docs with handler argument and clearRequest behavior details.

Full Changelog: https://github.com/arcstack-hq/clear-router/commits/2.1.0