Remove usage of removed symbols

This commit is contained in:
Tobe O 2018-08-20 16:00:18 -04:00
parent 3e62d1d31f
commit b9127251a6
3 changed files with 98 additions and 72 deletions

View file

@ -3,8 +3,8 @@
<component name="ChangeListManager">
<list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/http/http_request_context.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/http/http_request_context.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/routable.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/routable.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/server.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/server.dart" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
@ -27,11 +27,11 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="server.dart" pinned="false" current-in-tab="true">
<file leaf-file-name="server.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="262">
<caret line="82" column="47" lean-forward="true" selection-start-line="82" selection-start-column="47" selection-end-line="82" selection-end-column="47" />
<state relative-caret-position="-1384">
<caret line="189" column="31" lean-forward="true" selection-start-line="189" selection-start-column="31" selection-end-line="189" selection-end-column="31" />
<folding>
<element signature="e#38#58#0" expanded="true" />
</folding>
@ -39,11 +39,41 @@
</provider>
</entry>
</file>
<file leaf-file-name="routing_test.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="312">
<caret line="129" column="40" lean-forward="true" selection-start-line="129" selection-start-column="40" selection-end-line="129" selection-end-column="40" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="container.dart" pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_container-1.0.0-alpha.1/lib/src/container.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="406">
<caret line="96" column="33" lean-forward="true" selection-start-line="96" selection-start-column="33" selection-end-line="96" selection-end-column="33" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="routable.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/routable.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-7">
<caret line="9" column="30" selection-start-line="9" selection-start-column="30" selection-end-line="9" selection-end-column="30" />
<state relative-caret-position="108">
<caret line="52" column="26" selection-start-line="52" selection-start-column="26" selection-end-line="52" selection-end-column="26" />
<folding>
<element signature="e#40#60#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="primitives_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/primitives_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="178">
<caret line="19" column="19" lean-forward="true" selection-start-line="19" selection-start-column="19" selection-end-line="19" selection-end-column="19" />
</state>
</provider>
</entry>
@ -72,7 +102,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>result as Map&lt;String, dynamic&gt;</find>
<find>random_strin</find>
<find>Angel()</find>
<find>change</find>
@ -102,6 +131,7 @@
<find>originalBuffer</find>
<find>lazyQue</find>
<find>injections</find>
<find>singleton(</find>
</findStrings>
<replaceStrings>
<replace>useStream</replace>
@ -201,13 +231,13 @@
<option value="$PROJECT_DIR$/example/main.dart" />
<option value="$PROJECT_DIR$/test/routing_test.dart" />
<option value="$PROJECT_DIR$/lib/src/core/metadata.dart" />
<option value="$PROJECT_DIR$/lib/src/core/server.dart" />
<option value="$PROJECT_DIR$/lib/src/http/angel_http.dart" />
<option value="$PROJECT_DIR$/lib/src/core/routable.dart" />
<option value="$PROJECT_DIR$/lib/src/core/request_context.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/src/http/http_request_context.dart" />
<option value="$PROJECT_DIR$/lib/src/core/server.dart" />
<option value="$PROJECT_DIR$/lib/src/core/routable.dart" />
</list>
</option>
</component>
@ -627,14 +657,7 @@
<workItem from="1534009494986" duration="594000" />
<workItem from="1534546784803" duration="353000" />
<workItem from="1534547885788" duration="9908000" />
<workItem from="1534793956753" duration="977000" />
</task>
<task id="LOCAL-00096" summary="More &lt;String, String&gt; patches in tests">
<created>1531148090824</created>
<option name="number" value="00096" />
<option name="presentableId" value="LOCAL-00096" />
<option name="project" value="LOCAL" />
<updated>1531148090824</updated>
<workItem from="1534793956753" duration="1252000" />
</task>
<task id="LOCAL-00097" summary="Skip parameter meta tests on newer VM's where it's blocked on: https://github.com/dart-lang/sdk/issues/33774">
<created>1531148520815</created>
@ -972,7 +995,14 @@
<option name="project" value="LOCAL" />
<updated>1534794764995</updated>
</task>
<option name="localTasksCounter" value="145" />
<task id="LOCAL-00145" summary="Implement HttpReqCtx.container">
<created>1534794944288</created>
<option name="number" value="00145" />
<option name="presentableId" value="LOCAL-00145" />
<option name="project" value="LOCAL" />
<updated>1534794944288</updated>
</task>
<option name="localTasksCounter" value="146" />
<servers />
</component>
<component name="TestHistory">
@ -1008,7 +1038,7 @@
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="173184000" />
<option name="totallyTimeSpent" value="173459000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -1046,7 +1076,7 @@
<window_info anchor="bottom" id="Version Control" order="7" weight="0.32905984" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.4964476" weight="0.3973799" />
<window_info anchor="bottom" id="Terminal" order="7" weight="0.44978166" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.27846155" />
<window_info content_ui="combo" id="Project" order="0" weight="0.27846155" />
<window_info anchor="right" id="SciView" order="4" />
<window_info anchor="right" id="Theme Preview" order="3" />
<window_info id="Favorites" order="3" side_tool="true" />
@ -1071,7 +1101,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value="Make reflector a named parameter" />
<MESSAGE value="Force dep on Dart &gt;=2.0.0-dev" />
<MESSAGE value="CHANGELOG now only reflects on 2.0.0-alpha+" />
<MESSAGE value="Remove Jael example" />
@ -1096,7 +1125,8 @@
<MESSAGE value="Remove dep on package:pool" />
<MESSAGE value="waterfall now only accepts RequestHandler" />
<MESSAGE value="Remove req.inject" />
<option name="LAST_COMMIT_MESSAGE" value="Remove req.inject" />
<MESSAGE value="Implement HttpReqCtx.container" />
<option name="LAST_COMMIT_MESSAGE" value="Implement HttpReqCtx.container" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -1104,13 +1134,6 @@
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/lib/src/core/map_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="400">
<caret line="93" column="28" selection-start-line="93" selection-start-column="28" selection-end-line="93" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/precontained_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="81">
@ -1274,9 +1297,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/primitives_test.dart">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="608">
@ -1390,13 +1410,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/routable.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-7">
<caret line="9" column="30" selection-start-line="9" selection-start-column="30" selection-end-line="9" selection-end-column="30" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69">
@ -1404,13 +1417,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="352">
<caret line="30" column="17" selection-start-line="30" selection-start-column="17" selection-end-line="30" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
@ -1431,16 +1437,47 @@
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_container-1.0.0-alpha.1/lib/src/container.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="406">
<caret line="96" column="33" lean-forward="true" selection-start-line="96" selection-start-column="33" selection-end-line="96" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="262">
<caret line="82" column="47" lean-forward="true" selection-start-line="82" selection-start-column="47" selection-end-line="82" selection-end-column="47" />
<state relative-caret-position="-1384">
<caret line="189" column="31" lean-forward="true" selection-start-line="189" selection-start-column="31" selection-end-line="189" selection-end-column="31" />
<folding>
<element signature="e#38#58#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/routable.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="52" column="26" selection-start-line="52" selection-start-column="26" selection-end-line="52" selection-end-column="26" />
<folding>
<element signature="e#40#60#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/primitives_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="178">
<caret line="19" column="19" lean-forward="true" selection-start-line="19" selection-start-column="19" selection-end-line="19" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="312">
<caret line="129" column="40" lean-forward="true" selection-start-line="129" selection-start-column="40" selection-end-line="129" selection-end-column="40" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

View file

@ -51,15 +51,9 @@ class Routable extends Router {
void close() {
_services.clear();
configuration.clear();
requestMiddleware.clear();
_onService.close();
}
/// Additional filters to be run on designated requests.
@override
final Map<String, RequestHandler> requestMiddleware =
<String, RequestHandler>{};
/// A set of [Service] objects that have been mapped into routes.
Map<Pattern, Service> get services => _services;
@ -77,8 +71,8 @@ class Routable extends Router {
_services[path.toString().replaceAll(_straySlashes, '')];
@override
Route addRoute(String method, Pattern path, Object handler,
{List middleware: const []}) {
Route addRoute(String method, String path, Object handler,
{Iterable middleware: const []}) {
final List handlers = [];
// Merge @Middleware declaration, if any
Middleware middlewareDeclaration = getAnnotation(handler, Middleware);
@ -131,18 +125,12 @@ class Routable extends Router {
// Let's copy middleware, heeding the optional middleware namespace.
String middlewarePrefix = namespace != null ? "$namespace." : "";
Map copiedMiddleware = new Map.from(router.requestMiddleware);
for (String middlewareName in copiedMiddleware.keys) {
requestMiddleware.putIfAbsent("$middlewarePrefix$middlewareName",
() => copiedMiddleware[middlewareName] as RequestHandler);
}
// Also copy properties...
if (router is Routable) {
Map copiedProperties = new Map.from(router.configuration);
for (String propertyName in copiedProperties.keys) {
configuration.putIfAbsent("$middlewarePrefix$propertyName",
() => copiedMiddleware[propertyName]);
() => copiedProperties[propertyName]);
}
}

View file

@ -175,24 +175,25 @@ class Angel extends Routable {
}
@override
mount(Pattern path, Router router, {bool hooked: true, String namespace}) {
mount(Pattern path, Router router) {
if (_flattened != null) {
logger?.warning(
'WARNING: You added mounted a child router ($path) on the router, after it had been optimized.');
logger?.warning(
'This route will be ignored, and no requests will ever reach it.');
}
return super.mount(path.toString(), router,
hooked: hooked != false, namespace: namespace);
return super.mount(path.toString(), router);
}
/// Loads some base dependencies into the service container.
void bootstrapContainer() {
if (runtimeType != Angel) container.singleton(this, as: Angel);
container.singleton(this, as: Angel);
container.singleton(this, as: Routable);
container.singleton(this, as: Router);
container.singleton(this);
if (runtimeType != Angel) {
container.registerSingleton(this);
}
container.registerSingleton<Angel>(this);
container.registerSingleton<Routable>(this);
container.registerSingleton<Router>(this);
}
/// Shuts down the server, and closes any open [StreamController]s.