00:26:51  * __ransom__quit (Ping timeout: 276 seconds)
01:01:47  * knksmith57quit (Ping timeout: 244 seconds)
01:22:01  * ceejquit (Remote host closed the connection)
01:23:08  * ceejjoined
01:35:41  * joshonthewebjoined
01:55:07  * brianGOjoined
01:58:39  <TheThing>varader-
01:58:41  <TheThing>oh he's gone
02:20:02  * ceejquit (*.net *.split)
02:20:02  * mezodquit (*.net *.split)
02:20:03  * shesekquit (*.net *.split)
02:20:04  * rmi7quit (*.net *.split)
02:20:04  * TheThingquit (*.net *.split)
02:20:05  * ollemanquit (*.net *.split)
02:20:05  * trollixxquit (*.net *.split)
02:20:05  * mekwallquit (*.net *.split)
02:20:05  * dobsonquit (*.net *.split)
02:20:05  * TBotV63quit (*.net *.split)
02:20:07  * felixjetquit (*.net *.split)
02:20:07  * kudosquit (*.net *.split)
02:20:07  * rickharrisonquit (*.net *.split)
02:20:07  * xintoxquit (*.net *.split)
02:20:07  * lennonquit (*.net *.split)
02:20:07  * AustinMathernequit (*.net *.split)
02:20:07  * brianGOquit (*.net *.split)
02:20:19  * joshonthewebquit (*.net *.split)
02:20:20  * Lulzonquit (*.net *.split)
02:20:20  * luxferresumquit (*.net *.split)
02:20:20  * McJesusquit (*.net *.split)
02:20:20  * frankdreyquit (*.net *.split)
02:25:42  * brianGOjoined
02:25:42  * joshonthewebjoined
02:25:42  * ceejjoined
02:25:42  * frankdreyjoined
02:25:42  * TheThingjoined
02:25:42  * mezodjoined
02:25:42  * shesekjoined
02:25:42  * McJesusjoined
02:25:42  * kudosjoined
02:25:42  * rickharrisonjoined
02:25:42  * ollemanjoined
02:25:42  * rmi7joined
02:25:42  * felixjetjoined
02:25:42  * AustinMathernejoined
02:25:42  * xintoxjoined
02:25:42  * trollixxjoined
02:25:42  * lennonjoined
02:25:42  * Lulzonjoined
02:25:42  * mekwalljoined
02:25:42  * dobsonjoined
02:25:42  * TBotV63joined
02:25:42  * luxferresumjoined
02:38:48  <TheThing>felixjet: I'm always here <3
02:38:52  <TheThing>highlight me if you need something
02:42:07  * joshonthewebquit (Quit: Computer has gone to sleep.)
03:04:31  * mezodquit (Remote host closed the connection)
03:13:47  <felixjet>TheThing, just wondering... i've seen a starter kit with express that uses cascading async/await middleware
03:13:53  <felixjet>so.. whats the point of koa anymore?
03:14:06  <TheThing>you mean the promise middleware?
03:14:19  <TheThing>uhh, promise router thingy?
03:15:17  <felixjet>you right, it's a router thing
03:15:26  <TheThing>yeah, completely different thing
03:15:41  <TheThing>it won't add native support for promise/await thing into middlewares
03:15:46  <TheThing>https://github.com/nfp-projects/isaland_mail/blob/master/server/middlewares.js#L3 <--- this won't be possible with it
03:16:07  <TheThing>the router thing is very handy though
03:16:09  <TheThing>like, EXTREMELY handy
03:16:20  <TheThing>it allows you to make routes that are async/await designed
03:16:25  <felixjet>indeed
03:16:26  <TheThing>and make it throw exceptions
03:16:33  <felixjet>better error handling
03:16:38  <TheThing>TONS better
03:16:39  <felixjet>which is the feature i like most in koa
03:16:41  <TheThing>using it for one project
03:16:53  <TheThing>but it doesn't add native await/async support into middleware
03:17:20  <felixjet>but... apart from routes, is async/await really needed for middleware?
03:17:22  <TheThing>you won't be able to do this with express: https://github.com/nfp-projects/isaland_mail/blob/master/server/middlewares.js#L32
03:18:32  <TheThing>plus it's essentially a wrapper really, the promise router thingy
03:18:39  <TheThing>so there's tons of overhead going on
03:19:18  <TheThing>I've never been fan of express really so I'm VERY biased
03:19:25  <TheThing>but yes, there is a point in koa
03:19:33  <TheThing>it's just so much lighter compared to express
03:20:44  <felixjet>i also never been a fan of express
03:20:47  <felixjet>i love koa
03:20:57  <felixjet>but i'm trying to use react with a starter kit, and all of them uses express :(
03:21:00  <TheThing>also, another thing I like about koa compared to express is, when you're ready to send response, you can EASILY manipulate it in a middleware
03:21:04  <felixjet>trying to replace it for koa it's so hard
03:21:06  <TheThing>My current project uses express
03:21:13  <TheThing>and I've wrapped res.json like three times
03:21:17  <TheThing>it's so bad
03:21:32  <TheThing>and it makes it hard for me to transform the response or work with it in any way
03:21:36  <TheThing>except by wrapping res.json
03:21:39  <TheThing>it's absolutely horrible
03:21:43  <felixjet>manipulating response is so side-effects anyway
03:21:47  <felixjet>the ctx.body is too magic
03:21:52  <TheThing>ctx.body is best
03:21:56  <TheThing><3
03:22:09  <TheThing>the ctx.body also allows me to re-use routes elsewhere
03:22:20  <TheThing>for example: I have a route called getUserSingle
03:22:34  <TheThing>it gets the user and does bunch of security stuff and eventually adds the user to ctx.body
03:22:43  <TheThing>I can call that same function from different routes to get the routes
03:23:09  <felixjet>but you can do that in express too, don't?
03:23:18  <TheThing>like: await userRoutes.getUserSingle(ctx); /* do something with user which is now in ctx.body */
03:23:35  <TheThing>not really because express routes don't RETURN result
03:23:41  <TheThing>they send it into res.json
03:23:47  <TheThing>and once it's in res.json you're screwed
03:24:25  <TheThing>the upside as I described above is sometimes I have to have tons of security checks surrounding getting resources. I can now implement it one route and call it from different routes if I need to get the resource and do something with it
03:24:41  <TheThing>so now for example, PUT for user would be like:
03:25:14  <TheThing>function updateUser(ctx) { await getUserSingle(ctx); let user = ctx.body; user.update(req.body); }
03:25:16  <TheThing>for example
03:25:24  <felixjet>but... you can use a promise based router and chain them, right'
03:25:39  <TheThing>a promise based router can't return the result
03:25:50  <TheThing>I think you might be misunderstanding something about the promise router express thingy
03:25:57  <felixjet>like .then(() => { return getUserSingle() }).then(user => { // do something with user })
03:26:07  <TheThing>ahh, you mean like that
03:26:27  <TheThing>but then you have a function for every route
03:26:44  <felixjet>no, since getUserSingle() is separate
03:26:48  <TheThing>if you did it like that
03:26:49  <felixjet>you can have it anywhere
03:26:55  <TheThing>then for every route like getUserSingle
03:27:24  <TheThing>you would have to do: router.get('/users', (req, res) => getUserSingle(req, res).then(req.json))
03:27:26  <TheThing>or something like that
03:27:33  <felixjet>yea
03:27:37  <TheThing>which is a function for every route
03:27:42  <TheThing>no matter how hard you try to hide it
03:27:51  <TheThing>*res.json
03:28:07  <felixjet>but no magic
03:28:20  <felixjet>you can see what is happening instead of random middleware mutating the body
03:28:29  <TheThing>what random middleware
03:28:37  <TheThing>uhh
03:28:37  <TheThing>also
03:28:43  <TheThing>middleware will ALWAYS have to mutate the body
03:28:46  <TheThing>ever used partial?
03:29:21  <felixjet>never
03:29:32  <TheThing>should check it out
03:29:47  <TheThing>it's the best thing ever
03:29:58  <TheThing>for an API user
03:30:05  <TheThing>I use it on almost all my API stuff
03:30:49  <TheThing>also, in the above example
03:30:50  <TheThing>router.get('/users', (req, res) => getUserSingle(req, res).then(req.json))
03:30:58  <TheThing>getUSerSingle is effectively a resource layer object
03:31:12  <TheThing>*function
03:31:16  <TheThing>it's not a route controller
03:32:21  <felixjet>>.<
03:33:19  <TheThing>that being said
03:33:29  <TheThing>it's something that I've been meaning to think of to do
03:33:34  <TheThing>there are two types of implementing security
03:33:39  <TheThing>on is explicit and the other implicit
03:33:49  <TheThing>most of my project require explicit implementation of security
03:33:51  <TheThing>so stuff like this
03:33:57  <TheThing>(gonna take a screenshot)
03:35:35  <TheThing>I've done a lot of API design and creation over my lifetime and had a lot of bad experience with badly designed stuff (stuff that I've designed(
03:35:39  <TheThing>my latest design looks like this:
03:35:46  <TheThing>http://i.imgur.com/AnQQf5o.png
03:36:22  <TheThing>This is what I call explicit security implementation. Basically, I have to explicitly call or check the security everytime I retrieve (in this case) a cube
03:37:09  <TheThing>My ultimate hope is to have security bits implicitly defined, where if I call to get a resource ANYWHERE in the code, it will automatically verify the security for me
03:37:26  <felixjet>yea, middleware helps there
03:37:36  <TheThing>the problem with explicitly having to check the security is it makes it more likely you'll accidentally forget to call it once
03:37:46  <TheThing>I don't want middleware for this though
03:38:07  <TheThing>that would be a horrendously huge and horrible to maintain middleware if it had to check the security access on every single resource type
03:38:33  <TheThing>in any case, felixjet, I STILL haven't come up with a good solution to this YET
03:38:45  <TheThing>this is my latest iteration and it's the least horrible I've done
03:39:26  <TheThing>actually, the latest latest iteration I've done was to actually send the req object directly into the database layer and have it take care of any security access for me
03:39:42  <TheThing>and I'm leaning on that for my future solution to implementing implicit security access to resources
03:40:36  <TheThing>felixjet: http://i.imgur.com/QkvJK99.png the latest latest iteration that I'm STILL not sure is the best way
03:41:16  <TheThing>so I'm trying it out and collecting experience on whether I'm happy with this solution
03:41:36  * TheThingis an avid thinker and constantly thinking and brainstorming new design ideas and solutions to implementation problems and etc.
03:41:40  <felixjet>probably a framework will replace koa meanwhile
03:41:40  <felixjet>xD
03:41:59  <TheThing>koa meanwhile?
03:42:25  <TheThing>anyways, I should get back to work now
03:42:42  <TheThing>working on an older project that unfortunately does not use those clean design routes I just showed you :<
03:42:53  <TheThing>it's a horrible mess
03:43:06  <TheThing>it's the iteration I did before I came up with the "clean" design I posted in the pictures above
03:43:43  <TheThing>I really wish companies and projects and programmers would actually share their post mortem so I wouldn't have to go through all their problems
03:44:50  <TheThing>I do like that I'm still constantly evolving my programming techniques and skills
03:44:56  <TheThing>I've always been afraid I'm growing stale :<
03:45:18  <felixjet>like all of us
03:45:21  <TheThing>and with that
03:45:37  * TheThingis gone to work, highlight me if you need me or wanna talk more :b
03:45:47  <felixjet>thanks mate
03:48:09  <TheThing>I would say res.json is more magic than ctx.body but I digress :b
05:25:44  * __ransom__joined
06:15:22  * joshonthewebjoined
06:16:13  * __ransom__changed nick to ransom_
06:32:04  * joshonthewebquit (Quit: Computer has gone to sleep.)
07:51:26  <TheThing>dammit felixjet
07:52:05  <TheThing>look what you made me do: https://github.com/alex-whitney/express-promise-router/pull/22
07:52:42  <TheThing>:<
08:36:15  * joshonthewebjoined
11:05:58  * DrMabusejoined
11:30:59  * DrMabusequit (Remote host closed the connection)
11:32:15  * Diromoxjoined
12:01:47  * DrMabusejoined
12:03:04  * DrMabusequit (Read error: Connection reset by peer)
12:03:32  * DrMabusejoined
12:10:24  * DrMabusequit (Ping timeout: 260 seconds)
12:19:27  * DrMabusejoined
12:20:05  * mezodjoined
12:54:43  * TheThingquit (Remote host closed the connection)
12:55:21  * Diromoxquit
13:26:07  * mezodquit (Remote host closed the connection)
13:38:10  * mezodjoined
14:47:51  * knksmith57joined
15:09:08  * joshonthewebquit (Quit: Computer has gone to sleep.)
15:09:34  * joshonthewebjoined
15:14:16  * joshonthewebquit (Ping timeout: 244 seconds)
15:23:53  * knksmith57quit (Quit: Leaving.)
15:48:47  * knksmith57joined
15:50:33  * brianGOquit (Ping timeout: 246 seconds)
16:03:17  * knksmith571joined
16:03:47  * knksmith57quit (Ping timeout: 248 seconds)
16:38:00  * mezodquit (Remote host closed the connection)
16:46:22  * DrMabusequit (Remote host closed the connection)
16:55:33  * TheThingjoined
17:00:30  * TheThingquit (Ping timeout: 268 seconds)
17:11:58  * knksmith571quit (Quit: Leaving.)
17:12:06  * mezodjoined
17:24:13  * knksmith57joined
17:37:03  * DrMabusejoined
17:41:44  * DrMabusequit (Ping timeout: 260 seconds)
17:57:53  * knksmith57quit (Quit: Leaving.)
18:00:45  * knksmith57joined
18:01:55  * knksmith57quit (Client Quit)
18:32:03  * knksmith57joined
18:37:47  * DrMabusejoined
18:42:24  * DrMabusequit (Ping timeout: 260 seconds)
19:19:36  * TheThingjoined
19:30:19  * Diromoxjoined
19:38:30  * DrMabusejoined
19:42:57  * DrMabusequit (Ping timeout: 244 seconds)
19:43:20  * danneujoined
20:39:17  * DrMabusejoined
20:45:36  * DrMabusequit (Ping timeout: 276 seconds)
21:08:28  * mezodquit (Remote host closed the connection)
21:41:17  * DrMabusejoined
21:45:40  * DrMabusequit (Ping timeout: 252 seconds)
21:54:36  * mezodjoined
22:42:03  * DrMabusejoined
22:47:09  * DrMabusequit (Ping timeout: 276 seconds)
23:42:46  * DrMabusejoined
23:47:03  * DrMabusequit (Ping timeout: 240 seconds)