<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Luke and I had a discussion on IRC about this. Basically, the more I think about it, the more I think most of what is happening in AeroGear.ajax is either already handled by jQuery.ajax or can be factored out into a smaller helper or merged into the specific part of the library it was meant to help. This will have the advantages of simplifying the lib to make it easier to grok, allow the decoupling of AeroGear.Auth and AeroGear.Pipeline (see&nbsp;<a href="https://issues.jboss.org/browse/AEROGEAR-858">https://issues.jboss.org/browse/AEROGEAR-858</a>) and also could shrink the size of the library a bit as well.<div><br></div><div><br></div><div>Below is the IRC transcript from the conversation Luke and I had. Anyone have any other opinions?</div><div><br></div><div>[09:28:37]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: need your opinion<br>[09:28:52]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: yes, &nbsp;i agree<br>[09:28:56]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;oh wait<br>[09:28:59]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;:)<br>[09:29:13]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: how much have you looked at / understand what is going on in&nbsp;AeroGear.ajax?<br>[09:29:29]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: the reason i ask is i am questioning its existence<br>[09:29:59]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: a bit, &nbsp;i would need to look at it to refresh my memory<br>[09:30:28]&nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>jdoyle&nbsp;(~<a href="mailto:jdoyle@pool-96-233-74-235.bstnma.fios.verizon.net">jdoyle@pool-96-233-74-235.bstnma.fios.verizon.net</a>) joined the channel.<br>[09:30:41]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: which pieces are you thinking should go?<br>[09:30:47]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: i was thinking about it last night and now that i read through it,&nbsp;the more i look at it the more i find myself saying … "Doesn't jQuery already do that for us?"<br>[09:32:10]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;there are only 2 pieces i'm not sure about<br>[09:32:12]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;1<br>[09:32:25]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;the POST/PUT of JSON formatted data being stringified<br>[09:32:26]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;there is the Auth stuff in there<br>[09:32:27]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;2<br>[09:32:42]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;the auth check to prevent unnecessary http requests<br>[09:32:52]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>#2&nbsp;i know is not done by jQuery.ajax but<br>[09:33:13]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;could that be done somewhere else then?<br>[09:33:18]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;i think that could be moved to auth, and auth refactored to decouple it from&nbsp;pipeline (which i want to do anyway)<br>[09:33:45]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;and i think the post put stuff could just happen in pipeline<br>[09:34:39]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;i think i'm going to play with this today and see if i can kill AeroGear.ajax<br>[09:34:41]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;all the promise stuff is handled by jquery anyway isn't it<br>[09:35:18]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: yeah, except for rejecting it immediately based on auth on line&nbsp;58 of aerogear.utilities.js<br>[09:35:53]&nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;abstractj is now known as&nbsp;abstractj|away<br>[09:36:05]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;but like i said<br>[09:36:10]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;i think that can move into Auth<br>[09:36:19]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;i think this is doable<br>[09:36:47]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: any concerns that this may be a bad way to go right now?<br>[09:36:57]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;removing AeroGear.ajax i mean<br>[09:37:16]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;it should cut or file size a bit too :)<br>[09:37:20]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;s/or/our<br>[09:38:29]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: i don't think so, &nbsp;the majority of what it does is parse the&nbsp;returned data to a proper format it looks like<br>[09:39:30]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;which can be handled in the callbacks<br>[09:39:44]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;ok<br>[09:39:58]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;that is true, &nbsp;but is that an extra step for the dev?<br>[09:40:19]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;nope, because i have my own callback which runs first and then calls theirs :)<br>[09:41:05]&nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>csadilek&nbsp;(csadilek@nat/redhat/x-mrudioyuhbqnjezq) joined the channel.<br>[09:41:12]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist:&nbsp;<a href="https://github.com/aerogear/aerogear-">https://github.com/aerogear/aerogear-</a>js/blob/master/src/pipeline/adapters/rest.js#L267<br>[09:41:28]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;then i apply() their supplied callback&nbsp;https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js#L290<br>[09:41:34]&nbsp;&lt;+qmx&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: you mean after the release right?<br>[09:41:39]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>qmx: oh yeah<br>[09:41:42]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;not for this one<br>[09:41:59]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;we've already tagged<br>[09:42:01]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>qmx: ^<br>[09:42:15]&nbsp;&lt;+qmx&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: yeah, just remembered that<br>[09:42:19]&nbsp;qmx<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;brainfarted<br>[09:42:21]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;:)<br>[09:42:26]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: i don't see where the data gets parsed here,&nbsp;&nbsp;<br>[09:42:46]&nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;jamezp is now known as&nbsp;jamezp_afk<br>[09:42:49]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: it doesn't because it happens in AeroGear.ajax right now … it&nbsp;would move in there though<br>[09:43:36]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: ah, &nbsp;thats what i was missing. &nbsp; Then wouldn't we have to repeat&nbsp;code for the other methods?<br>[09:43:48]&nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>mbg&nbsp;(~marius@redhat/jboss/mbg) left IRC. (Quit: mbg)<br>[09:44:35]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: we could factor that out into its own utility instead of bundling it&nbsp;into the ajax one<br>[09:44:42]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;then it could be reused<br>[09:44:45]&nbsp;&lt;+sblanc&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers:&nbsp;lholmquist: If you write this all down in to a JIRA I will be happy to&nbsp;give a third opinion :)<br>[09:45:41]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: that could work, in fact, &nbsp;would probably be better<br>[09:46:01]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>sblanc: sure, i will create a jira. are you saying you have another opinion or&nbsp;you want some time to think on it to comment?<br>[09:46:26]&nbsp;&lt;+sblanc&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: Want some time to think about it :)<br>[09:48:15]&nbsp;&lt;+lholmquist&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;kborchers: atm, the auth methods, login, enroll, &nbsp;don't do any data parsing&nbsp;since they don't go through Aerogear.ajax, should we add this new utility method to that&nbsp;once it's written?<br>[09:50:15]&nbsp;&lt;+kborchers&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>lholmquist: maybe … probably … not sure yet. :) &nbsp;i think the main reason i&nbsp;didn't use AeroGear.ajax was because it did an auth check and that wouldn't be good during&nbsp;auth :)</div></body></html>