Well how about generating only browser specific merge modules? dynapi.js merge.ie.js merge.dom.js merge.opera.js merge.ns4.js
in the browser we could then do the following: <script src="../src/dynapi.js"></script> <script> if(dynapi.ua.ie) { dynapi.setPath('../src/','merge.ie.js'); }else if(dynapi.ua.opera) { dynapi.setPath('../src/','merge.opera.js'); }else if(dynapi.ua.ns4) { dynapi.setPath('../src/','merge.ns4.js'); }else if(dynapi.ua.supported) { dynapi.setPath('../src/','merge.dom.js'); }else{ alert('Browser not supported'); } </script> The dynapi.js file would be compressed and stored as dynapi.js. The other browser specific (and non-specific) libraries could then be merged into a single file. Only two files will be needed (dynapi.js and merge.{whatever}.js) The setPath() function will support a second argument called pkgfile (Package file). This will be used to allow users to load in an alternative package.js file -- Raymond Irving --- Jesse Vitrone <[EMAIL PROTECTED]> wrote: --------------------------------- Thanks for the suggestions Kevin and Raymond, It looks like I can make my xml something like this: <input-group> <input-filename="D:/development/6thgear/dynapi/src/api/mouse_ie.js"compare-value="dynapi.ua.ie" /> <input-filename="D:/development/6thgear/dynapi/src/api/mouse_dom.js"/> </input-group> and have my code generate the js: if (dynapi.ua.ie) { // mouse_ie.js compressed code goes here } else { // mouse_dom.js compressed code goes here } I'll take the first of the group, and make the if. Everything up to the last will be an else if And the last, makes the else. All input-files inside an input-group need a compare-value, except forthe last one. This looks like it should work. When I hand code my compressed file tolook like the above, it works. It's more code then would normally beneeded, since both files are going to get included, but I can't thinkof any other way around this problem. Plus, only the one needed willhave to get parsed, so it shouldn't be too bad. What do you think? Do you see any problems that I might run intotrying to do it this way/ Also, since I have to redo the way the xml is parsed, I'm going to usethe built in xml parsing that java has and lose that dom4j.jardependency. Not as pretty, but it gets the job done. Thanks for the help. Jesse Kevin wrote: Sorry, didn't send to the list!----- Original Message ----- From: "Kevin" <[EMAIL PROTECTED]>To: "Jesse Vitrone" <[EMAIL PROTECTED]>Sent: Tuesday, June 10, 2003 4:22 AMSubject: Re: [Dynapi-Dev] compressing files I mean the packages.js file can help with the dependency logic for your xml config file.Though I don't know how to get around the (dom/opera/ns4/ie layer)*(mouse) file split.The other inline compressor method would work here - though server load impact andno cache of the transient stream :( what! I wish I could explain better ).As for this method once a developer has a custom pre-processed and compressed fileset published on the server there is no need for the library. Difficult to choose. ThoughI like one bundle per (virtual) server with little load.-Kevin----- Original Message ----- From: Jesse VitroneTo: KevinCc: Dynapi-DevSent: Sunday, June 08, 2003 7:19 PMSubject: Re: [Dynapi-Dev] compressing filesKevin, I'm not sure what you mean about remove the existing library system from the api. With the xml config that I you can customize, you just pick and choose what JS files you want it to compress and merge. So, I have the basic DynAPI ones, plus the others that I use, plus my own. It lookssomething like this:<jscompressor> <compressed-file name="D:/development/6thgear/js/6thgear_compressed.js"> <input-file name="D:/development/6thgear/dynapi/src/dynapi.js"/> <input-file name="D:/development/6thgear/dynapi/src/api/event.js"/> <input-file name="D:/development/6thgear/dynapi/src/api/dyndocument.js"/> <input-file name="D:/development/6thgear/dynapi/src/api/dynlayer_base.js"/> <input-file name="D:/development/6thgear/dynapi/src/api/dynlayer_dom.js"/> <input-file name="D:/development/6thgear/dynapi/src/api/mouse_dom.js"/> <input-file name="D:/development/6thgear/dynapi/src/api/ext/dynlayer.inline.js"/> <input-file name="D:/development/6thgear/js/6thgear.js"/> <input-file name="D:/development/6thgear/js/gearWindow.js"/> <input-file name="D:/development/6thgear/js/templates.js"/> </compressed-file> <compressed-file name="D:/development/6thgear/js/6thgear_edit_compressed.js"> <input-file name="D:/development/6thgear/dynapi/src/api/ext/dragevent.js"/> <input-file name="D:/development/6thgear/js/6thgear_edit.js"/> <input-file name="D:/development/6thgear/js/gearWindow_edit.js"/> <input-file name="D:/development/6thgear/js/templates_edit.js"/> </compressed-file></jscompressor>This generates 2 files, 6thgear_compress.js and 6thgear_edit_compressed. Then, my files only needto include these, and no other DynAPI files.Is this what you mean by removing the library system? Since I don't have to include the library.js or use it in my code?JesseKevin wrote:Hi Jesse,I think two compression methods can live well together.Yours will serve a static compressed bundle with littleserver load. It would be nice of this method couldremove the existing library system from the api. Thenthe compressor would reuse the removed code logic (towork out dependencies) as a front end so the developercan decide what compressed bundle is needed to servehosted application types. Is this is a standaloneapplication requiring an interpreter not an applet.-Kevin."Raymond Irving" <[EMAIL PROTECTED]> wrote:Hi Jesse,As Leif said, SourceForge only allow developers touses SSH inorder to write to CVS.How large is the Java version of the compressor?Some time ago I made mention of having two versions ofthe dynapi for download. A developer version and aproduction version. IMO the developer version wouldinclude all the external (non-API related) utilities,etc, while the production version would only includethe src, docs and examples. Should we make theexternal tools/utilities, etc be part of thedeveloper's download or should they be separate(something like a Dynapi Developement Kit - DDK)?PS. All dynapi external utilities, etc should beplaced in the bin/ folder. In some cases it might begood to arrange them in folders--Raymond Irving--- Jesse Vitrone <[EMAIL PROTECTED]> wrote:--------------------------------- Raymond, Leif, Greg, glad to see you both like the idea. I'llsign up withsourceforge and use the patch system. I grabbed the code from CVS when I first startedmaking thechanges, but I tried to do an update today,and there were lots onconflitcts that CVS didn't seemto merge very well. So I grabbed aclean copy of thecode again, and I'll go through and make thechangesagain. Didn't take too long the first time. I have WinCVS, but I've been using Tortoise CVS.What do I needPutty for? I found a bug today in my Java compression tool,and I'd like toget that fixed before I sent it out. Ialso wanted to add a feature inthe XML where you canspecify a comment that will be put at the top ofthemerged file, since it rips out all comments, and a lotof peoplewant something in the file for licensing andstuff like that. Once Iget that stuff in, I'll letyou know and send you a copy.JesseRaymond Irving wrote:Very cool indeed Jesse, very cool. Well done.IMO themerge feature is a major plus for theDynAPIlibraries.There're two ways to check in yourupdates. You could:1) Use the Patch system availableon the DynAPISourceForge web site2) Setup WinCVS andPutty on you computer can check inyou changes viaCVS.Are your changes based on the lasted version inCVS?--Raymond Irving--- Jesse Vitrone<[EMAIL PROTECTED]> wrote:Ooops, sorry, hit send too soon :( Here's thewholeemailHello all, I've never contributed to anopen source projectbefore, so I'm not sure of theproper ettiquite. Please correct me ifI do somethingstupid :) I've been email with Raymond Irving aboutsomeidea's that I had, and he encouraged me to post ithere and see whatpeople think. I wrote a Javaversion of the JavaScriptcompressor that comes withDynAPI. Along with everything that the DynAPIonedoes, it reads in a config file that says "compressthese files, thenmerge them into this one file". Thisenables me to keep a good amount ofJS files when I'mcoding, but then when I "build" to apache, Icompressthem all into 1 file, so the browser doesn't have tohit the servermultiple times to get the files.Then, I took it a step farther, and added what Ihad toin order to be able to compress the DynAPI files I wasusing,and it worked! I was able to get all my files,plus the DynAPI files Iwas using and compress / mergethem all into 1 file. It sped things up onmy serverdramatically. The changes were all just addingsemi-colonswhere they were needed, except for onecase: The mouse_ie.js, dyndocument.jsandmouse_dom.js files all have a method called "main"and that doesn't seem to workvery well when they'reall combined into the same file. To fix it,I renamedthem, which names like main_mouse_ie, etc, and fixedallthe other references to them. Seems to work fine,but I haven't testedextensively all the examples andsuch.I'd like to check in my changes, as well as sendinmy Java compressor, since Raymond said he'd like topost it on the site. I'd also like to make a Swingfront end for the java app to make it alittle easierto use.What do you guys and gals think of this idea?Should I check in the changes? What's the rightprocess for checking inchanges? Jesse-------------------------------------------------------This SF.net email is sponsored by: Etnus, makersofTotalView, The bestthread debugger on the planet.Designed with threaddebugging featuresyou've neverdreamed of, try TotalView 6 freeatwww.etnus.com._______________________________________________Dynapi-Devmailing [EMAIL PROTECTED]://www.mail-archive.com/[EMAIL PROTECTED]/__________________________________Doyou Yahoo!?Yahoo! Calendar - Free online calendar withsync toOutlook(TM).http://calendar.yahoo.com-------------------------------------------------------ThisSF.net email is sponsored by: Etnus, makers ofTotalView, The bestthread debugger on the planet.Designed with thread debugging featuresyou've neverdreamed of, try TotalView 6 free [EMAIL PROTECTED]://www.mail-archive.com/[EMAIL PROTECTED]/__________________________________Do you Yahoo!?Yahoo! Calendar - Free online calendar with sync to Outlook(TM).http://calendar.yahoo.com-------------------------------------------------------This SF.net email is sponsored by: Etnus, makers of TotalView, The bestthread debugger on the planet. Designed with thread debugging featuresyou've never dreamed of, try TotalView 6 free at www.etnus.com._______________________________________________Dynapi-Dev mailing [EMAIL PROTECTED]://www.mail-archive.com/[EMAIL PROTECTED]/-------------------------------------------------------This SF.net email is sponsored by: Etnus, makers of TotalView, The bestthread debugger on the planet. Designed with thread debugging featuresyou've never dreamed of, try TotalView 6 free at www.etnus.com._______________________________________________Dynapi-Dev mailing [EMAIL PROTECTED]://www.mail-archive.com/[EMAIL PROTECTED]/ -------------------------------------------------------This SF.net email is sponsored by: Etnus, makers of TotalView, The bestthread debugger on the planet. Designed with thread debugging featuresyou've never dreamed of, try TotalView 6 free at www.etnus.com._______________________________________________Dynapi-Dev mailing [EMAIL PROTECTED]://www.mail-archive.com/[EMAIL PROTECTED]/ __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/