zorba-the-geek / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Using "com.smartgwt.SmartGwtDebug.gwt.xml" doesn't work on Windows #126

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I include "com.smartgwt.SmartGwtDebug" in my project's module to get
the debug libraries of SmartClient, I get a "'isc' is undefined" error both
in the GWT browser and in IE7 after compiling the code. Firefox works fine.

The error occurs in load_skin.js, so it seems that the isc object doesn't
exist (yet) when load_skin.js is executed.

I've investigated the problem and found out the following: 
The ISC_*.js files in modules-debug include all the "real" JS files under
"sc/client/..." at runtime using document.write("<script..."). 
However, the browser only loads those files _after_ loading and executing
load_skin.js, which needs all those included JS files to run properly.

It seems that the GWT way of including JavaScript files takes precedence
over JS files included by document.write(...).

To get it working, one has to include all those JS files that are included
by "modules-debug/ISC*.js" by means of a GWT module.

I've written a small Java app that scans the "modules-debug/ISC*.js" files
and creates a corresponding GWT module file. 

I'll attach the GWT module files that include the SmartClient debug
libraries in a way that IE likes better. I've named them
"Smart*DebugIE.gwt.xml" (IE = Internet Explorer). I'll also attach the
source code of the app that generates "SmartClientDebugIE.gwt.xml", if you
ever need to recreate the file in case the included libraries ever change.

Maybe you can add that to SmartGWT sometime, to enable Windows users to use
the SC debug libs. Thanks.

Original issue reported on code.google.com by Hartmut....@gmail.com on 21 Feb 2009 at 5:55

Attachments:

GoogleCodeExporter commented 9 years ago
Hartmut, 
Thanks for the detailed notes. I was actually looking at this yesterday as 
well. The 
funny thing is that if I include the top level files under "modules-debug" 
followed 
by the load_skin.js in the host html file, there is no error. The 
SmartGgwtDebug 
module is essentially doing the same thing, except its using GWT's script 
injection. 
So I'm a little baffled. Furthermore, SmartGwtDebug used to work a while ago 
and I'm 
not sure what quite changed that is causing the module-debug script's injected 
by GWT 
to cause the individual script includes to be loaded out of order / 
asynchronously.

Please keep me posted if you are able to narrow down this issue. I would prefer 
to 
include the modules-debug files as its easier to maintain when ,say, SC adds 
new 
classes etc.

Original comment by sanjiv.j...@gmail.com on 21 Feb 2009 at 6:04

GoogleCodeExporter commented 9 years ago
I guess if you don't include the modules-debug files in the host HTML file 
directly
using <script> tags, but you do it instead using script injection / 
document.write,
it won't work either. It has probably something to do with the order in which IE
processes multiple levels of script injection, i.e. when a file that has been 
loaded
via script injection itself loads a file using script injection, which is what
happens here when you use GWT. 
My guess is that IE initially loads all files directly included via <script>, 
then
all files loaded via script injection level 1, then all files loaded via script
injection level 2 and so on if you know what I mean. I'll verify that with 
HttpWatch
and let you know whether my guess is correct.

Original comment by Hartmut....@gmail.com on 21 Feb 2009 at 6:22

GoogleCodeExporter commented 9 years ago
I have gone ahead and updated the SmartClientDebug module itself with the 
individual 
files. Having a separate one for IE seemed overkill and this version will work 
with 
all browsers as well.

I'll keep an eye on when new SC files are added and will run your utility. Will 
also 
regenerate it before official releases. Thanks a lot!

Original comment by sanjiv.j...@gmail.com on 22 Feb 2009 at 6:23

GoogleCodeExporter commented 9 years ago
Here's an interesting blog post about how IE and FF behave differently when 
handling
nested script includes using document.write:

http://flouri.sh/2007/9/23/nesting-document-write

I think the safest way to guarantee that all scripts are loaded in the same 
order in
which they're listed in the gwt modules is: Don't use nested includes with
document.write yourself, but specify all include scripts in *.gwt.xml module 
files at
compile time. GWT's compiler will create a flat list of files to include and do
non-nested includes via document.write, which apparently works in all browsers.

Original comment by Hartmut....@gmail.com on 22 Feb 2009 at 7:19

GoogleCodeExporter commented 9 years ago
Since version 3.1 the content of SmartClientDebug.gwt.xml has been reverted to 
include the modules-debug/ISC_* instead of the individual files.

Therefore the bug is still present as described by Hartmut and should be 
reopened.

Original comment by ste.mai...@gmail.com on 26 Feb 2013 at 11:51

GoogleCodeExporter commented 9 years ago
Thanks for pointing this out.  This has been fixed for the next nightly builds 
of 3.1 and 4.0 versions.

Original comment by smartgwt...@gmail.com on 27 Feb 2013 at 7:24