mohsensd1373 / smartgwt

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

Super Dev Mode in GWT 2.7 does not seem to work with SmartGWT 5.0p #758

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
To reproduce:
1) Having the module configured as below 
<module>
    <inherits name='com.google.gwt.user.User'/>

    <inherits name="com.smartgwt.SmartGwtNoScript"/>

    <entry-point class="[edited]" />

    <!-- Linking fails in GWT 2.7 without the line below -->
    <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>

</module>

2) and the following added to <head> element of the webpage
     <script src="[edited]/sc/modules/ISC_Core.js">          </script>
     <script src="[edited]/sc/modules/ISC_Foundation.js">    </script>
     <script src="[edited]/sc/modules/ISC_Containers.js">    </script>
     <script src="[edited]/sc/modules/ISC_Grids.js">         </script>
     <script src="[edited]/sc/modules/ISC_Forms.js">         </script>
     <script src="[edited]/sc/modules/ISC_RichTextEditor.js"></script>
     <script src="[edited]/sc/modules/ISC_Calendar.js">      </script>
     <script src="[edited]/sc/modules/ISC_DataBinding.js">   </script>

     <script src="[edited]/sc/skins/load_skin.js"></script>

The super dev mode does not load any SmartGWT static files (logs from the 
codeserver below):

[WARN] 404 - GET /isomorphic/skins/Enterprise/images/blank.gif (127.0.0.1) 239 
bytes
   Request headers
      [edited]
   Response headers
      [edited]
12:44:38.970 [qtp2017044350-48] DEBUG org.eclipse.jetty.server.Server - 
RESPONSE /isomorphic/skins/Enterprise/images/blank.gif  404 handled=true

Plus the following is logged during compilation:
      [ERROR] The Cross-Site-Iframe linker does not support <script> tags in the gwt.xml files, but the gwt.xml file (or the gwt.xml files which it includes) contains the following script tags: 
sc/skins/Enterprise/load_skin.js

As a result, the webpage is displayed as plain text in Super Dev Mode

In production mode everything is all right with the same setup. Only Super Dev 
Mode fails.

Please see this forum thread for details: 
http://forums.smartclient.com/showthread.php?t=31789

Original issue reported on code.google.com by marcin.n...@gmail.com on 24 Nov 2014 at 3:41

GoogleCodeExporter commented 8 years ago
This is the result of an intentional change in GWT 2.7.0 - script loading is no 
longer supported in GWT modules using the new default xsilinker.  We're 
currently investigating how to modify our code to deal with it as cleanly as 
possible.

Original comment by smartgwt...@gmail.com on 25 Nov 2014 at 1:35

GoogleCodeExporter commented 8 years ago
We do see the script-loading problem with GWT 2.7.0, which can be worked-around 
thusly:
- switch all module inherits to the NoScript (or NoScriptNoTheme where 
available) versions
- add explicit <script src="..."></script> load commands to the web page for 
those modules for which NoScript (or alternate) versions were introduced above
- shift the DataSource schema load to the web page from the project file (if 
present)

For us, the above had to be done with or without SuperDevMode - there was no 
difference.  We did verify that with these modifications, SuperDevMode seems to 
work correctly from Chrome (Chrome 38/Linux x64).  We were able to set 
breakpoints and hit them.

You may wish to try with one of SGWT Showcases or Sample Projects.  (We can 
only speculate that you may have been using the old "std" linker for 
non-SuperDevMode.)

As far as the ultimate solution, it will not be simple, as we need to 
investigate whether GWT (2.7.1?) may provide a fix, and if not, how to best 
migrate our module code to use something like the ScriptInjector for script 
loading (which is not a "drop in" replacement for the lost funcationality).

Original comment by smartgwt...@gmail.com on 26 Nov 2014 at 2:43

GoogleCodeExporter commented 8 years ago
Thanks for the .SmartGwtNoScriptNoTheme tip - this caused linking to pass.

To get rid of the 404's in the code server I needed to add the following to the 
beginning of the <head> on web page:

<script>var isomorphicDir = "[module-name]/sc/"</script>

(the trailing "/" matters).

All is working fine now. Thanks for your help.

Original comment by marcin.n...@crosswordcybersecurity.com on 29 Nov 2014 at 5:54

GoogleCodeExporter commented 8 years ago
To clarify further the notes from post #2, the [...]NoScript modules should be 
sufficient to get around the linker limitation in GWT 2.7.0.  Use 
SmartGwtNoScriptNoTheme only if you want the extra behavior - above and beyond 
SmartGwtNoScript which skips loading a skin - that no skins will be copied into 
the generated war file.

Original comment by smartgwt...@gmail.com on 2 Dec 2014 at 4:49

GoogleCodeExporter commented 8 years ago
A fix for this issue has been ported back as far as SGWT 4.1p.  However, make 
sure to note that as mentioned in the SuperDevMode Troubleshooting section: 
http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/docs/SuperDevMod
eTroubleshooting.html, we still recommend moving away from script tags as 
future changes to GWT may lead to additional incompatibilities.

Original comment by smartgwt...@gmail.com on 26 Feb 2015 at 6:34