Phasing out Extensible
This commit is contained in:
parent
092cda9fec
commit
c613ca4108
5 changed files with 11 additions and 8 deletions
|
@ -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.
|
||||
|
|
|
@ -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<RoutingResult> _onResolve =
|
||||
new StreamController<RoutingResult>();
|
||||
|
@ -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'] ?? {}));
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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<Pattern, Router> _mounted = {};
|
||||
|
|
|
@ -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 <thosakwe@gmail.com>
|
||||
homepage: https://github.com/angel-dart/angel_route
|
||||
dev_dependencies:
|
||||
|
|
Loading…
Reference in a new issue