diff --git a/README.md b/README.md index 677b71e1..3b036165 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # angel_route -![version 1.0.4](https://img.shields.io/badge/version-1.0.4-brightgreen.svg) +[![Pub](https://img.shields.io/pub/v/angel_route.svg)](https://pub.dartlang.org/packages/angel_route) ![build status](https://travis-ci.org/angel-dart/route.svg) A powerful, isomorphic routing library for Dart. diff --git a/lib/browser.dart b/lib/browser.dart index c864492b..0bcdbc70 100644 --- a/lib/browser.dart +++ b/lib/browser.dart @@ -39,11 +39,10 @@ abstract class BrowserRouter extends Router { void listen(); /// Identical to [all]. - Route on(Pattern path, handler, {List middleware}) => - all(path, handler, middleware: middleware); + Route on(Pattern path, handler, {List middleware}); } -class _BrowserRouterImpl extends Router implements BrowserRouter { +abstract class _BrowserRouterImpl extends Router implements BrowserRouter { Route _current; StreamController _onResolve = new StreamController(); @@ -64,6 +63,9 @@ class _BrowserRouterImpl extends Router implements BrowserRouter { @override void go(Iterable linkParams) => _goTo(navigate(linkParams)); + Route on(Pattern path, handler, {List middleware}) => + all(path, handler, middleware: middleware); + void prepareAnchors() { final anchors = window.document.querySelectorAll('a:not([dynamic])'); @@ -153,7 +155,7 @@ class _PushStateRouter extends _BrowserRouterImpl { } else { final route = resolved.route; window.history.pushState( - {'path': route.path, 'params': {}, 'properties': properties}, + {'path': route.path, 'params': {}}, route.name ?? route.path, relativeUri); _onResolve.add(resolved); @@ -167,7 +169,7 @@ class _PushStateRouter extends _BrowserRouterImpl { final resolved = resolveAbsolute(path); if (resolved != null && resolved.route != _current) { - properties.addAll(state['properties'] ?? {}); + //properties.addAll(state['properties'] ?? {}); _onResolve.add(resolved); _onRoute.add(_current = resolved.route ..state.properties.addAll(state['params'] ?? {})); diff --git a/lib/src/extensible.dart b/lib/src/extensible.dart index ebfb89bb..0dc91622 100644 --- a/lib/src/extensible.dart +++ b/lib/src/extensible.dart @@ -5,6 +5,7 @@ final RegExp _sym = new RegExp(r'Symbol\("([^"]+)"\)'); /// /// No longer requires reflection. :) @proxy +@deprecated class Extensible { /// A set of custom properties that can be assigned to the server. /// diff --git a/lib/src/router.dart b/lib/src/router.dart index 50707752..78015dbf 100644 --- a/lib/src/router.dart +++ b/lib/src/router.dart @@ -15,7 +15,7 @@ final RegExp _slashDollar = new RegExp(r'/+\$'); final RegExp _straySlashes = new RegExp(r'(^/+)|(/+$)'); /// An abstraction over complex [Route] trees. Use this instead of the raw API. :) -class Router extends Extensible { +class Router { final List<_ChainedRouter> _chained = []; final List _middleware = []; final Map _mounted = {}; diff --git a/pubspec.yaml b/pubspec.yaml index fb27ca5b..10221f9c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: angel_route description: A powerful, isomorphic routing library for Dart. -version: 1.0.4 +version: 1.0.5 author: Tobe O homepage: https://github.com/angel-dart/angel_route dev_dependencies: