If it's the same error we ran into, it's that there are things that look like
HTML script and comment tags in the linker script that throw the parser off.
Note how we broke up the script start tags and comment start/end tags the same
way as the script end tags:
XSLinker:
var compiledScriptTag = '"<script src=\\"' + base + strongName +
'.cache.js\\"></scr" + "ipt>"';
$doc.write('<script><!--\n'
+ 'window.__gwtStatsEvent && window.__gwtStatsEvent({'
+ 'moduleName:"__MODULE_NAME__", sessionId:$sessionId, subSystem:"startup",'
+ 'evtGroup: "loadExternalRefs", millis:(new Date()).getTime(),'
+ 'type: "end"});'
+ 'window.__gwtStatsEvent && window.__gwtStatsEvent({'
+ 'moduleName:"__MODULE_NAME__", sessionId:$sessionId, subSystem:"startup",'
+ 'evtGroup: "moduleStartup", millis:(new Date()).getTime(),'
+ 'type: "moduleRequested"});'
+ 'document.write(' + compiledScriptTag + ');'
+ '\n--></script>');
Our linker:
var compiledScriptTag = '"<scr'+'ipt src=\\"' + base + strongName +
'\\"></scr" + "ipt>"';
$doc.write('<scr'+'ipt><!-'+'-\n'
+ 'window.__gwtStatsEvent && window.__gwtStatsEvent({'
+ 'moduleName:"__MODULE_NAME__", subSystem:"startup",'
+ 'evtGroup: "loadExternalRefs", millis:(new Date()).getTime(),'
+ 'type: "end"});'
+ 'window.__gwtStatsEvent && window.__gwtStatsEvent({'
+ 'moduleName:"__MODULE_NAME__", subSystem:"startup",'
+ 'evtGroup: "moduleStartup", millis:(new Date()).getTime(),'
+ 'type: "moduleRequested"});'
+ 'document.write(' + compiledScriptTag + ');'
+ '\n-'+'-></scr'+'ipt>');
We've had inlining working on dotspots.com in GWT trunk for a while now, but
I'm considering going back to an external nocache.js so we can more easily
decouple our static content from the GWT code.
Matt.
On 2009-12-17, at 12:40 PM, George Georgovassilis wrote:
> Some time ago we discussed [1] inlining nocache.js into the host page
> to speed up initial page load, which I find quite worthwhile a read.
> While back in the 1.7 days I managed to inline nochache.js with a
> modest effort of post processing (escaping some javascript), 2.0
> defeats me. I can't find a way to inline the GWT 2.0 compiler's
> nocache.js into the host page without always running into some
> javascript syntax error, which prohibits the entire code from loading.
>
> Any hints?
>
>
> [1]
> http://groups.google.com/group/google-web-toolkit-contributors/browse_thread/thread/8127c586073b1711/2eeb884f6f5cdcbf?lnk=gst&q=inline#2eeb884f6f5cdcbf
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors