Page MenuHomePhabricator

UsabilityInitiative combined/minified scripts are broken because of flawed combine.sh
Closed, ResolvedPublic

Description

The combine.sh script which builds the combined/minified JS files is flawed. As a result, the UsabilityInitiative does not work at all currently if you set $wgUsabilityInitiativeResourceMode to 'combined' or leave it at the default 'minified'.

It is probably assumed the combined JS file will be made from the modules in the following order:

jquery.async.js
...
jquery.textSelection.js

jquery.wikiEditor.js
jquery.wikiEditor.dialogs.js

jquery.wikiEditor.toc.js
jquery.wikiEditor.toolbar.js

However, it is obviously not, because in the alphabetical order (used by “cat js/plugins/*.js”), “jquery.wikiEditor.js” comes only _after_ “jquery.wikiEditor.dialogs.js”. That means the resulting files tries to use $.wikiEditor in jquery.wikiEditor.dialogs.js before it is initialized in jquery.wikiEditor.js

If you do not want to list the files manually, you either need to sort them without the .js extension, or rename them, so that wikiEditor.js comes ahead of everything else.


Version: unspecified
Severity: critical

Details

Reference
bz20485

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:52 PM
bzimport set Reference to bz20485.

Solved in r55781 by explicitly listing javascript files to be combined since order is important. We were previously just getting luck that alphabetical order was acceptable.