Brion Vibber wrote: > The sortable table system in MediaWiki was completely rewritten in > r86088; > unfortunately this was done without benefit of any unit testing or > regression testing, and there seem to be a lot of new bugs introduced.
The legacy script was removed from svn without deprecation or quarantine phase, that is in contrary to the descriptoin and expectation set here [1]. Although a few legacy methods from wikibits.js were nuked right away because they can not co-exist at the same time, in general we should keep it around. For example addPortletLink and mw.util.addPorletLink. There's no need to remove the other. I suggest restoring the legacy ts_makeSortable functions in wikibits.js, except for one thing, which is sortables_init, it should not be applied to any table on-load (like nothing in a module should be executed on load, modules should only contain the plugins themselfs!) The new jQuery plugin would be in jquery.tablesorter.js which, like any module, also doesn't do anything on-load. Instead it is called in a lazy-loader for tables on the wiki page, this means on a unit test page both can be used seperately on indivudual tables since neither the legacy or the new one is called on load. This also makes sure our behaviour is in harmony with the expectation set by our javascript deprecation page [1] and will not break gadgets that are usiung (parts of) the legacy ts_* functions (which are global functions). Facts up front: this would mean adding back a method that is not used or going to be used on any page by default. On the other hand, if you take the introduction of the jquery.tablesorter out of the equation and compare to the previous release of MediaWiki, it means it wasn't touched at all and depracated by a modern module (like we've done for many things, normal procedure afaik). So summarized proposal: * Restore legacy script to comply with the deprecation guide (ie. not break gadgets that use (parts of) it) * Write unit tests for the legacy script * Write unit tests for hte new script * Fix the new script -- Krinkle [1] http://www.mediawiki.org/wiki/ResourceLoader/JavaScript_Deprecations _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l