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)


 * As it has appear thats my point little wikis have custom JS and from those many wikis copy their JS or CSS with out knowing how to really make it work, and like always not every body comes to central to be inform and i guess like always we will get most complain when the change is made and people come here to get help and complain they where not told and then e direct to this page... --

Testing and Timing
Hi everyone,

I want to give you a heads-up on updated timing for our transition away from YUI, and some information about how you can test your wiki on the new skin.

Today, we added a new temporary option to user preferences called "Use Awesome / LeanMonaco". You will find it on the skin tab under the Monaco themes. Enabling this option will allow you to browse Wikia using the new skin which will no longer load YUI on article view pages, like Christian mentioned above. If you have created custom javascript for your wiki, I encourage you to select that option and test to ensure that everything on your wiki works properly when viewed with the new skin. You can also test single pages using the new skin by appending "?useskin=awesome" to the end of any page title.

Currently, we plan to migrate to this skin site-wide on Wednesday, June 24th (not June 3rd as originally planned).

If you have any questions about this change, please let me know.

Thanks! --KyleH (talk) 21:38, 16 June 2009 (UTC)


 * Ah ah! It's our (my) National Holiday that day. ;-) — TulipVorlax 03:01, 18 June 2009 (UTC)

Table of content
I'm not completely sure if this has something to do with this change, but the table of contents does not show up properly for anonymous users (like that). The hide/show link does not work (it also takes a while to show up). However, if you log in an account and log off after, it will show up correctly. You need to clear your cookies/cache/etc. to see it. It does not work on all the browsers I have tested (Firefox, Opera, Chrome, IE8). I have asked someone else to see if it was just my computer, but it appears it happens for all users without an account. --D. (talk · contr) 18:15, 19 June 2009 (UTC)