Releases: arkstack-hq/clear-router
Releases · arkstack-hq/clear-router
Release list
2.1.9
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
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
Changed
- Refactored
allRoutes()to return raw route objects instead of mapped info for better flexibility in route inspection and tooling.
Added
- Added
controllerName,middlewareCount,handlerTypeandactionNameproperties toRouteclass for improved route context handling.
Full Changelog: 2.1.5...2.1.6
2.1.5
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
Added
- Added
routeparameter toRouter.bindRequestToInstancefor improved route context handling. - Added
routeproperty toClearRequestfor enhanced route context access.
Full Changelog: 2.1.0...2.1.1
2.1.0
Added
- Added new core abstractions
src/Controller.tsandsrc/Route.tsfor shared request-state and route metadata handling across Express and H3 routers. - Added
ClearRequestas a first-class request wrapper in route/controller binding flow, with per-request hydration ofbody,query, andparams. - Added callback route handler context binding so
thispoints to the current route instance during execution (Express and H3). - Added controller instance context binding so
this.ctxandthis.clearRequestare populated before controller method execution. - Added route instance request hydration for callback handlers with
ctx,body,query,params, andclearRequestonthis. - Added shared request-to-instance binding flow for both controller instances and callback route instances.
- Added normalized handler invocation contract where route handlers receive
ctxas first argument andreq(ClearRequest) as second argument. - Added TypeScript tests validating callback handler
thisbinding for both Express and H3. - Added TypeScript tests validating controller instance hydration and handler argument behavior.
- Added TypeScript tests validating callback route
thishydration (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
Routeclass 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
thisbinding and hydrated route instance fields. - Updated README, Express, H3, and testing docs with handler argument and
clearRequestbehavior details.
Full Changelog: https://github.com/arcstack-hq/clear-router/commits/2.1.0