I've done a little more experimentation and have determined two other 
variables that have to both be true in order for us to see this problem. 
First, we need to be using soft-permutations. In production, we build 
separate permutations but our dev env combines them altogether. Second, in 
production, we have entirely separate pages (different urls) with 
completely separate GWT modules/entry points compiled on their own (that 
share a common module). Because building a bunch of separate modules is 
slow, in our dev env, we have a super-module that inherits all the other 
ones and merges them all into one giant module.

In looking at the resulting cache.html file, I can see that in our dev env, 
we end up with multiple <script> blocks in the same file and each of them 
has as extra braces that I think may cause this scope change you referenced 
above.

<script><!--
{
  function function1() {....}
  ...
}
--></script>

Oddly each of these blocks are almost the same number of lines of code 
(about 75k-80k LOC). It might be split by method count. I'm guessing 
there's some limit in some browsers and with soft permutations, GWT is 
having to pick the lowest common denominator.

So building all the pages together results in one giant cache.html file 
(about 500k LOC with a PRETTY compile). However, if we continue to build 
the giant page but turn off the soft-permutations, for some reason, the 
extra braces in the script blocks go away (and in the Safari permutation 
there's a lot more script blocks). So we have to build the giant page *and* 
use soft-permutations in order to have problems. I we change either one of 
those, then we no longer have the problems with the application. And maybe 
it takes a very large project to hit whatever the cause is which might 
explain why there aren't more reports of problems. Also, if we manually 
remove those extra braces from the file, the problem goes away.

So I'm thinking that there's some trigger in the compiler whether it's 
based on soft permutations or some limit on JS size that causes it to emit 
these extra braces into the JS and that (I'm guessing) is what causes this 
sloppy function behavior.

If there is a fix for this in later versions of GWT, I hope it takes into 
account very large projects.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to