Skip to content

Release 1.0.0-rc.7

Pre-release
Pre-release
Compare
Choose a tag to compare
@Ghnuberath Ghnuberath released this 06 Dec 16:27
· 37 commits to master since this release
101aed6

This release contains a brand new, Ravel-specific router implementation to replace @koa/router. This replacement addresses the inherent unpredictability of @koa/router as applied in Ravel, where route declaration order is not clear to developers due to Ravel's dependency injection-focused approach. Routes are now ordered according to a more predictable system of priority.

This new router also addresses a serious, long-standing bug in @koa/router. Now, only one route will be executed for a given request, chosen based on the above priority system.

A minor API-breaking change was required to support the new router:

// Previously, @mapping could be used to create a route that automatically responds with a status code
@mapping(Routes.GET, '/foo', 500)
// now, that is configured using a config object
@mapping(Routes.GET, '/foo', { status: 500 })  // necessary to support additional config parameters