Yahoo UI Library (YUI) - Anyone using with Rails??? Comparision with prototype/scriptaculous (YUI seems to be getting quite popular)

Hi,

The Yahoo UI library (YUI) seems to be getting popular. A few questions if anyone has any knowledge/experience:

Q1 - Would YUI complement a rails development? Or does it compete directly with prototype/scriptaculous?

Q2 - From the point of view of rich client web interfaces would you recommend looking into YUI, or just stick with rails/prototype/scriptaculous?

Tks

Q2 - From the point of view of rich client web interfaces would you recommend looking into YUI, or just stick with rails/prototype/scriptaculous?

No experience with YUI, but if the slow clunky, "new" yahoo mail is using this library, then I wouldn't bother with it. The performance is not good.

Indeed, YUI is very slow compared to the other JavaScript libs out there. On my old PowerBook (our newer intel macs show good performance with all libs) JQuery is probably the one with the smoothest animations (using the Interface plugin). On top op that, JQuery has a really nice syntax and small footprint.

Best regards

Peter De Berdt

Hi,

The Yahoo UI library (YUI) seems to be getting popular. A few questions if anyone has any knowledge/experience:

Q1 - Would YUI complement a rails development? Or does it compete directly with prototype/scriptaculous?

It competes directly. Both libraries have Ajax components, Dom helpers to find by classname, drag and drop. All the normal things. YUI has good documentation and better JavaScript coding practices than prototype/scriptaculous.

Q2 - From the point of view of rich client web interfaces would you recommend looking into YUI, or just stick with rails/prototype/scriptaculous?

I was disappointed enough with Prototype/Scriptaculous and I like the Yahoo! UI enough that I have started a fork of the YUI to use with Rails. My fork has forked quite a bit from YUI to make what I think are some improvements but the main ideas of YUI guide many parts of my fork. I have added the pieces needed to do all the nice Rails Ajax stuff like RJS (though I think the ejs templates are better idea see <URL: http://www.danwebb.net/2006/11/24/minusmor-released&gt;\). The first official release of Fork JavaScirpt is only a couple weeks off.

<URL: http://forkjavascript.org>

Peter

I've been using the Y! grids CSS which is kinda part of the YUI package. I'd recommend it as it makes it nice and easy to come up with a layout that fits whatever needs you have. You simply use their classes and structure your page containers properly and the heavy lifting is done for you in terms of laying out major components in your pages. This part of YUI does not compete with anything in rails and is very complimentary.

-Michael http://javathehutt.blogspot.com

Any idea when there will be a jquery implementation of the rails js helpers available? I came from a jquery environment, so I don’t really want to learn to work with prototype and scriptaculous if possible.

Michael - does it help out at all in terms of use of customized image based (created in photoshop) buttons - i.e. where one has to manually slice up the button image into pieces and then in the HTML have multiple DIVs around the text to hook the button images pieces onto? ( i.e. gives web 2.0’ish type button but with the flexibility of the text itself not being part of the image)

As someone who tries very hard to follow web standards and separate style from content [kinda like DRY for design. kinda] I’ve found jQuery to be a godsend. No more of that clunky, ugly embedded JavaScript inside your HTML. It might be easy to use those javascript helpers in Rails but it doesn’t make for optimally DRY pages when each link restates the same code over and over. Then again, we’re all big boy [and girl] coders and are writing our own code instead of relying on scaffolds and predefined helpers, right?

RSL

You know that the javascript library used has nothing to do with how unobtrusive your code is, right? You can write unobtrusive, accessible js in Prototype, Dojo, or Jquery.

re: the builtin in helpers in Rails, use this instead: http://www.ujs4rails.com/

Agreed on the unobtrusive code with Prototype, et al. I didn’t mean to make it sound like those libraries always generate clunky code. It’s just that the close relationship between Rails’ javascript helpers [in-code Javascript] and Prototype usually lead to a lot of onclick=“whatever” nonsense that, for me, is best handled with jQuery’s js file approach. YMMV

RSL

Hello,

I work on the YUI team at Yahoo!, and have included my thoughts below in the hopes that it might help your investigation.

Q1 - Would YUI complement a rails development? Or does it compete directly with prototype/scriptaculous?

YUI has some functional overlap with p/s, but can exist on the same page because it's namespaced like all responsible page citizens should be. (Locally recreating "$" is trivial, of course.)

Q2 - From the point of view of rich client web interfaces would you recommend looking into YUI, or just stick with rails/prototype/scriptaculous?

+ YUI provides extensive documentation in many formats: complete API documentation, extensive examples and tutorials, handy full-color cheatsheets, and interaction matrices (for dragdrop and autocomplete)

+ YUI offers the exact lines of code powering scores of high-scale yahoo products globally, and has a dedicated fulltime engineering team.

+ YUI benefits from Yahoo!'s teams of interaction designers, usability experts, and user experience researchers.

+ YUI includes extensive Accessibility, Internationalization, and Localization support.

+ YUI supports a wide range of browsers and OSs under our Graded Browser Support philosophy: http://developer.yahoo.com/yui/articles/gbs/gbs.html

+ YUI takes a lightweight a la carte approach, and ships with three versions of each file, normal (commented for human readability), -min (for production environments) and -debug (which can pipe info to Firebug or YUI's Logger control.)

+ As mentioned, YUI's namespacing protects your code and facilitates collaboration and mashups.

It's true that I am biased, but I think it is worth your time to take a look and see for yourself. I hope the information above provides a useful starting point for your consideration.

Thanks, Nate

Nate Koechley natek@yahoo-inc.com YUI Team, Yahoo! Inc.

Nate, (thanks for posting)

Any plans for a Ruby on Rails wrapper around YUI? (i.e. along the lines that Rails has assisted with prototype/scriptaculous?)