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.

Event Timeline

bmansurov raised the priority of this task from to Needs Triage.
bmansurov updated the task description. (Show Details)
bmansurov subscribed.
Jdlrobson set Security to None.
Jdlrobson awarded a token.
Jdlrobson updated the task description. (Show Details)
Jdlrobson triaged this task as Lowest priority.Sep 8 2015, 12:28 AM
Jdlrobson subscribed.

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 subscribed.

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 :)

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

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