Hello,
I would like to propose changes in current support of YUI2 library in Moodle which was already deprecated two years ago. The major problem is that YUI2 javascript and CSS are loaded on each page, another problem is that our hacky YUI2 support sometimes breaks during upgrades to new YUI3 versions. Related internal changes may also allow us to make more performance optimisations in the future.
MDL-34741 contains a patch that replaces our current loader hacks with YUI 2in3.
The benefits should be:
YUI2 Javascript classes and CSS are not loaded on each page - performance
YUI2 files are loaded asynchronously - performance
cleaner coding style with fewer bugs
Necessary upgrade steps:
none for YUI3 code
YUI3 code using YUI2 widgets needs to use Y.YUI2.* instead of previous YAHOO.*
rewrite old legacy code that is still using deprecated $PAGE->requires->yui2_lib('xx') to use new moodle JS modules
in the worst case just wrap old code with: YUI().use('yui2-dom', 'yui2-event', '...', function(Y) {var YAHOO = Y.YUI2; ...old code here...});
If you need more examples see https://github.com/skodak/moodle/compare/master...wip_MDL-34741_m24_yui2in3
Are there any objections? Do you still use YUI2 in your modifications and plugins? I agree that this may be a bit problematic especially for unmaintained contrib plugins.
Petr