jQuery and Rails (and getting rid of prototype)

My first ajax-y attempts were done with prototype. It all seemed so natural and seamless: prototype came with rails and there were those nice javascript helpers like link_to_remote which generated the javascript code for calling prototype functions. Until you looked at the code! (and the weight of it). I'm not talking about the ruby code but the output HTML, which is heavy and plagued with very obtrusive javascript.

Since I'm a concerned person, I decided to ditch Prototype and its Scriptaculousy effects and use jQuery instead. And I thought: since jQuery is so cool, I'm pretty sure that somebody will have done a replacement for the default javascript helpers (based in Prototype). But I was wrong. Not completely wrong, but quite a bit.

There's some work done in this area; a guy whose page is titled Katz got your tongue? is working hard in getting a jQuery On Rails plug-in up and running. Incidentally it seems he's also a jQuery developer so that's very good too. But since the plug-in is not finished yet, I kept looking for less obstrusive alternatives. I remembered about the unobtrusive plug-in that Luke Redpath & Dan Webb talked about in a LRUG meeting, UJS, and although it looked really cool, I realized am not sure if that's what I want.

Right now, it looks easier to simply write the HTML and add some JS (not in the html itself) which behaviourizes the elements, using jQuery for this, rather than using UJS's apply_behaviour. Specially because at the end, UJS is still using Prototype, and it is very slow compared with jQuery.

In my tests, which are so unscientific that I don't have any result indicator more than my own subjective speed perception, effects made with Prototype+Scriptaculous ended with what I call the 1fps syndrome: the screen gets updated only 1 time per second, so you forget about concepts like smoothness, transitions, easing and all that quite quickly. Way more quickly than it takes the effect to execute, actually; when it finishes you have almost forgotten what you wanted to do. Meanwhile, jQuery kept always a decent framerate and didn't feel like overloading the processor. And this happens in all types of machines.

So I think I'm going for jQuery, doing things in the style of this guy over here, and will keep an eye in jQuery for Rails development.