Given that your target audience for this project right now is Wikipedia readers, what are the advantages to those users of removing the MobileFrontend dependency from Gather? I'm unclear on this point right now.
Dan
On 13 April 2015 at 12:10, Jon Robson jrobson@wikimedia.org wrote:
I did a quick spike [1] to work out how Gather could stop depending on MobileFrontend.
Essentially problems come into 2 categories:
- Finding a place for Gather in the desktop skin and addressing
styling issues in desktop skins (I am working on these and don't see any major blockers here). I think to fix this we simply need to provide Gather as a desktop beta feature. This is tracked here: https://phabricator.wikimedia.org/T95227 and I see no issues with doing this.
- frontend code standardisation
The main problem with the hard dependency is that MobileFrontend uses a library that was built around the same time as OOJSUI. Migrating MobileFrontend to use OOJSUI is a big task and although has happened somewhat (the codebase now uses OOJS for class inheritance) it is by no means complete.
Gather current depends on a variety of MobileFrontend modules which mainly include: API, overlay, user and user setting code, EventLogging schema code, notifications code. We also have a method mw.mobileFrontend.require and mw.mobileFrontend.define for defining modules. OOJS ui does this differently writing class names to the OO global variable object.
==The long term fix=== ... is obviously to migrate all the code to OOJS UI which I believe would require the following steps:
- https://phabricator.wikimedia.org/T88559 which as an end result will
rewrite overlay code in oojs ui
- Rewriting mw.util.notify as an oo js ui component and folding the
mobile toast notification into it. - https://phabricator.wikimedia.org/T66565
- Core should have a way to store user settings in localStorage rather
than using $.cookie (similar to M.require( 'settings' ) ) - something akin to https://phabricator.wikimedia.org/T67008
- EventLogging Schema.js should be ported to oojs ui and moved into core.
- We only use user for the getEditCount function - it would be trivial
to rewrite using mw.user
== the short term fix== We could split out the frontend library MobileFrontend uses to allow us to share it between Gather and MobileFrontend.
The way I see this working is to merge all the shared generic JS code into its own project just like oojs ui and slowly rewrite it there till it is pure oo js ui. This would take everything in the javascripts/common/ folder except application.js and bundle it into one file.
We could include this as a submodule in both projects, both extensions conditionally adding a RL module for it when it does not exist.
What do people think about taking this approach on the short term?
[1] https://phabricator.wikimedia.org/T94100
Mobile-l mailing list Mobile-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mobile-l