[Proto-Scripty] Re: Include scripts
Hi, Your best bet for something like that is to have a build process that combines the scripts (and then minifies them), and then include the resulting single script with just one script tag. Reading lots of individual script files will be quite slow, because browsers typically will load only one or two at a time, and it takes very perceptible time to individually retrieve even three or four scripts in addition to the other resources on the page. Latency kills. I don't currently have a good recommendation of a build tool to use for this, but if it's just combining files and then running them through jsmin or something similar, any of the usual suspects (rake, ant, etc.) should be able to manage it. Google's just released their Closure Compiler, which handles doing this (including dependency management, although it's a bit of a pain to configure dependencies at present based on comments in the discussion group) as well as handling removing unused code and various other optimisations. It's still very new: http://code.google.com/closure/compiler/ HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Dec 9, 11:15 am, Frédéric f...@gbiloba.org wrote: Hi, I'm looking for a import script code example, to be able to include parent class code (I write only 1 class per file). Is there something already available? Thanks, -- Frédéric -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Include scripts
Hi again, But answering the actual question you asked: http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically -- T.J. ;-) On Dec 9, 11:25 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Your best bet for something like that is to have a build process that combines the scripts (and then minifies them), and then include the resulting single script with just one script tag. Reading lots of individual script files will be quite slow, because browsers typically will load only one or two at a time, and it takes very perceptible time to individually retrieve even three or four scripts in addition to the other resources on the page. Latency kills. I don't currently have a good recommendation of a build tool to use for this, but if it's just combining files and then running them through jsmin or something similar, any of the usual suspects (rake, ant, etc.) should be able to manage it. Google's just released their Closure Compiler, which handles doing this (including dependency management, although it's a bit of a pain to configure dependencies at present based on comments in the discussion group) as well as handling removing unused code and various other optimisations. It's still very new:http://code.google.com/closure/compiler/ HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 9, 11:15 am, Frédéric f...@gbiloba.org wrote: Hi, I'm looking for a import script code example, to be able to include parent class code (I write only 1 class per file). Is there something already available? Thanks, -- Frédéric -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Include scripts
Le mercredi 9 décembre 2009 11:25, T.J. Crowder a écrit : Your best bet for something like that is to have a build process that combines the scripts (and then minifies them), and then include the resulting single script with just one script tag. Reading lots of individual script files will be quite slow, because browsers typically will load only one or two at a time, and it takes very perceptible time to individually retrieve even three or four scripts in addition to the other resources on the page. Latency kills. I see. I don't currently have a good recommendation of a build tool to use for this, but if it's just combining files and then running them through jsmin or something similar, any of the usual suspects (rake, ant, etc.) should be able to manage it. I'm not looking for a minimizer, but only to solve dependencies... I guess it needs to introduce a specific tag in the code, like the Google Closure Compiler does. For example: // @include another_script.js Maybe this as already been discussed here? Did anyone already write such tool? Google's just released their Closure Compiler, which handles doing this (including dependency management, although it's a bit of a pain to configure dependencies at present based on comments in the discussion group) as well as handling removing unused code and various other optimisations. It's still very new: http://code.google.com/closure/compiler Well, dependencies is the only thing I'm looking for :o/ If it does not yet exist, I will try to write my own tool (in python, as I'm familiar with this language). Thanks for your help. -- Frédéric -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Include scripts
Something I came across in my Twitter feed... LABjs On Wed, Dec 9, 2009 at 6:54 AM, Frédéric f...@gbiloba.org wrote: Le mercredi 9 décembre 2009 11:25, T.J. Crowder a écrit : Your best bet for something like that is to have a build process that combines the scripts (and then minifies them), and then include the resulting single script with just one script tag. Reading lots of individual script files will be quite slow, because browsers typically will load only one or two at a time, and it takes very perceptible time to individually retrieve even three or four scripts in addition to the other resources on the page. Latency kills. I see. I don't currently have a good recommendation of a build tool to use for this, but if it's just combining files and then running them through jsmin or something similar, any of the usual suspects (rake, ant, etc.) should be able to manage it. I'm not looking for a minimizer, but only to solve dependencies... I guess it needs to introduce a specific tag in the code, like the Google Closure Compiler does. For example: // @include another_script.js Maybe this as already been discussed here? Did anyone already write such tool? Google's just released their Closure Compiler, which handles doing this (including dependency management, although it's a bit of a pain to configure dependencies at present based on comments in the discussion group) as well as handling removing unused code and various other optimisations. It's still very new: http://code.google.com/closure/compiler Well, dependencies is the only thing I'm looking for :o/ If it does not yet exist, I will try to write my own tool (in python, as I'm familiar with this language). Thanks for your help. -- Frédéric -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Include scripts
Prototype's using Sprockets[1] for this. You might want to give it a spin. Best, Tobie [1] http://getsprockets.org/ -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Include scripts
On mercredi 09 décembre 2009, Tobie Langel wrote: Prototype's using Sprockets[1] for this. You might want to give it a spin. That's exactly what I was looking for! Simple and powerfull... Thanks :o) -- Frédéric -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.