Hi guys, I was thinking - wouldn''t it be great to have modules for prototype, to load separately? Like we have with scriptaculous - src="scriptaculous.js?load=effects,dragdrop". And that would make it more lightweight. Do you think a considerable advantage could be achieved in this way? Just wondering... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Chabot
2008-Feb-06 18:05 UTC
Re: could protorype load like scriptaculous? with modules
more http requests = bad! http://developer.yahoo.com/performance/rules.html#num_http On Wed, 2008-02-06 at 09:54 -0800, alex wrote:> Hi guys, > I was thinking - wouldn''t it be great to have modules for prototype, > to load separately? Like we have with scriptaculous - > src="scriptaculous.js?load=effects,dragdrop". And that would make it > more lightweight. > > Do you think a considerable advantage could be achieved in this way? > Just wondering... >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
aham, good point On Feb 6, 8:05 pm, Chris Chabot <chab...-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org> wrote:> more http requests = bad! > > http://developer.yahoo.com/performance/rules.html#num_http > > On Wed, 2008-02-06 at 09:54 -0800, alex wrote: > > Hi guys, > > I was thinking - wouldn''t it be great to have modules for prototype, > > to load separately? Like we have with scriptaculous - > > src="scriptaculous.js?load=effects,dragdrop". And that would make it > > more lightweight. > > > Do you think a considerable advantage could be achieved in this way? > > Just wondering...--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Obviously more requests are bad. But the bigger issue is having a fleshed out dependency tree for all the objects in the library. That way if all we need is Element we can easily clip out the Ajax functionality without having to deal with "object is null". Something in line with what ExtJS has: http://extjs.com/download/build I''m starting work on a mobile development platform and I''d love to use portions of Prototype. There''s no way I can include the whole thing. No to scriptaculous''s loading system. Yes to a custom Prototype build. Is there something like that floating around? On Feb 6, 1:05 pm, Chris Chabot <chab...-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org> wrote:> more http requests = bad! > > http://developer.yahoo.com/performance/rules.html#num_http > > On Wed, 2008-02-06 at 09:54 -0800, alex wrote: > > Hi guys, > > I was thinking - wouldn''t it be great to have modules for prototype, > > to load separately? Like we have with scriptaculous - > > src="scriptaculous.js?load=effects,dragdrop". And that would make it > > more lightweight. > > > Do you think a considerable advantage could be achieved in this way? > > Just wondering...--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 6, 5:28 pm, Shakakai <cull...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m starting work on a mobile development platform and I''d love to use > portions of Prototype. There''s no way I can include the whole thing. > > No to scriptaculous''s loading system. > Yes to a custom Prototype build. > > Is there something like that floating around?You could check out the source (http://svn.rubyonrails.org/rails/ spinoffs/prototype/trunk) and edit src/prototype.js. It uses an erb- like syntax to load the the other modules in src (ajax, array, form, event, etc.) Remove the ones you don''t need, run "rake dist" from the root, run the tests in test/unit and test/functional, make sure everything you need works, and what you''ve got in dist/prototype.js is a scaled down version. You could edit the individual modules to get more granular, but it might get you closer. Nathan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Good call. That''s a looks like a really simple solution. Todd On Feb 6, 9:04 pm, nlloyds <nllo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Feb 6, 5:28 pm, Shakakai <cull...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m starting work on a mobile development platform and I''d love to use > > portions of Prototype. There''s no way I can include the whole thing. > > > No to scriptaculous''s loading system. > > Yes to a custom Prototype build. > > > Is there something like that floating around? > > You could check out the source (http://svn.rubyonrails.org/rails/ > spinoffs/prototype/trunk) and edit src/prototype.js. It uses an erb- > like syntax to load the the other modules in src (ajax, array, form, > event, etc.) Remove the ones you don''t need, run "rake dist" from the > root, run the tests in test/unit and test/functional, make sure > everything you need works, and what you''ve got in dist/prototype.js is > a scaled down version. > > You could edit the individual modules to get more granular, but it > might get you closer. > > Nathan--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Shakakai, Please tell us how effective the methods that you give a try are - like how much overweight in KB you got rid of.. Thanks On Feb 7, 4:52 am, Shakakai <cull...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Good call. That''s a looks like a really simple solution. > > Todd > > On Feb 6, 9:04 pm, nlloyds <nllo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Feb 6, 5:28 pm, Shakakai <cull...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''m starting work on a mobile development platform and I''d love to use > > > portions of Prototype. There''s no way I can include the whole thing. > > > > No to scriptaculous''s loading system. > > > Yes to a custom Prototype build. > > > > Is there something like that floating around? > > > You could check out the source (http://svn.rubyonrails.org/rails/ > > spinoffs/prototype/trunk) and edit src/prototype.js. It uses an erb- > > like syntax to load the the other modules in src (ajax, array, form, > > event, etc.) Remove the ones you don''t need, run "rake dist" from the > > root, run the tests in test/unit and test/functional, make sure > > everything you need works, and what you''ve got in dist/prototype.js is > > a scaled down version. > > > You could edit the individual modules to get more granular, but it > > might get you closer. > > > Nathan--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Nathan Nobbe
2008-Feb-10 17:49 UTC
Re: could protorype load like scriptaculous? with modules
has anyone checked out open rico <http://openrico.org/>? its built on prototype and it has a module loading mechanism different than scriptaculous. so what you do on a given page is load rico.js, then you have access to the module loader, which is used simply, by Rico.loadModule(''moduleName''); which you can pass multiple parameters or call multiple times. then there is a sister method, Rico.onLoad(), which will fire once all the modules loaded by loadModule are available in the dom. it also has a list of module dependencies akin to what Shakakai was talking about (abbreviated here) moduleDependencies : { Accordion : [''ricoBehaviors.js'',''ricoEffects.js'',''ricoComponents.js''], Color : [''ricoColor.js''], Corner : [''ricoStyles.js''], DragAndDrop: [''ricoDragDrop.js''], one reason i like it is you can load w/e you like on the initial page; then later on, if you need some additional functionality, you can just call Rico.loadModule() again. it doesnt play nice w/ scriptaculous tho :( i have to end up loading some files directly by using <script> tags sent by the server when using them in tandem. -nathan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---