Wednesday, June 29, 2016

Questions about how the GWT obfuscation process works

I've been vaguely aware of GWT and what it does for a few years, but learning Java is still on my todo list so I haven't yet explored GWT in too much depth.

While recently poking around in my browser devtools as I tried to figure out how a particular webapp worked I noticed some obfuscated cache files, and after a bit of digging and research I learned this was because the code was GWT-generated.

My curiosity to figure out what I was looking at was motivated by the obvious obfuscation I could see, particularly the fact that the obfuscation process appears to be compressing the JavaScript in question - if I'm not mistaken, it looks like it's identifying similar code snippets and placing them in common functions. Is this what's happening? It'd be a very interesting technique from a bandwidth-saving perspective.

Even if the obfuscation engine doesn't compress as a side effect, the result certainly seems much harder to read and follow to me than the output of the various other JS minifiers out there, and as such, the obfuscation component is very appealing to me on its own.

Is it possible to point the GWT obfuscator at my own JavaScript and have it obfuscate that, or does it only work on GWT-generated code?

- David Lindsay

PS. As an aside, I'm very curious why so many of the functions I see are empty. Is there a reason for this? Why can't eg 527 empty functions (with no arguments) be turned into 1? Are they being used as objects?

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment