Tuesday, August 5, 2014

Re: GWT Developer Plugin no longer works with Chrome on Linux

I remember having created this bookmarklet when reading some SDM document, but I never understood how to use it. Why should one use it to recompile the app, instead of running the GWT compiler in eclipse? And what exactly is the SDM code server (remember, I started my app in eclipse by calling "run as web application"). Is it simply the embedded server in eclipse called Jessie?

The code server is a process that uses the GWT compiler to recompile your app and serve the output (including SourceMaps) using an embedded Jetty server. The benefit is that the code server will configure the GWT compiler for maximum performance (by disabling all kinds of optimizations). Also the code server can hold the GWT compiler instance in memory to cache certain information and thus saving some work which also reduces compilation time. Caching will have an even greater effect once incremental compilation is supported.

Basically the code server should be faster at recompiles than if you would start the GWT compiler by hand in eclipse. Well and SourceMaps usually just work.


 

However, when I click on the "DevMode On" bookmarklet while my app is running, I get the following message in the chrome console:

GET http://localhost:9876/dev_mode_on.js net::ERR_CONNECTION_REFUSED


Thats because you never started the code server. Actually the Google Eclipse plugin has no built-in support for SDM so you have to start it manually using a Java Application run configuration or some build tool like maven/gradle. GWT 2.7 will make it a lot easier to launch the code server. To launch the code server manually put code-server.jar from your GWT SDK on class path and use com.google.gwt.dev.codeserver.CodeServer as main class. The class path for the code server should be the same as for classic DevMode and command line parameters are similar.



 
In that case you probably only have compiled your app to JavaScript and used the embedded Jetty of classic DevMode (run as web application) to serve your app.

Should the app be started in a different way, other than "run as web application"?

No thats fine if thats all you need.


 
 My understandig at the moment looks like this:

  1. Run "GWT compile" in eclipse.
  2. Run "Run as Web Application" in eclipse.
  3. Open "http://127.0.0.1:8888/index.html" in the browser
  4. Make changes to the code, because you saw that there is something wrong.
  5. Click on "DevMode On".
As already mentioned, 5. does not work for me. I don't understand why we don't simply recompile with "GWT compile" command in eclipse.
 
You can use GWT compile in eclipse but then you have to make SourceMaps work. Also the code server should recompile faster (see above).

 
And I also don't understand 1. and 2.: Calling "Run as Web Application" always worked without running the GWT compiler. I always needed the GWT compiler to create a war file...

Run as Web Application has started classic DevMode and an embedded Jetty server to serve your server side code. Classic DevMode was then responsible to execute your code. Now you don't use classic DevMode so the only way to execute your app is to compile it to JavaScript so that the browser can execute it.


-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment