cross site linker in GWT 2.0 RC1 vs trunk

4 views
Skip to first unread message

John O'Conner

unread,
Nov 19, 2009, 3:51:32 AM11/19/09
to Google Web Toolkit
I noticed that the XSTemplate.js file is differs between 2.0 RC1 and
the trunk (specifically r7021). I am wondering what the implications
are.

In RC1, the XSTemplate.js (the cross-site linker template for the
selection/landing js file) loads the target js file with a
document.write("<script>...") command when I include the xs linker in
the module xml file.In the trunk, the same file loads the targeted js
file by creating a "script" element and injecting it in the document
via something like this:
scrpt.language = "javascript" ;
scrpt.setAttribute("language", "javascript");
scrpt.setAttribute("type", "text/javascript");
scrpt.charset="utf-8";
scrpt.src = base + strongName + '.cache.js';
window.document.getElementsByTagName("body")[0].appendChild(scrpt);

I think I prefer the latter implementation, but unfortunately the
latest trunk build won't compile in xs mode. The compilation produces
the following error:
Compiling 4 permutations
Compiling permutation 1...
Compiling permutation 2...
Compiling permutation 3...
Compiling permutation 4...
Compile of permutations succeeded
Linking into C:\Users\joconner\workspace\joconner_ree\ree_gwt
\ChatClient\war\chatclient
Invoking Linker Cross-Site
Attempting to optimize JS
[ERROR] Unable to parse JavaScript
com.google.gwt.dev.js.JsParserException: syntax error
at com.google.gwt.dev.js.JsParser$1.error(JsParser.java:107)
at com.google.gwt.dev.js.rhino.Context.reportError(Context.java:
459)....and so on

Any ideas on
1) whether the trunk method of injecting the application js is
preferred, and
2) why the trunk GWT doesn't compile with the xs linker. (My app is
just the default generated by the webAppCreator tool)

Regards,
John O.

John O'Conner

unread,
Nov 19, 2009, 8:23:47 PM11/19/09
to Google Web Toolkit
Anyone have any ideas about this? If my question is too vague or ill-
formed, please let me know. I'm curious about your answers to this and
want to make the question as easy to respond to as possible.

Thanks again!

Chris Ramsdale

unread,
Nov 20, 2009, 12:00:54 AM11/20/09
to google-we...@googlegroups.com
John,

Trunk should definitely compile standard apps with the xs linker. Let me take a look at this tomorrow morning and I'll get back to you.

- Chris


--

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.



John O'Conner

unread,
Nov 21, 2009, 2:53:47 AM11/21/09
to Google Web Toolkit
OK, so all I can say is "bonehead mistake."

After deleting my entire copy of the trunk code and checking out a
"fresh" copy of the entire code base, my compilation errors for xs
mode disappeared.

One troublesome point that I also discovered was that the default
build.xml file for a sample project created with webAppCreator
contains a hard-coded path to your GWT SDK. Of course, if you change
your SDK, changing your PATH and environment variables isn't
sufficient...you must also change the "gwt.sdk" property that is hard-
coded into the generated build.xml file for a new project. Once I
downloaded fresh GWT bits, compiled GWT again, set up my local env
GWT_HOME and PATH, *and* changed the build.xml's "gwt.sdk" property,
all is working again.

Thanks Chris for your help.
Reply all
Reply to author
Forward
0 new messages