On 5 juin, 22:27, Dobes <[email protected]> wrote:
> Is there any clever way to set the PRETTY or OBFUSCATED javascript
> output depending on the browser?
>
> This may seem strange at first, but here's the reason:
>
> 1. In Firefox, I get nice stack traces with PRETTY turned on
> 2. In Safari 4, large GWT apps like mine don't load due to a bug in
> their javascript parser
> 3. In IE and Opera, our GWT app is slow to load and doesn't give stack
> traces anyway, so a little boost by using OBFUSCATED would be
> preferred
>
> The only method I can think of at the moment is to create separate
> modules for each browser, compile each of them separately, and do
> browser detection on the server.  However, this seems a bit painful.
>
> Any ideas?

1. Compile once in PRETTY and once in OBFUSCATED
2. Run both in the browsers that need special treatment (i.e. Firefox
and Safari) and note the loaded *.cache.html for each
3. Rename the PRETTY *.cache.html to the OBF *.cache.html names (or
the other way around)

That way, when your app launches in, say, Firefox it'll load, say,
A.cache.html, which happens to contain what was originally compiled in
Z.cache.html in -style PRETTY (the *.nocache.js is obfuscated though);
but when you run your app in IE, it'll load the B.cache.html that's
been compiled in -style OBF.

You can therefore mix PRETTY and OBF *.cache.html files in the same
deployed app; what matters to the *.nocache.js are only the file
names, not their content (special methods used to start the app aren't
renamed when obfuscated).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" 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/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to