GWT compiler deduplicates string constants, but cannot fully do that due to Errai marshalling implementation inefficiency. Example:
To fix this inefficiency it's just enough to generate:
then GWT compiler will put "builtAtShort" only once to resulting js, and size will be seriously reduced.
Also the following part should be split as well to allow GWT compiler do optimization:
As result "^EncodedType" and "^EnumStringValue" will not be repeated multiple times in resulting js (in my project it's 267 and 44 repetitions of these strings!), and class name "com.vx.sw.shared.domain.SortingOrder" will not be repeated twice as well.
Unfortunately my initial idea with append() caused too many append calls, so resulting js size was even 2% bigger.
Then I've implemented another solution - direct string concatenations. It works just fine, and marshalling code size in my project decreased from 433kb down to 395kb.