Code splitting, as in http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting The particular design we're pursuing (and by "we", I mean "Lex") is one that will take asynchronous split-points you define in your application code and have the compiler statically determine the optimal set of generated code to put in each fragment. It takes advantage of the fact that Java (without reflection) is fully statically analyzable to do so.
I'm glad to hear that Pyjamas is attempting to attack the code-bloat problem in a somewhat analogous way, and the two implementations may have something to learn from one-another in how they actually fetch the remote code. As for the actual splitting algorithm, Python is an entirely different beast, whose dynamic nature will require possibly-incorrect user guidance as to the dependency graph, and I'm pretty certain it can only asymptotically approach "optimal" dependencies, with the possibility of error becoming greater the more one tries to find the optimal set of dependencies by hand. I believe Lex started by trying to use <script> tags, but they have the significant disadvantage that you can't tell when one fails to load, reliably, on all browsers. You can fetch the scripts using XHRs, but there are some significant hurdles to using eval() on the resulting script text, as described by Lex, here: http://lexspoon.blogspot.com/2009/03/many-scopes-of-javascripts-eval.html Hope this clears things up a bit, joel. On Wed, Mar 11, 2009 at 4:31 PM, lkcl <[email protected]> wrote: > On Mar 11, 5:58 pm, Ray Cromwell <[email protected]> wrote: > > If by this, you mean code splitting, you might want to look at the GWT > trunk. > > code splitting - as in 'splitting classes into separate javascript > cache files and using s = document.createElement("script"); s.src = > "class.name.ui.something.cache.js"; document.appendChild(head, s); ' > and then going into a timer loop, waiting for it to load ? > > if that's been done already, _great_. saves _vast_ amounts of > duplication of compiled javascript. > > pyjamas GAE users are hitting the limit with just a simple > application, thanks to 500k of pyjamas ui libraries - duplicated 5 > times between the 5 platforms. > > so GWT developers will benefit enormously from the same functionality. > > l. > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
