I'd set up each class or major structure, such as Element, Enumerable, etc etc as its own file, then define packages such as minimal, efficient, advanced, ajax...etc. Then in a server side script it will bundle these files together depending on the package so you could make a request something like prototype-package.php?package=advanced and it will pull only files that you have set up as the "advanced" package.
I find that lazy loading either leads to lost dependencies or in most cases leads to more overhead than if you had just loaded it all in one request. When using the packaging server side script you can also use tactics of minify and gzipping to reduce the payload. -- http://positionabsolute.net On Apr 29, 12:46 pm, Bertrand <[email protected]> wrote: > Hi, > > My code makes use of Element's update method. It handles modification > of an element's contents gracefully and isn't as risky as innerHTML. > > My problem is that I don't know how to extract it from the code (I > wish I could link to Google's Prototype, but I work in an environment > where filesize is critical). > The issue at hand is that the method makes use of other bits (bind, > defer, stripScripts, $A, etc.) from the library that would in turn > pull other bits and so forth. > > My question is : Is there a way to smartly cherry-pick the bits I need > from the source code without breaking anything. My previous attempts > at doing just that were utter failures and reverting back to innerHTML > is ground for disaster as well. > > Any help appreciated. > > Thanks, > > Bertrand. > > PS: A solution would be to have some sort of preprocessor directives > like > > //@dependsOn: defer, bind, $A... for each method so that a script > could create custom builds of the library that would fit the user's > needs perfectly (one could even imagine a web interface where the user > would indicate the functions he wants to use, hit "generate" to obtain > a custom version of Prototype). > > Sprockets seems to be a step in that direction but it's not fine- > grained enough in my opinion. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
