shelf_router 1.1.0
shelf_router: ^1.1.0 copied to clipboard
A convinent request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations.
1.1.0 #
paramsis deprecated in favor ofRequest.paramsadding using an extension onRequest.- The default
notFoundHandlernow returns a sentinelrouteNotFoundresponse object which causes 404 with the message 'Route not found'. - Minor breaking: Handlers and sub-routers that return the sentinel
routeNotFoundresponse object will be ignored and pattern matching will continue on additional routes/handlers.
Changing the router to continue pattern matching additional routes if a matched
handler or nested router returns the sentinel routeNotFound response
object is technically a breaking change. However, it only affects scenarios
where the request matches a mounted sub-router, but does not match any route
on this sub-router. In this case, shelf_router version 1.0.0 would
immediately respond 404, without attempting to match further routes. With this
release, the behavior changes to matching additional routes until one returns
a custom 404 response object, or all routes have been matched.
This behavior is more in line with how shelf_router version 0.7.x worked,
and since many affected users consider the behavior from 1.0.0 a defect,
we decided to remedy the situation.
1.0.0 #
- Migrate package to null-safety
- Since handlers are not allowed to return
nullinshelf1.0.0, a router will return a default 404 response instead. This behavior can be overridden with thenotFoundHandlerconstructor parameter. - Breaking: Remove deprecated
Router.handlergetter. The router itself is a handler.
0.7.4 #
- Update
Router.mountparameter to accept aHandler. - Make
Routerto be considered aHandler. - Deprecate the
Router.handlergetter.
0.7.3 #
- Added
@sealedannotation toRouterandRoute.
0.7.2 #
- Always register a
HEADhandler whenever aGEThandler is registered. Defaulting to calling theGEThandler and throwing away the body.
0.7.1 #
- Use
Functioninstead ofdynamicinRouterEntryto improve typing.
0.7.0+1 #
- Fixed description to fit size recommendations.
0.7.0 #
- Initial release