From e23fd2369f8dedd6bce74ee43a59cb87be87ce02 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 25 Jul 2019 22:45:47 -0400 Subject: [PATCH 1/6] 2.0.4+1 (configureRoutes) --- .CHANGELOG.md.swp | Bin 0 -> 24576 bytes .pubspec.yaml.swp | Bin 0 -> 12288 bytes CHANGELOG.md | 4 ++++ lib/src/core/controller.dart | 10 +++++----- pubspec.yaml | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .CHANGELOG.md.swp create mode 100644 .pubspec.yaml.swp diff --git a/.CHANGELOG.md.swp b/.CHANGELOG.md.swp new file mode 100644 index 0000000000000000000000000000000000000000..f26c773c3a2fee123520e2799fb7fa19c4a0abd9 GIT binary patch literal 24576 zcmeI4eXL|>UB{h>J9EzS@_T!JZ_n1ZzjblR?5XXj@b9WhW#?u4ZvWI(*S{p&eMzNg zrFnQ^&B|9V_U~+3w|R9bY#d6{3)O`ESj3jF`0K+(OlayQFlPVkK@DwR)w_ki2MYrz*@QK|e6_-*h(a6h;YtbrQ18oUO)3_S9~mCA2| z4}$lA8mIyTzIl12@+t6s@ILS$I0H_Dqu>hg`O7Mm&w)q5onSxM2ddz?mscv!f~Ubp z!NcG~;2?M-*bct?vP$Kv;FF*Wt^v=G^mqu|3YNeD@MGZbAmUfSXTdLl2f!-09(;yG z$m8JS;6ZQ-Yyq3W>%dbaV!jTZ0Pg^|fy=>V;NM8fJPH2PCug>rbKR9JjI0TIy*LU? zWV^N#*-oQhtBicvDvIv>__x=Y`P%l{_G*}PTVZX-o{Byng#}~fMP|eHu{g1TDN>W$ z!ZgxOVLOFMY-gotZ8KpfGGUUZ^1XC!n6zVp<3|^c1SYe0^lV<_vVw&uGQnw^chgR8 z56c+qMa_?OLWc_Ev7j4fxjmFd{lGL@ws9dh%``KeUXl!EF8W>T<}F%Tx|W;J1iQ9x z4@}%NowQ@kT9})ac-3}lm5I&mmCY@7&f7*|iWVDOilZp8Yhh+j#a)}k9X1+w*v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s_;iF_26(NAIU~XRfcp=7x71x!&JRtp?FnYdZfG4-J;iC0k zZ%?|`F7{QHSG6ZsG{W_Pmpfv?Q}%p#eT0p=+Mo%}K^t$d+%=6Q+P9px4Q<7Q81K+i zW7zQRZUK_g?RDf*C-VOd5+|(26 z8}vplozmwaIy6zTF2_HNMU>emzIUo7JrVSGihlcGpd=3-zux5>Z8~uWwpcfL*!46) z+5^MrRPnRNKbJt(=iAa^GwrBg3jsnHlZl-%HH9Y(lOFn0k^6h*A{gdPZWlqFvtH*&LrNsx zfP!~G;sJPr6m+ymP#{WZsF?NH;lfEMEodzL^3Cqd?98{7bu;uI-`}KbUXQ@DKuG^g zuyeF$0lPNRP zkkE*|@?`Cq%v>JdyXo~IPbMsz4iY97Va8lXO}81dJQ1b}s(Pd})p0CU9MJa0E#K?) zygps8+}n`S0a=EvNrGl2EQEnx>Z2V+=NIP8zy_=W%nIkOthlV!CfC_eDrU9wX)59g zGc}K9iMd(u(CE^-?wVwi)eO+3Q{j`<>Ui;-i`+`BX12LjmPu9B<_=kbt37$GMKr1a zOzssfo~~Etwuw;t(rA?lWdoAvOyn$vvfPP9(Cx<3CgsqB*1ArWSn$zJr+hp^xpRN7M(z+V>po>*MC5z tdM3DQ`#N>V;3_Fo5zR`T&`cZQ5xA>` that are now `Stream`. diff --git a/lib/src/core/controller.dart b/lib/src/core/controller.dart index 6befde29..b9dd28dc 100644 --- a/lib/src/core/controller.dart +++ b/lib/src/core/controller.dart @@ -27,7 +27,7 @@ class Controller { /// Applies routes, DI, and other configuration to an [app]. @mustCallSuper - FutureOr configureServer(Angel app) { + Future configureServer(Angel app) async { _app = app; if (injectSingleton != false) { @@ -36,13 +36,13 @@ class Controller { } } - var name = applyRoutes(app, app.container.reflector); + var name = await applyRoutes(app, app.container.reflector); app.controllers[name] = this; return null; } /// Applies the routes from this [Controller] to some [router]. - String applyRoutes(Router router, Reflector reflector) { + Future applyRoutes(Router router, Reflector reflector) async { // Load global expose decl var classMirror = reflector.reflectClass(this.runtimeType); Expose exposeDecl = findExpose(reflector); @@ -62,8 +62,8 @@ class Controller { ..addAll(middleware); final routeBuilder = _routeBuilder(reflector, instanceMirror, routable, handlers); + await configureRoutes(routable); classMirror.declarations.forEach(routeBuilder); - configureRoutes(routable); // Return the name. return exposeDecl.as?.isNotEmpty == true ? exposeDecl.as : typeMirror.name; @@ -125,7 +125,7 @@ class Controller { } /// Used to add additional routes to the router from within a [Controller]. - void configureRoutes(Routable routable) {} + FutureOr configureRoutes(Routable routable) {} /// Finds the [Expose] declaration for this class. Expose findExpose(Reflector reflector) => reflector diff --git a/pubspec.yaml b/pubspec.yaml index 6d36a858..b8a159cc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 2.0.4 +version: 2.0.4+1 description: A high-powered HTTP server with dependency injection, routing and much more. author: Tobe O homepage: https://github.com/angel-dart/angel_framework From 5e9ddf2aadafdd98347c4f378709289a0ecb109f Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 25 Jul 2019 22:46:04 -0400 Subject: [PATCH 2/6] Rm swp --- .CHANGELOG.md.swp | Bin 24576 -> 0 bytes .pubspec.yaml.swp | Bin 12288 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .CHANGELOG.md.swp delete mode 100644 .pubspec.yaml.swp diff --git a/.CHANGELOG.md.swp b/.CHANGELOG.md.swp deleted file mode 100644 index f26c773c3a2fee123520e2799fb7fa19c4a0abd9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24576 zcmeI4eXL|>UB{h>J9EzS@_T!JZ_n1ZzjblR?5XXj@b9WhW#?u4ZvWI(*S{p&eMzNg zrFnQ^&B|9V_U~+3w|R9bY#d6{3)O`ESj3jF`0K+(OlayQFlPVkK@DwR)w_ki2MYrz*@QK|e6_-*h(a6h;YtbrQ18oUO)3_S9~mCA2| z4}$lA8mIyTzIl12@+t6s@ILS$I0H_Dqu>hg`O7Mm&w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zJr+hp^xpRN7M(z+V>po>*MC5z tdM3DQ`#N>V;3_Fo5zR`T&`cZQ5xA Date: Sat, 27 Jul 2019 11:46:03 +0200 Subject: [PATCH 3/6] Edit Controller.configureRoutes doc --- lib/src/core/controller.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/core/controller.dart b/lib/src/core/controller.dart index b9dd28dc..36573f4c 100644 --- a/lib/src/core/controller.dart +++ b/lib/src/core/controller.dart @@ -124,7 +124,15 @@ class Controller { }; } - /// Used to add additional routes to the router from within a [Controller]. + /// Used to add additional routes or middlewares to the router from within + /// a [Controller]. + /// + /// ```dart + /// @override + /// FutureOr configureRoutes(Routable routable) { + /// routable.all('*', myMiddleware); + /// } + /// ``` FutureOr configureRoutes(Routable routable) {} /// Finds the [Expose] declaration for this class. From b58172ba60ee8ae26a220cf7c2399c2d2f5eb281 Mon Sep 17 00:00:00 2001 From: Axel LE BOT Date: Sat, 27 Jul 2019 12:07:57 +0200 Subject: [PATCH 4/6] Edit Expose doc --- lib/src/core/metadata.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/src/core/metadata.dart b/lib/src/core/metadata.dart index 877073ff..b0d245a2 100644 --- a/lib/src/core/metadata.dart +++ b/lib/src/core/metadata.dart @@ -21,7 +21,20 @@ class Hooks { const Hooks({this.before = const [], this.after = const []}); } -/// Exposes a [Controller] to the Internet. +/// Exposes a [Controller] or a [Controller] method to the Internet. +/// +/// ```dart +/// @Expose('/elements') +/// class ElementController extends Controller { +/// +/// @Expose('') +/// getList(){} +/// +/// @Expose('/:elementId') +/// getElement(int elementId){} +/// +/// } +/// ``` class Expose { final String method; final String path; From d88e289807139df1ed3c128e114d81d40db5670f Mon Sep 17 00:00:00 2001 From: Pat O'Connor Date: Sat, 28 Sep 2019 22:38:22 -0700 Subject: [PATCH 5/6] Bind the decoder to req.body --- test/controller_test.dart | 2 +- test/di_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/controller_test.dart b/test/controller_test.dart index d4b7938a..d8cdb05c 100644 --- a/test/controller_test.dart +++ b/test/controller_test.dart @@ -113,7 +113,7 @@ main() { }, optional: ['bar'])); var rq = MockHttpRequest('GET', Uri(path: 'foo')); await AngelHttp(app).handleRequest(rq); - var body = await rq.response.transform(utf8.decoder).join(); + var body = await utf8.decoder.bind(rq.response).join(); expect(json.decode(body), 2); }); diff --git a/test/di_test.dart b/test/di_test.dart index 8b23eb43..a0df1f36 100644 --- a/test/di_test.dart +++ b/test/di_test.dart @@ -28,7 +28,7 @@ main() { app.container.registerSingleton(Todo(text: TEXT, over: OVER)); app.container.registerFactory>((container) async { var req = container.make(); - var text = await req.body.transform(utf8.decoder).join(); + var text = await utf8.decoder.bind(req.body).join(); return Foo(text); }); From 5312741c73a3a96c4062d35e437559f6d70f8dcc Mon Sep 17 00:00:00 2001 From: Neel Kamath Date: Sun, 6 Oct 2019 09:06:01 +0530 Subject: [PATCH 6/6] Update `serialize()` docs for Angel v2 --- lib/src/core/response_context.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/core/response_context.dart b/lib/src/core/response_context.dart index e7478ba8..2110dc0e 100644 --- a/lib/src/core/response_context.dart +++ b/lib/src/core/response_context.dart @@ -61,7 +61,7 @@ abstract class ResponseContext /// Serializes response data into a String. /// - /// The default is conversion into JSON via `package:json_god`. + /// The default is conversion into JSON via `json.encode`. /// /// If you are 100% sure that your response handlers will only /// be JSON-encodable objects (i.e. primitives, `List`s and `Map`s),