Scott Becker
2006-Jun-03 21:09 UTC
[Rails] [ANN] MergeJS - Easily merge, compress, cache, and version your javascript!
After reading Cal Henderson''s article on Vitamin Serving Javascript Fast<http://synthesis.sbecker.net/articles/2006/06/03/www.thinkvitamin.com/features/webapps/serving-javascript-fast>I was immediately inspired to create a plugin to easily facilitate this in Ruby on Rails. I whipped up most of it right then, and finally got around to polishing it for release today. Told myself I wasn''t allowed to eat today until I finished. How''s that for inspiration? Here you go! MergeJS:http://synthesis.sbecker.net/pages/merge_js Thanks! -- Scott Becker Web Developer Electro Interactive, Inc. Office: 813-333-5508 http://www.ElectroInteractive.com Blog: http://synthesis.sbecker.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060603/706fcfa9/attachment.html
Roberto Saccon
2006-Jun-03 21:50 UTC
[Rails] [ANN] MergeJS - Easily merge, compress, cache, and version your javascript!
The page seems not to respond. Hope you are o.k. (with or without eating yet ..) On 6/3/06, Scott Becker <sbecker@electrointeractive.com> wrote:> > After reading Cal Henderson''s article on Vitamin Serving Javascript Fast<http://synthesis.sbecker.net/articles/2006/06/03/www.thinkvitamin.com/features/webapps/serving-javascript-fast>I was immediately inspired to create a plugin to easily facilitate this in > Ruby on Rails. I whipped up most of it right then, and finally got around to > polishing it for release today. > > Told myself I wasn''t allowed to eat today until I finished. How''s that for > inspiration? > > Here you go! > > MergeJS:http://synthesis.sbecker.net/pages/merge_js > > Thanks! > > -- > Scott Becker > Web Developer > Electro Interactive, Inc. > Office: 813-333-5508 > http://www.ElectroInteractive.com > Blog: http://synthesis.sbecker.net > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Roberto Saccon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060603/5fcb45d6/attachment.html
Scott Becker
2006-Jun-03 22:18 UTC
[Rails] [ANN] MergeJS - Easily merge, compress, cache, and version your javascript!
Welp, Dreamhost happened to come under a DoS attack right after I announced it: http://www.dreamhoststatus.com/2006/06/03/more-outages/ How awesome is that? It''s real, I swear! Just check back soon! :) And don''t worry about me. I ate. haha.. - Scott On 6/3/06, Roberto Saccon <rsaccon@gmail.com> wrote:> The page seems not to respond. Hope you are o.k. (with or without eating yet > ..) > > > On 6/3/06, Scott Becker < sbecker@electrointeractive.com> wrote: > > > > > > After reading Cal Henderson''s article on Vitamin Serving Javascript Fast I > was immediately inspired to create a plugin to easily facilitate this in > Ruby on Rails. I whipped up most of it right then, and finally got around to > polishing it for release today. > > Told myself I wasn''t allowed to eat today until I finished. How''s that for > inspiration? > > Here you go! > > MergeJS:http://synthesis.sbecker.net/pages/merge_js > > > Thanks! > > -- > Scott Becker > Web Developer > Electro Interactive, Inc. > Office: 813-333-5508 > http://www.ElectroInteractive.com > Blog: http://synthesis.sbecker.net > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > Roberto Saccon > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Scott Becker Web Developer Electro Interactive, Inc. Office: 813-333-5508 http://www.ElectroInteractive.com
Alex Wayne
2006-Jun-04 07:56 UTC
[Rails] Re: [ANN] MergeJS - Easily merge, compress, cache, and versi
Scott Becker wrote:> Welp, Dreamhost happened to come under a DoS attack right after I > announced it: http://www.dreamhoststatus.com/2006/06/03/more-outages/ > > How awesome is that? It''s real, I swear! Just check back soon! :) > > And don''t worry about me. I ate. haha.. > > - Scott > > On 6/3/06, Roberto Saccon <rsaccon@gmail.com> wrote: >> was immediately inspired to create a plugin to easily facilitate this in >>Not bad. This plugin definately shows promise but a few things would need improving before I wouls stick it in my app. I think you should be able to define the js file names as symbols, rather than strings. When I tried to use symbols the <script> tag was not even output to the header. I would add: sources.collect!(&:to_s) to the top of your helper method. Also you should be able to say <%= javascript_include_merged :defaults %> just like you can say <%= javascript_include_tag :defaults %> Lastly, I don''t like that you have to manually generate the resulting js file. I think it should compile it on the fly and then cache it somehow, like action cacheing. I can easily see forgetting to run the rake task and then beating my head against the desk because the new javascript works in development but not production. -- Posted via http://www.ruby-forum.com/.
Scott Becker
2006-Jun-04 17:16 UTC
[Rails] Re: [ANN] MergeJS - Easily merge, compress, cache, and versi
I like the idea of allowing the use of symbols and using :defaults for the rails default js files. I will be adding those soon! :) The idea of the rake task is to process this only once, at the time of deployment. If you add it to your capistrano deployment script, thats the last time you''ll ever have to think about it. This is the best way for performance. Having dealt with SLOW shared hosting environments, I''m pretty adverse to adding any unnecessary processing that has to happen on each request. -- Scott Becker Web Developer Electro Interactive, Inc. http://www.ElectroInteractive.com On 6/4/06, Alex Wayne <rubyonrails@beautifulpixel.com> wrote:> Scott Becker wrote: > > Welp, Dreamhost happened to come under a DoS attack right after I > > announced it: http://www.dreamhoststatus.com/2006/06/03/more-outages/ > > > > How awesome is that? It''s real, I swear! Just check back soon! :) > > > > And don''t worry about me. I ate. haha.. > > > > - Scott > > > > On 6/3/06, Roberto Saccon <rsaccon@gmail.com> wrote: > >> was immediately inspired to create a plugin to easily facilitate this in > >> > > Not bad. This plugin definately shows promise but a few things would > need improving before I wouls stick it in my app. > > I think you should be able to define the js file names as symbols, > rather than strings. When I tried to use symbols the <script> tag was > not even output to the header. I would add: > > sources.collect!(&:to_s) > > to the top of your helper method. > > Also you should be able to say > > <%= javascript_include_merged :defaults %> > > just like you can say > > <%= javascript_include_tag :defaults %> > > Lastly, I don''t like that you have to manually generate the resulting js > file. I think it should compile it on the fly and then cache it > somehow, like action cacheing. I can easily see forgetting to run the > rake task and then beating my head against the desk because the new > javascript works in development but not production. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Scott Becker
2006-Jun-05 07:13 UTC
[Rails] Re: [ANN] MergeJS - Easily merge, compress, cache, and versi
Symbols and :defaults are now supported, along with a bunch of other little enhancements. http://synthesis.sbecker.net/pages/merge_js Thanks! -- Scott Becker Web Developer Electro Interactive, Inc. http://www.ElectroInteractive.com On 6/4/06, Scott Becker <sbecker@electrointeractive.com> wrote:> I like the idea of allowing the use of symbols and using :defaults for > the rails default js files. I will be adding those soon! :) > > The idea of the rake task is to process this only once, at the time of > deployment. If you add it to your capistrano deployment script, thats > the last time you''ll ever have to think about it. This is the best way > for performance. Having dealt with SLOW shared hosting environments, > I''m pretty adverse to adding any unnecessary processing that has to > happen on each request. > > -- > Scott Becker > Web Developer > Electro Interactive, Inc. > http://www.ElectroInteractive.com > > > On 6/4/06, Alex Wayne <rubyonrails@beautifulpixel.com> wrote: > > Scott Becker wrote: > > > Welp, Dreamhost happened to come under a DoS attack right after I > > > announced it: http://www.dreamhoststatus.com/2006/06/03/more-outages/ > > > > > > How awesome is that? It''s real, I swear! Just check back soon! :) > > > > > > And don''t worry about me. I ate. haha.. > > > > > > - Scott > > > > > > On 6/3/06, Roberto Saccon <rsaccon@gmail.com> wrote: > > >> was immediately inspired to create a plugin to easily facilitate this in > > >> > > > > Not bad. This plugin definately shows promise but a few things would > > need improving before I wouls stick it in my app. > > > > I think you should be able to define the js file names as symbols, > > rather than strings. When I tried to use symbols the <script> tag was > > not even output to the header. I would add: > > > > sources.collect!(&:to_s) > > > > to the top of your helper method. > > > > Also you should be able to say > > > > <%= javascript_include_merged :defaults %> > > > > just like you can say > > > > <%= javascript_include_tag :defaults %> > > > > Lastly, I don''t like that you have to manually generate the resulting js > > file. I think it should compile it on the fly and then cache it > > somehow, like action cacheing. I can easily see forgetting to run the > > rake task and then beating my head against the desk because the new > > javascript works in development but not production. > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Julian ''Julik'' Tarkhanov
2006-Jun-05 18:08 UTC
[Rails] Re: [ANN] MergeJS - Easily merge, compress, cache, and versi
On 4-jun-2006, at 19:16, Scott Becker wrote:> I like the idea of allowing the use of symbols and using :defaults for > the rails default js files. I will be adding those soon! :) > > The idea of the rake task is to process this only once, at the time of > deployment. If you add it to your capistrano deployment script, thats > the last time you''ll ever have to think about it. This is the best way > for performance. Having dealt with SLOW shared hosting environments, > I''m pretty adverse to adding any unnecessary processing that has to > happen on each request.Put the JS rebuild into the environment.rb, it will be run when the app is starting. After getting going with Rails I tend to look with great suspicion at all the "build, rebuild, recompile and remerge and then archive and compact and THEN it will run" type operations. -- Julian ''Julik'' Tarkhanov please send all personal mail to me at julik.nl
Scott Becker
2006-Jun-05 20:21 UTC
[Rails] Re: [ANN] MergeJS - Easily merge, compress, cache, and versi
Well, having dealt with Dreamhost (el slowio), the biggest performance hit is on the first request - and they kill off your .fcgi processes fairly often, so you have to endure that yet again. I personally hate it when plugins tack on more stuff to the startup process. The more javascript files you have to compress, the longer your startup will become. BUT, I guess I''ll see about adding this option for those that want it. Using Capistrano makes the rake task option a peice of cake, so thats what I prefer. -- Scott Becker Web Developer Electro Interactive, Inc. http://www.ElectroInteractive.com On 6/5/06, Julian ''Julik'' Tarkhanov <listbox@julik.nl> wrote:> > On 4-jun-2006, at 19:16, Scott Becker wrote: > > > I like the idea of allowing the use of symbols and using :defaults for > > the rails default js files. I will be adding those soon! :) > > > > The idea of the rake task is to process this only once, at the time of > > deployment. If you add it to your capistrano deployment script, thats > > the last time you''ll ever have to think about it. This is the best way > > for performance. Having dealt with SLOW shared hosting environments, > > I''m pretty adverse to adding any unnecessary processing that has to > > happen on each request. > > Put the JS rebuild into the environment.rb, it will be run when the > app is starting. After getting going with Rails I tend to look with > great suspicion at all the "build, rebuild, recompile and remerge and > then archive and compact and THEN it will run" type operations. > > -- > Julian ''Julik'' Tarkhanov > please send all personal mail to > me at julik.nl > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Scott Fortmann-Roe
2006-Jun-06 10:42 UTC
[Rails] Re: [ANN] MergeJS - Easily merge, compress, cache, and versi
Could this be done for CSS files too. Maybe have the plugin do both. On 6/5/06, Scott Becker <sbecker@electrointeractive.com> wrote:> Well, having dealt with Dreamhost (el slowio), the biggest performance > hit is on the first request - and they kill off your .fcgi processes > fairly often, so you have to endure that yet again. I personally hate > it when plugins tack on more stuff to the startup process. The more > javascript files you have to compress, the longer your startup will > become. BUT, I guess I''ll see about adding this option for those that > want it. Using Capistrano makes the rake task option a peice of cake, > so thats what I prefer. > > -- > Scott Becker > Web Developer > Electro Interactive, Inc. > http://www.ElectroInteractive.com > > On 6/5/06, Julian ''Julik'' Tarkhanov <listbox@julik.nl> wrote: > > > > On 4-jun-2006, at 19:16, Scott Becker wrote: > > > > > I like the idea of allowing the use of symbols and using :defaults for > > > the rails default js files. I will be adding those soon! :) > > > > > > The idea of the rake task is to process this only once, at the time of > > > deployment. If you add it to your capistrano deployment script, thats > > > the last time you''ll ever have to think about it. This is the best way > > > for performance. Having dealt with SLOW shared hosting environments, > > > I''m pretty adverse to adding any unnecessary processing that has to > > > happen on each request. > > > > Put the JS rebuild into the environment.rb, it will be run when the > > app is starting. After getting going with Rails I tend to look with > > great suspicion at all the "build, rebuild, recompile and remerge and > > then archive and compact and THEN it will run" type operations. > > > > -- > > Julian ''Julik'' Tarkhanov > > please send all personal mail to > > me at julik.nl > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Easily help charity when you shop: www.GiveTeam.org I''m a member of the Give Team, are you?
Scott Becker
2006-Jun-07 08:46 UTC
[Rails] Re: Re: [ANN] MergeJS - Easily merge, compress, cache, and v
Scott Fortmann-Roe wrote:> Could this be done for CSS files too. Maybe have the plugin do both.Yep, in the Plan. :) -- Scott Becker Web Developer Electro Interactive, Inc. http://www.ElectroInteractive.com -- Posted via http://www.ruby-forum.com/.