Page MenuHomePhabricator

Rename JavaScript modules to reflect their location
Closed, ResolvedPublic

Description

If you are new to MobileFrontend then is a great task to start on and get familiar with it!

Now that the resources files have been moved to the resources folder, it makes sense to change old module names too. For example, modules/search/SearchApi should be renamed to mobile.search.api/SearchApi, etc. (the text before the / is the name of the ResourceLoader module and the text after it the name of the class).
Old names should be deprecated like
M.define( 'mobile.search.api/SearchApi' ).deprecate( 'modules/search/SearchApi' )

Be careful to correctly deprecate modules as some other exntensions may be using them.

Details

Related Gerrit Patches:
mediawiki/extensions/MobileFrontend : masterRename modules in resources

Event Timeline

bmansurov raised the priority of this task from to Needs Triage.
bmansurov updated the task description. (Show Details)
bmansurov added a project: Readers-Web-Backlog.
bmansurov added a subscriber: bmansurov.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 26 2015, 11:18 PM
Jdlrobson updated the task description. (Show Details)May 27 2015, 7:09 AM
Jdlrobson set Security to None.
Jdlrobson awarded a token.
Jdlrobson updated the task description. (Show Details)
phuedx moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.
Jdlrobson triaged this task as Lowest priority.Sep 8 2015, 12:28 AM
Jdlrobson added a subscriber: Jdlrobson.

Could someone assign this to me please (I cannot assign myself)

Change 237969 had a related patch set uploaded (by TasneemLo):
Rename modules in resources

https://gerrit.wikimedia.org/r/237969

The above patch is a demo for the modules/search/SearchApi. Is this fine ? Or did I miss something ?

If it's fine, I'll continue and finish up the rest. Would you like different commit for each resource ? Or a single commit with all of them changed ?

Note: I used find . -type f -exec sed -i "s%'modules/search/SearchApi'%'mobile.search/SearchApi'%g" {} \; to make sure I didn't miss out any occurence.

Florian added a subscriber: Florian.

Hi @TasneemLo! Like I wrote in the change, I'm pretty sure, that you understood the problem and your change looks good (except one little confusion from our side! :P). I'm not sure, how much changes in the code are needed. I would suggest to made them all in one commit (in the hope, that there aren't too much changed names).

To the mobile.search/SearchApi or mobile.search.api/SearchApi you should use mobile.search.api/SearchApi. This task was created before we moved the SearchApi to it's own module :)

Florian updated the task description. (Show Details)Sep 13 2015, 11:36 AM
Florian closed this task as Resolved.Sep 17 2015, 5:50 PM

Change 237969 merged by jenkins-bot:
Rename modules in resources

https://gerrit.wikimedia.org/r/237969