On Mar 11, 8:42 pm, Joel Webber 𐑯(ټ)𐑥 <[email protected]> wrote:
> Code splitting, as 
> inhttp://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.

 yehh, i have a sort-of rather horrible workaround for that one, but
if people do 'exec "import %s" % modulename' at runtime then we're a
bit hosed :)

 i'd _really_ like to find a synchronous dynamic load solution.


> 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.

 i hope so, too.

> 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.

 ok - what i do is use the compile process to collate a list of all
modules, where a record of each individual module's imports (thus,
dependencies) is also kept.

i have a post-processing compile step in which i just go "ok, let's
assume everything was globally imported" and make sure that the first
thing an app does is dynamically load aaabsolutely everything (in the
right order of course).


> 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....

yeah i started off with eval of the dynamically-loaded content, but...
yeh :)  thanks for that because it looks like lex (hi lex) has done a
more comprehensive review of the available techniques.

i haven't tried chrome (i will when there's a linux version) but the
append script node thing seems to work - i used src= rather than text=
because i didn't go for as comprehensive a review of the available
techniques as lex.

l.

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to