Re: [gwt-contrib] Inlining nocache.js

2009-12-18 Thread George Georgovassilis
Thanks Matt, that does the trick.
Actually I'm just post processing a template host html page with an ant 
task before deployment, that solves the decoupling concern.

On 17.12.2009 21:06, Matt Mastracci wrote:
 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=gstq=inline#2eeb884f6f5cdcbf

 -- 
 http://groups.google.com/group/Google-Web-Toolkit-Contributors
  


-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Inlining nocache.js

2009-12-17 Thread George Georgovassilis
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=gstq=inline#2eeb884f6f5cdcbf

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] Inlining nocache.js

2009-12-17 Thread Matt Mastracci
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=gstq=inline#2eeb884f6f5cdcbf
 
 -- 
 http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Inlining nocache.js

2009-08-07 Thread George Georgovassilis

I'd like to save first time visitors that roundtrip to fetch
nocache.js. Instead I've declared the module HTML page as non-
cacheable (works nice thanks to E-Tag) and moved images and GWT-
compiler output to a fully cacheable directory.

After inlining nocache.js into the module HTML I had to change the
paths to the XYZ.cache.html permutations, but couldn't get RPC to work
reliably across all browsers.

Is there a way to do this cleanly?
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---