diff --git a/.idea/runConfigurations/All_Tests.xml b/.idea/runConfigurations/All_Tests.xml
index ac11209e..482db2f9 100644
--- a/.idea/runConfigurations/All_Tests.xml
+++ b/.idea/runConfigurations/All_Tests.xml
@@ -2,6 +2,7 @@
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/parse_in_parse_test_dart.xml b/.idea/runConfigurations/parse_in_parse_test_dart.xml
new file mode 100644
index 00000000..f37be7fe
--- /dev/null
+++ b/.idea/runConfigurations/parse_in_parse_test_dart.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 932dd204..5f30bc69 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
-# 3.0.0-alpha
+# 3.0.0
* Make `Router` and `Route` single-parameter generic.
-* Remove `package:browser` dependency.
\ No newline at end of file
+* Remove `package:browser` dependency.
+* `BrowserRouter.on` now only accepts a `String`.
+* `MiddlewarePipeline.routingResults` now accepts
+an `Iterable`, instead of just a `List`.
+* Removed deprecated `Route.as`, as well as `Router.registerMiddleware`.
+* Completely removed `Route.requestMiddleware`.
\ No newline at end of file
diff --git a/lib/browser.dart b/lib/browser.dart
index e6cffb80..97ac1d34 100644
--- a/lib/browser.dart
+++ b/lib/browser.dart
@@ -39,7 +39,7 @@ abstract class BrowserRouter extends Router {
void listen();
/// Identical to [all].
- Route on(Pattern path, handler, {List middleware});
+ Route on(String path, handler, {List middleware});
}
abstract class _BrowserRouterImpl extends Router implements BrowserRouter {
@@ -64,7 +64,7 @@ abstract class _BrowserRouterImpl extends Router implements BrowserRouter {
@override
void go(Iterable linkParams) => _goTo(navigate(linkParams));
- Route on(Pattern path, handler, {List middleware}) =>
+ Route on(String path, handler, {List middleware}) =>
all(path, handler, middleware: middleware);
void prepareAnchors() {
@@ -176,7 +176,7 @@ class _PushStateRouter extends _BrowserRouterImpl {
void handleState(state) {
if (state is Map && state.containsKey('path')) {
- var path = state['path'];
+ var path = state['path'].toString();
final resolved = resolveAbsolute(path).first;
if (resolved != null && resolved.route != _current) {
diff --git a/lib/src/grammar.dart b/lib/src/grammar.dart
index 870264a4..bc038768 100644
--- a/lib/src/grammar.dart
+++ b/lib/src/grammar.dart
@@ -2,13 +2,13 @@ part of angel_route.src.router;
class RouteGrammar {
static final Parser notSlash =
- match(new RegExp(r'[^/]+')).value((r) => r.span.text);
+ match(new RegExp(r'[^/]+')).value((r) => r.span.text);
static final Parser regExp = match(new RegExp(r'\((.+)\)'))
.value((r) => new RegExp(r.scanner.lastMatch[1]));
static final Parser parameterName =
- match(new RegExp(r':([A-Za-z0-9_]+)'))
+ match(new RegExp(r':([A-Za-z0-9_]+)'))
.value((r) => r.span.text.substring(1));
static final Parser parameterSegment = chain([
@@ -16,7 +16,7 @@ class RouteGrammar {
match('?').value((r) => true).opt(),
regExp.opt(),
]).map((r) {
- var s = new ParameterSegment(r.value[0], r.value[2]);
+ var s = new ParameterSegment(r.value[0] as String, r.value[2] as RegExp);
return r.value[1] == true ? new OptionalSegment(s) : s;
});
@@ -26,16 +26,17 @@ class RouteGrammar {
.map((r) => r.span.text),
parameterSegment,
]).map((r) {
- return new ParsedParameterSegment(r.value[0], r.value[1]);
+ return new ParsedParameterSegment(
+ r.value[0] as String, r.value[1] as ParameterSegment);
});
static final Parser wildcardSegment =
- match('*').value((r) => new WildcardSegment());
+ match('*').value((r) => new WildcardSegment());
static final Parser constantSegment =
- notSlash.map((r) => new ConstantSegment(r.value));
+ notSlash.map((r) => new ConstantSegment(r.value));
- static final Parser routeSegment = any([
+ static final Parser routeSegment = any([
parsedParameterSegment,
parameterSegment,
wildcardSegment,
@@ -62,7 +63,8 @@ class RouteDefinition {
if (out == null)
out = s.compile(isLast);
else
- out = s.compileNext(out.then(match('/')).index(0), isLast);
+ out = s.compileNext(
+ out.then(match('/')).index(0).cast