ResourceLoader/Version 2 Design Specification/Worklist for 2011

Jump to navigation Jump to search
Item Category Task Time est. (hours) Person Completion Date
A Architecture and Design
1 Database schema - RK 2011-06
2 Gadget-registration format - RK, TT 2011-06
3 Browser support for <noscript> stylesheets in <head> - RK, TT 2011-04-12
4 Mock-ups of Gadget Manager 8 TT 2011-08
5 Mock-ups of Shared gadgets in preferences 4 TT 2012-03
6 Research async-behavior of <script> and <link> when inserted to HEAD and/or BODY through appendChild and/or document.write – before document ready (eg. from head or top of body). Create a testing page and gather results from "all browsers". 3 TT, RK 2012
7 Make a good plan on how to set up the prototype environment with the wiki-farm for gadget repositories. 2 TT, RK 2011-09-20
B Core development
1 Module sources support
Backend (ResourceLoader->addSource/register, ResourceLoaderModule, ResourceLoaderStartupModule) - RK 2011-07-26
Front-end (mw.loader.addSource, mw.loader.register) - TT 2011-07-26
2 Expose on-wiki messages Messages that are only defined on-wiki need to be in ApiAllMessages so we can do search suggestions 2 RK 2011-09-14
3 gadgetpagelist table
We need a table to track gadget resources by type (Gadget:*.js/.css pages) so we can do search suggestions by type. Needs population script and hooks for staying up-to-date 2 RK 2011-09-01
Needs an API module that does a prefix search for a given extension (ie. prefix=fo&extension=js) 1 RK 2011-09-01
4 Get all available rights We need a method to get an array listing all user rights (not just the ones extensions define). As documented $wgAvailableRights does not include core rights. Already possible through User::getAllRights() - 2011-08-27
5 Hook for IsCssOrJsPage - RK 2011-08-?
6 Add nocontent-param to ApiAllMessages In order to make ApiAllMessages usable as a light-weight autocompletion module for message keys. (bugzilla:30591) 1 TT 2011-08-28
C Main back-end development
1 Database schema SQL-file + install/upgrade hook - RK 2011-08-?
2 Infrastructure on-wiki
Implement NS_GADGET - RK 2011-08-?
Restrict NS_GADGET to users having gadgets-edit right - RK 2011-08-?
Update preferences hook 1 RK 2011-08-30
3 SpecialGadgets
SpecialPage base - RK/TT 2011-08-?
List gadgets with title/description by section
(a bit like the old Special:Gadgets but with toollinks to modify and delete)
- RK/TT 2011-08-?
Style the overview and match the mockups 3 TT 2011-09-29
Implement Special:GadgetManager/{name} 3 TT 2011
Special:GadgetManager/{name}/export functionality 2 TT 2011
4 GadgetRepo
LocalGadgetRepo - RK 2011-08-?
ForeignDBGadgetRepo - RK 2011-08-?
ForeignApiGadgetRepo 3 RK 2011-11-02
5 ApiQueryGadgets
list=gadgets; GET; params: ganames=foo|bar (default: '', means all), gaprop=name|blob|shared(db-table columns, default: all)
Needed for ForeignApiGadgetRepo and preferences-pane of local wikis fetching remote gadget-info.
- RK 2011-08-?
Add features to satisfy the needs of the shared gadget preferences tab JS (D2) - RK 2011-08
6 Gadget definition namespace 2
Implement new namespace NS_GADGET_DEFINITION. RK 2011-08-30
Write blob to wiki page (Gadget definition:{name}) instead of changing row to database. RK 2011-08-30
Hook into EditPage. Update or create database row on edit of a NS_GADGET_DEFINITION page. RK 2011-08-30
Make sure page title is also a valid module name before insertion to database, and return custom error message to UI or API when invalid. RK 2012-05-30
Hook into page deletion. Remove database row on delete. RK 2011-08-30
Hook into page undeletion. Create database row on undelete. RK 2011-08-30
Trigger isCssOrJsPage for NS_GADGET_DEFINITION (to avoid Parser weirdness and ugly action=view) RK 2011-08-30
Restrict NS_GADGET_DEFINITION to users with gadgets-definition-edit.
@todo: What about other actions (delete/protect/viewdeleted etc.)
RK 2011-08-30
Disable page moving in NS_GADGET_DEFINITION (like with Categories) RK 2011-08-30
Deny edits to .js pages in NS_GADGET_DEFINITION that result in invalid JSON (return to edit page with the submitted text in the edit window) and show a descriptive message on top. The Edit Api should return some kind of error as well. - RK 2012
Apply normalization for the Gadget definition JSON blobs (remove duplicates, a-z sorting of values, add missing properties) RK 2012-07
Apply normalization in PST for .js pages in NS_GADGET_DEFINITION and prettify whitespace RK 2012
Apply normalization to metadata before saving to database and remove any whitespace RK 2012
D Main front-end development
1 Gadget Manager
Develop the modal Module- and settings property editor form based on mockups. 12 TT 2011-09
Expose list of available rights from PHP to JS as a variable (OutputPage mwConfig vars) 0.5 TT 2011-09
Implement auto-suggest in the editor (see mockups). Fetch from Apis (for script/style page names and message keys), from mw.loader.getModuleNames() (module names autocompletion), and from D1b (for available user rights). 2 TT 2011-08-31
Develop doModifyGadget() saving the blob with AJAX through ApiEdit 2 TT 2011-09
Develop doCreateGadget() 0.5 TT 2011-09-04
Develop "Create new gadget category" workflow in the editor 4 TT 2011-09-04
Show error message if ajax stuff fails in Gadget Editor 1 TT
Add error-handling of ApiEdit in doModifyGadget() 2 TT
Develop a modified version of the doModifyGadget form for creation of gadgets with an input field for name/id. And trigger it through a "Create" tab. - TT 2011/2012
Add links to recent changes for gadget definitions and gadget resources to Special:Gadgets (p-caction?) TT
2 Shared gadgets tab in preferences Build preferences form (with metadata fetched through API because of foreign messages with templates). PHP creates tab, AJAX populates it, API call cached for 30 mins. Submits as a normal form part of the preferences page. ? RK 2011
3 Special:Gadgets
Rewrite the 'old' SpecialPage to work with the new repository backend 3 TT 2011-09-19
E Unit testing
1 PHPUnit 40 RK
2 QUnit 10 TT
F Prototype
1 Set up a small prototype wiki family according to the plan 2 RK 2011-11-02
1 Configure the prototype wiki family 1 TT/RK 2011-11-02
2 Import popular gadgets to the labs repowiki 1
3 Gadgets RLification: Port definitions to RL, fix breakages, document most common problems, cross-browser testing 40 TT
G Migration
1 Maintenance script to populate the mw_gadgets table from MediaWiki:Gadgets-definition 2 RK 2011-11-12
2 Maintenance script to move "MediaWiki:Gadget-*.[js/css]" pages to "Gadget:*.[js/css]".
Note: Depending on whether or not the old extension accepted subpage scripts like "MediaWiki:Gadget-Foo.js/bar" to be used in the MediaWiki:Gadgets-definition, those have to be moved as well.
Alternative: Only move scripts and styles that are actually used (e.g. referenced from MediaWiki:Gadgets-definition).
RK 2011-11-12
3 Maintenance script to populate the mw_gadgetpagelist table the Gadget namespace. (Also ran into this when reinstalling the gadgets extension locally. Tables were cleared but I already had a few NS_GADGET pages but I had to make a null edit for them to those up in search suggestions) 2 RK 2011-09-01

Misc tasks[edit]


  • (TT) Surface the skin and position properties in the UI
  • (TT) Enforce ID-validation in the frontend too
  • (TT) Somehow add a spinner to the code that rewrites the shared gadget preferences labels using AJAX. The HTML structure makes this non-trivial, or I would've done it
  • (TT) rel=canonical for Special:Gadgets, per TODO comment in SpecialGadgets::execute()
  • (TT) On Special:Gadgets/export, "Add note somewhere with link to help pages about gadget repos; if this is a shared gadget and the user owns the wiki, he is recommended to instead pull from this repo natively." per TODO comment
  • (RK) Export translation subpages of title and description messages on Special:Gadgets/export per TODO comments in SpecialGadgets::showExportForm()
    • Title::getSubpages, see also migration script
  • (RK) Figure out how gadget ID naming collisions should be handled, define this somewhere, and enforce it
  • On Special:Preferences, don't show "Shared gadgets" tabs if there are no shared gadgets available (just like "Gadgets" tab is not visible if there are no registered gadgets on this wiki)
  • mw.gadgets.api.getGadgetData needs to handle 'jsonp'/'crossDomain' correctly for foreign sources. Right now it gives an exception XMLHttpRequest cannot load[..]. Origin is not allowed by Access-Control-Allow-Origin.


  • If not too complicated and possibility to trigger syntax highlighting, name Gadget definition pages .json instead
  • (RK) Add Gadget ID length limit (because of up_name) and enforce it in the backend
  • (TT) Fix preference tables display bug causing varying "gap"
  • (RK/TT) Research async-behavior, and convert client loading to new behavior loading async from top of the body
  • (RK) Write migration maintenance scripts per the table above
  • (TT) Implement "New category" feature in the dialog
  • (TT) Merge gadget manager into SpecialGadgets implementing mockups
  • (TT) "Create" tab on SpecialGadgets
  • (TT) "Delete gadget" link next to "Modify gadget" link
  • (TT) Make the Export-method on SpecialGadgets work (get a an array of full page names of the NS_GADGET_DEFINITION page, linked wiki resources in NS_GADGET, and messages (including subpages/translations) of title, description and linked messages in NS_MEDIAWIKI)
  • (RK) Fix bug that causes bad cache at r96837 CR
  • (RK) Preferences are currently <h2> tags with a multi-select HTMLform element (list of checkboxes with labels and a common name-attribute ("gadgets[]"). These should instead be <fieldset> elements wrapping the section with the category title in a <legend>, like other preferences tabs do. And the label should be like:
    <label><span class="mw-gadgets-title">Title</span>[ <br />Description... ]</label>
  • (RK) Revamp gadgets preferences sections
    • Include description of gadget on Special:Preferences (for foreign gadgets as well)
      • Label should be something like "$1:<div dir=auto>$2</div>" or something visually equivalent
    • Make sure things are sorted by i18n message value (probably automatic for local gadgets, needs JS reordering for foreign gadgets)
    • If two categories from different repos have the same i18n message value, merge them (in JS) but don't re-sort the merged category
  • (RK) Fix JS to not touch markup of local gadgets preferences. Currently makes MediaWiki:Gadgets-preference-description‎ fail. It shows the correct output and then it is removed (try by putting '''$1''':<br/>$2 in that message).
  • (RK) Make sure missing properties are filled in on read
  • (RK) Port support for skin-specific Gadgets from master
  • (RK) Add support for specifying position=top|bottom


  • On prototype (rl2-repo1wiki) message "Gadget-foobar-label" and "Gadget-foobar-tooltip" are not being suggested through the All messages API. The message index still needs the fix we talked about in San Francisco (or it didn't work)
    • Oh this has been fixed, the autosuggestions just aren't consuming it. You need to pass &amincludelocal=1 to allmessages.
  • Gadget editor does not handle errors like 'editconflict'
  • Gadget editor uses definitiontimestamp (when the database entry for the gadget was last changed) as basetimestamp (supposed to be the timestamp of the last edit to the definition page); this causes edit conflict errors when these timestamps aren't equal (this can happen if a whitespace-only edit is made, when a definition page is imported, and possibly in other cases as well)