Last modified: 2014-02-12 23:53:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46133, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44133 - Separate config module which mimics mw.config
Separate config module which mimics mw.config
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
stable (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Jon
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-19 00:28 UTC by Juliusz Gonera
Modified: 2014-02-12 23:53 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Juliusz Gonera 2013-01-19 00:28:00 UTC
mw.config is a mw.Map object. Let's make our config also a mw.Map object (i.e. let's have mobileFrontend.config)

http://www.mediawiki.org/wiki/RL/DM#mediaWiki.Map
Comment 1 Jon 2013-02-05 23:15:35 UTC
Or let's just build on top of mw.config and deprecate M.getConfig
Comment 2 Juliusz Gonera 2013-02-05 23:21:07 UTC
I'm always worried about modifying the behaviour of the code we don't write ourselves, even if it's a small change.

Let's take wgTitle as an example. I can't imagine now any situation where some MediaWiki JavaScript would want the old wgTItle value, but who knows. Or maybe there's some code that keeps updating wgTitle in a weird way and will override what we set there. It just seems bug prone.

I've just thought we could have a very thin wrapper (yay, another one) whose get() function would first try to return values from our config, and if they weren't present it would return the value from mw.config. This way we could always just use one method of accessing config, but at the same time we wouldn't depend on mw.config internals and the ways it's populated.
Comment 3 Jon 2013-03-01 00:05:24 UTC
We can use https://gerrit.wikimedia.org/r/51604 as a basis
Comment 4 Jon 2013-03-05 20:12:50 UTC
Deprecated getConfig, setConfig and mwMobileFrontendConfig in https://gerrit.wikimedia.org/r/52270
Comment 5 Tim Starling 2013-03-14 02:17:06 UTC
I don't think it's a great idea to have these variables included in every non-mobile page view, it's quite a bit of bloat. Instead, you could call addJsConfigVars() conditionally, based on whether the mobile skin is being used. And you could follow the advice on the doc comment of OutputPage::getJSVars() and move the invariant configuration (wgMFPhotoUploadEndpoint etc.) to the startup module.
Comment 6 Gerrit Notification Bot 2013-05-09 18:25:42 UTC
Related URL: https://gerrit.wikimedia.org/r/63002 (Gerrit Change I08f91aa6b960d642802463424f83c93f6387f0d1)
Comment 7 Gerrit Notification Bot 2013-05-09 18:25:45 UTC
Related URL: https://gerrit.wikimedia.org/r/63003 (Gerrit Change I126aadd503d233247b783af7bc4fcf13070a1299)
Comment 8 Gerrit Notification Bot 2013-05-13 23:20:51 UTC
https://gerrit.wikimedia.org/r/63003 (Gerrit Change I126aadd503d233247b783af7bc4fcf13070a1299) | change APPROVED and MERGED [by jenkins-bot]

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links