angel3_route 10.2.0
angel3_route: ^10.2.0 copied to clipboard
A powerful, isomorphic routing library for Dart. It is mainly used in the Angel3 framework, but can be used in Flutter and on the Web.
Change Log #
10.2.0 #
New in 10.2.0 #
- Caching:
LruMap, aMapof at mostmaxSizeentries that evicts the least recently used one, in constant time. Reading an entry with[]or setting it makes it the most recently used, and its keys are listed least recently used first
Fixes in 10.2.0 #
- Matching: A route is matched with a single
RegExp, compiled once, instead of its parser, so a path that is not in the router's cache, such as one with a new parameter value, resolves 2 to 6 times faster. It matches exactly as the parser does: each segment takes the first match of its pattern, without backtracking into an earlier one. A route whose inline pattern has a backreference or a named group, or whose wildcard has a group, escape or|beside it, is still matched with its parser - Caching: The cache of
enableCacheis anLruMap. Evicting from it took time that grew with the paths evicted before (about 1.9 µs a resolution, once it was full of distinct paths), and now takes constant time; a cached path is also found faster, as it is no longer removed and added again - Paths:
stripStraySlashesno longer throws aRangeErroron an empty string, and is about 40 times faster (40 ns, against 1.6 µs for theRegExpit replaces, on a path such as/user/42).stripStrayandstripRegexStraySlashesstrip a needle of more than one character, such as\/, which they did not
10.1.0 #
New in 10.1.0 #
- Links:
Router.linksgives the links to the routers mounted, grouped or chained in a router, with their paths, routers and middleware, as they were added, whereroutesjoins their routes andmountedhas no router ofchain
Fixes in 10.1.0 #
- Names: A route keeps its
namein the routes of a group or a mounted router, and offlatten, sonavigatefinds a named route of a group, where the name was dropped - Performance: A route is matched against a path only if the path starts with the constant segments that begin the route, as
users/of/users/:id, so resolving a path no longer parses every route. With 122 routes, resolving/takes 13 µs where it took 2.3 ms, which an app pays on every request outside production, where resolutions are not cached
10.0.1 #
Fixes in 10.0.1 #
- Performance:
Router.routeskeeps the routes of mounted routers, such as those of agroup, until a route is added to the router or to one mounted in it, where it made new ones, so their path parsers were compiled again, on every resolution. Resolving a request in a router of route groups is about 20 times faster outside production mode, as fast as with the same routes added without a group. The list it returns is unmodifiable
10.0.0 #
New in 10.0.0 #
SymlinkRoute.middleware,enableCache(maxSize: ...)andRouter.cacheLength
Fixes in 10.0.0 #
- Security: Middleware of a mounted router (e.g.
group(path, ..., middleware: [...])) runs; route groups guarded by middleware (e.g. authentication) were served without it - Middleware: Middleware of
chain(...)applies to a router mounted on the chain at that mount only, without changing the router - Parameters: A parameter with a RegExp or with text around it (
:id([0-9]+),file-:id) has the matched text. An optional last parameter (/x/:id?) can be left out. Inline RegExps may contain groups, and text around a parameter is matched literally - Bad input: A parameter that cannot be read (malformed percent-encoding, a non-number for an
int) makes the route not match, instead of throwing - Cache: The resolve cache holds at most
maxSizeresults (default 1024), and its key includes the relative path, so results of other paths are not returned - Docs: The README tells how to install and use the package
9.1.0 #
- Require Dart >= 3.13
9.0.0 #
- Require Dart >= 3.12
8.5.0 #
- Require Dart >= 3.8
- Updated
lintsto 6.0.0 - Updated dependencies to the latest release
8.4.0 #
- Remoeved deprecated
dart:html - Refactored the code to use
package:web
8.3.0 #
- Require Dart >= 3.6
- Updated
lintsto 5.0.0 - Updated dependencies to the latest release
8.2.0 #
- Require Dart >= 3.3
- Updated
lintsto 4.0.0
8.1.1 #
- Updated repository link
8.1.0 #
- Updated
lintsto 3.0.0 - Fixed analyser warnings
8.0.0 #
- Require Dart >= 3.0
- Updated
build_web_compilersto 4.0.0 - Updated
httpto 1.0.0
7.0.0 #
- Require Dart >= 2.17
6.0.0 #
- Updated to 2.16.x
5.2.0 #
- Updated
package:build_runner - Updated
package:build_web_compiler
5.1.0 #
- Updated to use
package:belatuk_combinator - Updated linter to
package:lints
5.0.1 #
- Updated README
5.0.0 #
- Migrated to support Dart >= 2.12 NNBD
4.0.0 #
- Migrated to work with Dart >= 2.12 Non NNBD
3.1.0+1 #
- Accidentally hit
CTRL-Cwhile uploading3.1.0; this version ensures everything is ok.
3.1.0 #
- Add
Router.groupAsync
3.0.6 #
- Remove static default values for
middleware.
3.0.5 #
- Add
MiddlewarePipelineIterator.
3.0.4 #
- Add
RouteResultclass, which allows segments (i.e. wildcard) to modify thetail. - Add more wildcard tests.
3.0.3 #
- Support trailing text after parameters with custom Regexes.
3.0.2 #
- Support leading and trailing text for both
:parametersand*
3.0.1 #
- Make the callback in
Router.groupgenerically-typed.
3.0.0 #
- Make
RouterandRoutesingle-parameter generic. - Remove
package:browserdependency. BrowserRouter.onnow only accepts aString.MiddlewarePipeline.routingResultsnow accepts anIterable<RoutingResult>, instead of just aList.- Removed deprecated
Route.as, as well asRouter.registerMiddleware. - Completely removed
Route.requestMiddleware.
2.0.7 #
- Minor strong mode updates to work with stricter Dart 2.
2.0.5 #
- Patch to work with
combinator@1.0.0.