Thursday, February 1, 2018

Re: Migrating from GWT 2.5.1 to 2.8.2 - Problem with Super dev mode

Hi everyone, and Thomas especially :p

I'm migrating a larger legacy project to the actual GWT standards. I'm running into many problems but I'm sure they are all due to my misunderstanding of how to wire modules between them. Here is the context and my questions : 

My old project structure was (GWT 2.5) : 

Shared: gwt project - pure clientside gwt
WebUI: gwt project, depending on Shared
MobileUI: gwt project, depending on Shared


New project (GWT 2.8.2) :

Right now I'm trying just to have WebUI working, so I'm inspiring from Thomas's gwt-maven-archetypes (modular webapp).

My architecture is :
  • root-project
    • pom.xml
      • shared
        • pom.xml
        • src/main/module.gwt.xml
      • web-client
        • pom.xml
        • src/main/module.gwt.xml
Questions
  • When I try to gwt:codeserver :
Loading Java files in (project shared).
[ERROR] Errors in 'file:(some client project file)'
No source code is available for type '(some file from shared project)' ; did you forget to inherit a required module?


Although I have these dependencies set in my client pom.xml :

<dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>shared</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>shared</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
I also added maven-source-plugin to both client and shared.
  • I have some old gwt .jar dependencies that do not seem to have any maven artifacts, how do I properly inherit these? I was thinking about <inherits> in module.gwt.xml and adding a <scope>system</scope> dependency in pom to link to the JAR.
  • I'm running codeserver in the root-project right now, is that ok even when I would like to serv my mobile sub-project ? (Using "modules" parameter I suppose)

Many thanks guys, I hope this is not too messy and that I didn't miss some obvious piece of info out there that solves all this out :)


Le mardi 31 octobre 2017 16:53:07 UTC+1, Martones a écrit :
Hi Thomas,

Many thanks for your time and answer! I was indeed playing with the legacy plugin ... :)  Things work much better now. The super dev mode is really great by the way.

I used your plugin and revamped slightly the client project (moved my main mymodule.gwt.xml to /src/main/java/module.gwt.xml and all my sources to /src/main/java). I'm then running code server with launcherDir arg pointing to my php root.

As for the downside of overriding nocache.js, I think the ideal process of deploying is compiling within a CI chain so it won't matter at all :)

Many thanks again,

Ludovit

Le mardi 31 octobre 2017 11:41:31 UTC+1, Thomas Broyer a écrit :


On Tuesday, October 31, 2017 at 10:31:39 AM UTC+1, Martones wrote:
Hey guys,

I'm trying to migrate my app which looks like this : 
GWT 2.5.1 front, PHP back, no maven -> GWT 2.8.2 front, PHP back, maven with gwt-maven-plugin.

I manage to mvn gwt:compile and mvn gwt:run-codeserver.

I actually think I'm confused about how the SDM runs now in 2.7+ but here is what I was thinking : 
  1. Run compile (optional ? ) via mvn gwt:compile
  2. Run code server via mvn gwt:run-codeserver
  3. Save the bookmarklet and compile via the popup on my gwt page 
  4. re-compile on every code change manually

In 2.7+, you can do:
  1. Run code server with -launchDir pointing to the directory served by your server
(there's no other step, code server will automatically compile/recompile on page load)
With Mojo's plugin (you did notice the maintainer now "strongly encourage[s you] to use the new [plugin]" though, right? see https://gwt-maven-plugin.github.io/gwt-maven-plugin/ ), that's <launcherDir> and <webappDirectory>.

The only downside is that code server when run this way will overwrite the mymodule.nocache.js, so make sure you recompile the app before packaging/deploying (gwt-maven-plugin staleness check might be confused, so "mvn clean", or force recompilation with -Dgwt.compiler.force)

The third point is the one that isn't working anymore (was ok in 2.5.1). In the popup I have :

mymodule : off This module doesn't have Super Dev Mode enabled.

Here is my module file: removed all the SDM lines that I understood are now useless, doesn't work anyway if I keep them :)


<module rename-to='mymodule'>
 
<!-- Inherits -->
       
<!-- ... -->

 
<!--  Entry point -->
 
<entry-point class="com.mycompany.mymodule.client.mymodule"></entry-point>

 
<!-- paths -->
 
<source path='client' />
 
<source path='shared' />

 
<!--  SDM  -->
 
<!-- <add-linker name="xsiframe"/>
 
  <set-configuration-property name="devModeRedirectEnabled" value="true"/>
 <set-property name="compiler.useSourceMaps" value="true"/> -->

 
 
<set-configuration-property name="CssResource.conversionMode"    value="strict" />
</module>


I'm serving my php page from a docker container on my localhost (so no HTTPS).

Any help is much appreciated :)

Ludovit

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment