Forum:Wikia is changing javascript frameworks

Hi all,

Over the next few weeks, Wikia will be transitioning from the YUI javascript framework to jQuery. For most everyone, the only thing that this means is that the site should run faster once we're completely done with the process; however, if you have created custom javascript in your MediaWiki:Common.js or MediaWiki:Monaco.js that relies on YUI, you may need to update the code to ensure that it continues to function properly. Here is an email that Christian sent to the wikia-tech-l mailing list regarding the change: Jesús and all,

Sorry for the delay in communicating this change. We've been heads-down on optimization work all week and are just now coming up for air. Here's the full story:

Several months ago, we added jQuery into the mix with YUI, mostly for its more accurate offset function. Some of our YUI features had already been written with $ as an alias for YUI's get function, so we worked jQuery around that fact. Now, it doesn't make a ton of sense to employ two javascript frameworks, so we had to make a choice. After evaluating Dojo Toolkit, MooTools, YUI 3, and jQuery 1.3, we've decided to transition Wikia's frontend to jQuery. We'll do this in a couple of stages.

On May 13, as Jesús noted, the $ variable will an alias for jQuery. We'll still continue to load YUI, so no transition from YUI to jQuery is necessary for now. If you have any scripts that use $ for YUI's get, changing the alias is pretty easy: $("some_element") becomes: YAHOO.util.Dom.get("some_element") In the same release, jQuery will also be updated to 1.3.

On June 3rd, the first phase of the "Lean Monaco" optimization project is scheduled to be released. At that time, YUI will not be loaded on article pages, but will still be loaded on edit pages. All of Wikia's extensions that are used on article pages will have been optimized and transitioned to use jQuery. If any of you use scripts that are dependent on YUI, and you haven't transitioned them to jQuery, you can always include a Yahoo-hosted build of YUI via MediaWiki:Monaco.js. Yahoo-hosted scripts can be configured here: http://developer.yahoo.com/yui/articles/hosting/

After the first phase, the second phase of our front end transition will completely remove YUI from the site, leaving jQuery as the sole javascript framework. We haven't yet met to discuss the timing for the second phase, but we'll keep Wikia-tech-l posted on the plan.

-Christian If your wiki has code that might be affected by this change, please subscribe to the wikia-tech-l mailing list for future updates.

Thanks! --KyleH (talk) 23:03, 11 May 2009 (UTC)


 * KyleH i would suggest the potential benefit of using the wikia talk msg feature to inform this to every body more effectively --


 * It's possible, but to be frank, 99.9% of users and most admins won't care: as changes go, it's irrelevant to most wikis, as they don't use custom JS. We'll likely make more notices as we get closer to the change. 13:55, 12 May 2009 (UTC)


 * How do I know my Common.js code will be compatible or not? -- LordTBT Talk! 22:40, 12 May 2009 (UTC)


 * I think only someone with a decent JS knowledge and experience would know.
 * So, that exclude me.
 * So, i will need help with : c:fr.guildwars:MediaWiki:Common.js, c:fr.guildwars:MediaWiki:Monobook.js and c:fr.guildwars:MediaWiki:Monaco.js. — TulipVorlax 01:53, 13 May 2009 (UTC)


 * Only your MediaWiki:Common.js looks to mention anything to do with Yahoo (however, I don't know enough to say whether that could be an issue). Edit: actually, I notice that code is for LinkSuggest improvements - we've been updating LinkSuggest, so I'm not sure what purpose that code has now. 13:48, 13 May 2009 (UTC)


 * Yes, there's old code that i wasn't able to "extract". But there's also code to make the "auto-sumary" (Résumés prédéfinis) drop down to show above the sumary box. — TulipVorlax 01:27, 14 May 2009 (UTC)