views:

1746

answers:

5

I have a web application that is using both jQuery 1.2.6 and YUI 2.6.0 and I am thinking about upgrading one or both of these libraries. The current versions (as of this question) are jQuery 1.3.2 and YUI 3.0.0 (beta 1). The main reason for jQuery was the selector engine, and the main reason for YUI was components like TreeView and DataTable. Now that YUI 3 includes Sizzle (the same selector engine as jQuery), I am thinking about only upgrading YUI and removing jQuery.

From both experience and Mixing jQuery and YUI together in an app, is it easily possible?, I know I can have both, but it doesn't feel right. I prefer one way of doing AJAX calls, DOM events, plug-ins, etc.

Has anyone does this or have any advice for me? We already use jQuery in noConflict mode to avoid the use of $.

+1  A: 

I've not encountered any issues using the YUI Calendar widget with jQuery for all my other needs.

YUI3 has a Global Object conecept which is designed to mitigate conflict issues, as I understand it. http://developer.yahoo.com/yui/3/yui/#using

You might want to check the YUI3 road map http://yuilibrary.com/projects/yui3/roadmap

Tree View and DataTable arnt mentioned, unless I've missed them. There are only four initial widgets mentioned for Q4 09.

firecall
A: 

Firecall is correct saying that YUI3 does not support any of the widgets you are using.

That means if you dump JQuery you would still need to support YUI2.6 and YUI3 at the same time. You can see how to run YUI3 in compat mode here.

So you need to weigh in an see if moving to YUI3 is good choice. It might be because when they finally port over all of the widgets you will not have to go back and recode any of the JQuery stuff. But you are still stuck with 2 apis.

epascarello
A: 

While Matt Sweeney was working on Sizzle integration into YUI3, the last I heard of the project was that it was temporarily on hold due to the pretty severe filesize bump Sizzle introduced. I believe the team is still working on introducing Sizzle, but they had some concerns.

It should also be noted that both Sizzle and YUI3 defer to the native implementation of querySelectorAll if it's available.

foxxtrot
Do you have a URL for the Sizzle on hold reference?
Kevin Hakanson
I don't have a URL as the comment was made in an e-mail thread external to the Y! Group or forums. The plan is still to include Sizzle at some point, though probably not in YUI 3.0.0 GA
foxxtrot
There is a reference to this at http://stephenwoods.net/2009/03/16/yui-3-sizzles/ (obviously it's not an official reference, but it does confirm @foxxtrot's statement).
wrumsby
A: 

You can always wait a couple months and port your code completely over to YUI 3.0 when they start adding more widgets. That is what I am thinking of doing, because right now I depend on YUI 2.6 for the Treeview widget and a few other Widgets that are very nice to have around.

jhuni
+1  A: 

This might be worth looking into as a stop gap - lets you use yui2 widgets with yui3 for migration.

http://yuilibrary.com/gallery/show/yui2

kouPhax