Search code examples
javascriptjqueryyui

jQuery and YUI (yahoo ui)


So as i understand it jQuery is basically a framework for DOM manipulation as a higher abstraction layer then native javascript. Where as YUI (yahoo UI) library is a user interface widget library giving the developer a means to forget DOM manipulation and work more on business logic.

Is that right?

My Question: Is there any serious performance issues with including both libraries? and how does YUI compare to jQuery UI?


Solution

  • UPDATE

    The YUI framework was deprecated in August 2014


    I'll leave it to the jquery pros to spell out the best comparison points, but I use YUI in projects both small and large. YUI is structured so that you only need include the modular functionality you need, down to the grainiest level, including the ability to roll your dependencies all back up into just the right package.

    YUI is fantastic for DOM manipulation, io, widgets, the works really. Go with YUI3, if you find YUI2 widgets you want/need, they have 'YUI2-in-3'.

    In addition, one (probably more) of YUI's core contributors, Dav Glass, has done some awesome work on getting YUI3 on the server - so you essentially have the same framework doing back end grunt work, and the same dependencies doing the front end magic.

    YUI's seed inclusion system is very easy to get started with too, sample code:

    <script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
    <script type="text/javascript">
        YUI().use(['node','io'], function (Y) {
            // node and io are ready now, do whatever you like. Need custom events, gesture support or animation? Add them to the array above.
        });
    </script>
    

    There's my case for YUI, have fun with it :)

    Also, I have included both jquery and YUI on a couple of projects... I didn't notice anything detrimental, but with more YUI experience, I haven't needed to do that again.