From yuri.leikind at gmail.com Mon Jul 19 04:27:37 2010 From: yuri.leikind at gmail.com (Yuri Leikind) Date: Mon, 19 Jul 2010 10:27:37 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? Message-ID: Hello developers, Which JS framework do your Rails 2.x apps use? -- Best regards, Yuri Leikind From stijn.pint at gmail.com Mon Jul 19 04:33:40 2010 From: stijn.pint at gmail.com (Stijn Pint) Date: Mon, 19 Jul 2010 10:33:40 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: jQuery ofcourse ! I never looked back :-) Stijn On Mon, Jul 19, 2010 at 10:27 AM, Yuri Leikind wrote: > Hello developers, > > Which JS framework do your Rails 2.x apps use? > > -- > Best regards, > Yuri Leikind > _______________________________________________ > Brug-talk mailing list > Brug-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/brug-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at 10-forward.be Mon Jul 19 04:41:23 2010 From: peter at 10-forward.be (Peter De Berdt (10-forward)) Date: Mon, 19 Jul 2010 10:41:23 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: On 19 Jul 2010, at 10:27, Yuri Leikind wrote: > Hello developers, > > Which JS framework do your Rails 2.x apps use? Whichever one you prefer and feel most comfortable with. Do know that if you plan on using the Rails javascript helpers (which you shouldn't imo, but that's just me), you're best sticking to Prototype and Scriptaculous. Yes, there is a jquery_on_rails plugin that will replace the default helpers, but as I already suggested: inline javascript is ugly. Best regards. Peter De Berdt From stijn at skylight.be Mon Jul 19 04:52:26 2010 From: stijn at skylight.be (Stijn Mathysen // Skylight) Date: Mon, 19 Jul 2010 10:52:26 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: <03B2C2CF-B8E5-4C7C-9408-725838E42206@skylight.be> definitely jQuery! On 19 Jul 2010, at 10:27, Yuri Leikind wrote: > Hello developers, > > Which JS framework do your Rails 2.x apps use? > > -- > Best regards, > Yuri Leikind > _______________________________________________ > Brug-talk mailing list > Brug-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/brug-talk From hans at verschooten.com Mon Jul 19 05:11:03 2010 From: hans at verschooten.com (Hans verschooten) Date: Mon, 19 Jul 2010 11:11:03 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: Legacy stuff uses Prototype, new apps go the jQuery way. Mobile apps - read webkit apps - use native JavaScript, no libraries. Hans On 19 Jul 2010, at 10:27, Yuri Leikind wrote: > Hello developers, > > Which JS framework do your Rails 2.x apps use? > > -- > Best regards, > Yuri Leikind > _______________________________________________ > Brug-talk mailing list > Brug-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/brug-talk From yuri.leikind at gmail.com Mon Jul 19 05:27:08 2010 From: yuri.leikind at gmail.com (Yuri Leikind) Date: Mon, 19 Jul 2010 11:27:08 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: 2010/7/19 Peter De Berdt (10-forward) : > > On 19 Jul 2010, at 10:27, Yuri Leikind wrote: > >> Hello developers, >> >> Which JS framework do your Rails 2.x apps use? > > Whichever one you prefer and feel most comfortable with. I am just curious what is fashionable nowadays :) > Do know that if you > plan on using the Rails javascript helpers (which you shouldn't imo, but > that's just me), you're best sticking to Prototype and Scriptaculous. IMHO jrails is a pretty good drop-in replacement. -- Best regards, Yuri Leikind From emmanuel.gilmont at gmail.com Mon Jul 19 06:00:12 2010 From: emmanuel.gilmont at gmail.com (Emmanuel Gilmont) Date: Mon, 19 Jul 2010 12:00:12 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: jQuery for me ;-) --------------------------------------------- Emmanuel Gilmont Owner of GATE25.be E-mail: emmanuel.gilmont at gmail.com Info: info at gate25.be Tel: +32 497 060 996 Web: http://www.gate25.be 2010/7/19 Yuri Leikind > 2010/7/19 Peter De Berdt (10-forward) : > > > > On 19 Jul 2010, at 10:27, Yuri Leikind wrote: > > > >> Hello developers, > >> > >> Which JS framework do your Rails 2.x apps use? > > > > Whichever one you prefer and feel most comfortable with. > > I am just curious what is fashionable nowadays :) > > > Do know that if you > > plan on using the Rails javascript helpers (which you shouldn't imo, but > > that's just me), you're best sticking to Prototype and Scriptaculous. > > IMHO jrails is a pretty good drop-in replacement. > > -- > Best regards, > Yuri Leikind > _______________________________________________ > Brug-talk mailing list > Brug-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/brug-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at 10-forward.be Mon Jul 19 06:58:44 2010 From: peter at 10-forward.be (Peter De Berdt (10-forward)) Date: Mon, 19 Jul 2010 12:58:44 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: On 19 Jul 2010, at 11:27, Yuri Leikind wrote: >>> Which JS framework do your Rails 2.x apps use? >> >> Whichever one you prefer and feel most comfortable with. > > I am just curious what is fashionable nowadays :) You should never make a decision on the basis of something being fashionable or being more widely used, otherwise you would be better off using PHP, .NET or Java for your serverside code. Choose the library that will make you the most productive, i.e. the one where the Javascript code feels most natural to you. We use both JQuery and Prototype, depending on the project. They both have their strengths and flaws. Prototype uses a very Ruby-esque syntax, JQuery is king when it comes to (plugin) community support + it has commercial backing. Event delegation in JQuery is very nicely implemented, and syntaxwise I feel that JQuery code looks a lot cleaner than Prototype's. Like most replies I would say JQuery will probably feel more right than Prototype these days. On the other hand, our Prototype code has never let us down either and there's some nice things brewing in scripty2. >> Do know that if you >> plan on using the Rails javascript helpers (which you shouldn't >> imo, but >> that's just me), you're best sticking to Prototype and Scriptaculous. > > IMHO jrails is a pretty good drop-in replacement. As I said, the current javascript helpers give me the shivers, whether they spit out Prototype code or JQuery code. Luckily the inline javascript is being replaced by an event delegated adapter in Rails 3, it's a step in the right direction. That still doesn't get rid of RJSitis though. I've had to look at projects that sent huge chunks of RJS-generated javascript code back on each AJAX request, which they bound to every single individual row of a > 200 record table. The behaviour could have easily been abstracted into a single Javascript prototype fetching a JSON representation of the data from the server. This has nothing to do with the library that's chosen, but since most of our apps are datadriven by nature, it just doesn't feel right to me to generate content-centric clientside code on the server, i.e. pushing HTML + Javascript to insert the content from the server to the client. What would be nice, is if you could just write a class in Ruby that would compile to a Javascript prototype, similar to what SASS, LESS and SCSS do for CSS. Wishful thinking, I know... I'm getting on a rant here, must be because I hit the inevitable wall with Rails' helpers years ago already. Performance, readability, debugging, it's a very slippery slope when you use link_to_remote and .rjs responses all over the place. Returning to my earlier example, it took me 15 minutes to add a small piece of Javascript to handle the row clicking and the request-response cycle was cut from about 15KB of data to less than 1KB per row, the size of the initial page load was cut in half. The performance gain was huge, the user experience changed from a slow web app to a snappy desktop like experience. There's a few people on this list that probably saw the demo of our flagship product thinx (which uses Prototype/Scriptaculous and NWEvents btw) on the last Arrrrcamp. That experience would simply be impossible using Rails' javascript helpers. Best regards. Peter De Berdt From yuri.leikind at gmail.com Mon Jul 19 07:36:52 2010 From: yuri.leikind at gmail.com (Yuri Leikind) Date: Mon, 19 Jul 2010 13:36:52 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: Take it easy, I was not asking for advi?e, I was only curious about the trends, as I said in plain English. Also you shouldn't have taken the word "fashionable" so seriously :) No need for such a rant. Though thanks for sharing your opinion, I do agree with you on many of your points. Peace. Yuri 2010/7/19 Peter De Berdt (10-forward) : > > On 19 Jul 2010, at 11:27, Yuri Leikind wrote: > >>>> Which JS framework do your Rails 2.x apps use? >>> >>> Whichever one you prefer and feel most comfortable with. >> >> I am just curious what is fashionable nowadays :) > > You should never make a decision on the basis of something being fashionable > or being more widely used, otherwise you would be better off using PHP, .NET > or Java for your serverside code. Choose the library that will make you the > most productive, i.e. the one where the Javascript code feels most natural > to you. > > We use both JQuery and Prototype, depending on the project. They both have > their strengths and flaws. Prototype uses a very Ruby-esque syntax, JQuery > is king when it comes to (plugin) community support + it has commercial > backing. > > Event delegation in JQuery is very nicely implemented, and syntaxwise I feel > that JQuery code looks a lot cleaner than Prototype's. Like most replies I > would say JQuery will probably feel more right than Prototype these days. On > the other hand, our Prototype code has never let us down either and there's > some nice things brewing in scripty2. > >>> Do know that if you >>> plan on using the Rails javascript helpers (which you shouldn't imo, but >>> that's just me), you're best sticking to Prototype and Scriptaculous. >> >> IMHO jrails is a pretty good drop-in replacement. > > As I said, the current javascript helpers give me the shivers, whether they > spit out Prototype code or JQuery code. Luckily the inline javascript is > being replaced by an event delegated adapter in Rails 3, it's a step in the > right direction. > > That still doesn't get rid of RJSitis though. I've had to look at projects > that sent huge chunks of RJS-generated javascript code back on each AJAX > request, which they bound to every single individual row of a > 200 record > table. The behaviour could have easily been abstracted into a single > Javascript prototype fetching a JSON representation of the data from the > server. > > This has nothing to do with the library that's chosen, but since most of our > apps are datadriven by nature, it just doesn't feel right to me to generate > content-centric clientside code on the server, i.e. pushing HTML + > Javascript to insert the content from the server to the client. > > What would be nice, is if you could just write a class in Ruby that would > compile to a Javascript prototype, similar to what SASS, LESS and SCSS do > for CSS. Wishful thinking, I know... > > I'm getting on a rant here, must be because I hit the inevitable wall with > Rails' helpers years ago already. Performance, readability, debugging, it's > a very slippery slope when you use link_to_remote and .rjs responses all > over the place. Returning to my earlier example, it took me 15 minutes to > add a small piece of Javascript to handle the row clicking and the > request-response cycle was cut from about 15KB of data to less than 1KB per > row, the size of the initial page load was cut in half. The performance gain > was huge, the user experience changed from a slow web app to a snappy > desktop like experience. > There's a few people on this list that probably saw the demo of our flagship > product thinx (which uses Prototype/Scriptaculous and NWEvents btw) on the > last Arrrrcamp. That experience would simply be impossible using Rails' > javascript helpers. > > Best regards. > > > Peter De Berdt > > > > _______________________________________________ > Brug-talk mailing list > Brug-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/brug-talk > -- Best regards, Yuri Leikind From brug at defv.be Mon Jul 19 04:31:14 2010 From: brug at defv.be (Jan De Poorter) Date: Mon, 19 Jul 2010 10:31:14 +0200 Subject: [Brug-talk] jQuery, Prototype, or something else? In-Reply-To: References: Message-ID: <448C95A3-F26C-44D9-ADF0-37239609B6A4@defv.be> Hey Yuri, I use jQuery in my Rails 2.x apps, together with jRails rgrds, Jan On 19 Jul 2010, at 10:27, Yuri Leikind wrote: > Hello developers, > > Which JS framework do your Rails 2.x apps use? > > -- > Best regards, > Yuri Leikind > _______________________________________________ > Brug-talk mailing list > Brug-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/brug-talk