I decided to make the next issue I pulled to be 7840 since it is I feature I was interested in seeing and it would give me a chance to dive into front end code rather than back end code. I’ve been spending several hours acquainting myself with the dichotomy between the mobile and desktop UI. Before I start on even dabbling with any changes, much less the making real ones, I had some questions on the Mobile UI best practices which I can’t definitively divine from the present documentation. I’ve searched here to see if there were some topics but there aren’t really except for discussions about a heavy refactoring of the whole UI/frontend part of the stack back in 2014 (IIRC) and earlier this year. There are some dribs and drabs about moving shared JavaScript around and eliminated custom libraries etc., which only partially relates to my questions.
When I look at the code base I’m seeing that much of the HAML code is not shared between them but instead there are parallel pieces that do the same thing. This is probably exacerbated by the fact that in some cases, this one in particular, a lot of the logic in the UI is actually in Handlebar and Backbone JavaScript code. As far as I can tell neither Backbone nor Handlebar is loaded in the mobile version of the site (I’m looking at the browser-side list of loaded source files to confirm this). So first question is: is this an artifact of the design evolution of the mobile site or are these libraries explicitly being excluded from mobile browsing for performance reasons or something along those lines?
Assuming I am correct about not having the handlebar/backbone code base available for mobile use then code reuse between the two will be limited outside of the controllers I imagine. I believe this is considered okay since there isn’t really a place for shared JavaScript code and the HAML files for the two are mostly separated (there is some partial loading shared between the two in a few places). My second question is therefore: Is the mobile developer supposed to lean more towards code isolation between the two platforms rather than code reuse? For example, if in doing a feature I see that I could refactor something to have shared HAML files between the two would that be considered a negative thing and therefore should be avoided?
Lastly, assuming (I’m two assumptions deep now, which is probably a bad idea but…) that we are leaving the code isolation and not bringing in handlebars/backbone into the mobile version of the site, my third question would be: should a mobile UI developer be approaching that application more like a traditional Rails app but with HAML instead of ERBs, using existing UIs for some guidance on where to bring in JavaScript “accents” (for lack of a better word)?
I’m looking forward to working on this feature, but I figured it’d be good to check in on this after having collected my thought son it.