Page MenuHomePhabricator
Paste P2315


Authored by phuedx on Nov 17 2015, 11:50 AM.
10:20:04 AM <bmansurov> phuedx: got time to talk about
10:20:17 AM <codezee> alright thanks :)
10:21:06 AM <phuedx> bmansurov: yes, absolutely
10:21:21 AM <bmansurov> ok, cool
10:21:50 AM <bmansurov> So as I understand it we cannot take the same approach as Jon and create a muhogan complier in the cards extension, can we?
10:22:04 AM <bmansurov> that would conflict with the existing implementation
10:23:03 AM <bmansurov> we could create hostache maybe?
10:23:30 AM <bmansurov> but in the long run we should create a patch in core that does it automatically
10:24:10 AM <phuedx> bmansurov: we could dynamically create the module in the ResourceLoaderRegisterModules hook
10:24:11 AM <bmansurov> right now since we don't have time to do so we should go with a less perfect solution
10:24:22 AM <phuedx> no custom rl module
10:24:37 AM <phuedx> which we have no way of sharing
10:24:47 AM <phuedx> well, we do, but we didn't think about it at the time
10:25:13 AM <phuedx> 10:23:30 AM <bmansurov> but in the long run we should create a patch in core that does it automatically -- alternatively, stop using hogan in mobilefrontend
10:25:46 AM <bmansurov> phuedx: ok
10:26:07 AM <bmansurov> afaik hogan is used becuase it weighs less than mustache
10:26:16 AM <bmansurov> also, how would we handle this?
10:26:35 AM <phuedx> how do you mean?
10:26:43 AM <phuedx> do you mean getting the compiler?
10:26:57 AM <bmansurov> mw.template.registerCompiler( 'muhogan', compiler ); would fail if we also registered our own muhogan no?
10:27:03 AM <phuedx> yes
10:27:09 AM <bmansurov> or are you suggesting we should not register a new complier?
10:27:21 AM <phuedx> i'm suggesting that we don't register a new compiler
10:27:30 AM <bmansurov> ok
10:27:56 AM <bmansurov> if i'm not mistaken templates will work only if the file extensions match
10:28:05 AM <bmansurov> for example hogan compiles *.hogan files only
10:28:18 AM <phuedx> just looking through mw.template now
10:28:20 AM <bmansurov> ok
10:30:18 AM <phuedx> also, mustache.min.js weighs in at 3.2 kb...
10:30:29 AM <phuedx> i shall write a task to start a discussion
10:30:33 AM <bmansurov> cool
10:31:41 AM <phuedx> bmansurov: namespace the resourceloader module class
10:31:57 AM <phuedx> and mostly copypasta its definition
10:32:16 AM <phuedx> provided that the quicksurveys one is in the QuickSurveys namespace
10:32:24 AM <phuedx> and yours is in the RelatedArticles namespace
10:32:28 AM <phuedx> you won't get collision
10:32:28 AM <phuedx> *s
10:32:40 AM <phuedx> will /will/ create a library later asap
10:33:16 AM <bmansurov> phuedx: you're talking about namespacing right?
10:33:19 AM <phuedx> but yeah, you're right, the behaviour of mw.template.get around fetching compilers from template names makes this tricky
10:33:26 AM <phuedx> yup
10:33:28 AM <phuedx> yay
10:33:32 AM <phuedx> it's namespaced
10:33:46 AM <bmansurov> what about the front end part of it (the link above)
10:33:49 AM <bmansurov> ?
10:33:51 AM <phuedx> so if you had a similar implementation in relatedarticles, but in the relatedarticles extension, then it won't collide
10:34:07 AM <bmansurov> ok
10:34:28 AM <phuedx> sec
10:35:18 AM <phuedx> bmansurov: mw.template.registerCompiler does a little validation but overwrites the currently registered compiler if it's set
10:35:50 AM <bmansurov> cool then, let's overwrite it ;)
10:35:52 AM <phuedx> so, you could either be nice and test if the compiler's registered (with a comment alongside explaining that this should be gotten rid of by sharing code)
10:35:54 AM <phuedx> or…
10:35:55 AM <phuedx> that :)
10:36:12 AM <bmansurov> alrighty, let me see if i can implement it
10:36:41 AM <phuedx> cool
10:36:51 AM <phuedx> i'll be around longer today as i've got to make up some time
10:37:19 AM <bmansurov> great

Event Timeline

phuedx edited the content of this paste. (Show Details)Nov 17 2015, 11:50 AM
phuedx changed the title of this paste from untitled to T116601-discussion-phuedx-bmansurov.txt.
phuedx updated the paste's language from autodetect to autodetect.
phuedx changed the title of this paste from T116601-discussion-phuedx-bmansurov.txt to t116601-discussion-phuedx-bmansurov.txt.
phuedx changed the title of this paste from t116601-discussion-phuedx-bmansurov.txt to t116601-irc-phuedx-bmansurov.txt.Nov 17 2015, 3:45 PM