1

I'm trying to use the new SuperDevMode with -launcherdir parameter and currently I point launcherdir to the same folder as where production code is deployed.

The effect is that the .nocache.js file gets overridden by SuperDevMode's nocache.js file and it's impossible to run the app in production-mode(hosted mode) without doing another full recompile.

Is there any way to switch back and forth between SuperDevMode and production mode?

Thank you!

Dan L.
  • 1,717
  • 1
  • 21
  • 41
  • I think that is normal behaviour. I also do a full recompile when I need a production mode war. – Knarf May 12 '16 at 06:32
  • @Knarf - thanks for the answer, for me it feels like there has to be a way for a quick switch. In normal DevMode this was possible by not providing the codesvr. Googling a bit more, this has been discussed somewhere else and it seems possible to use DevMode with -nosuperdevmode parameter but it's only for GWT2.7. Any ideas for GWT 2.8? – Dan L. May 12 '16 at 08:41
  • for the moment I'm thinking to have an ant task that before launching CodeServer, would do a backup of the *.nocache.js file. Then another ant task would restore the backed-up file. Are there any better ideas? – Dan L. May 12 '16 at 08:43
  • I use SuperDevMode as I find it gives more benefits (mainly speed and compatibility). I just use ant files and do a complete recompile. Since I don't use the I18N system provided by GWT but my own I only have 6 permutations so compilation is fairly quick (4 minutes). I also don't do full compilations often, only a few per month. I don't think a lot of compilations are needed anymore, with DevMode you had to test more because of differences in DevMode<->ProductionMode. In SuperDevMode this is much less of an issue. – Knarf May 12 '16 at 08:50
  • Thanks Knarf - on a side note, how does the experience with SuperDevMode feels vs the old DevMode? Is it much faster, do you see a big difference? Did you make the switch due to other reasons? Having it running for a large project it seems to be quite similar to DevMode in terms of speed, not sure how to evaluate it correctly if it's worth the switch. – Dan L. May 12 '16 at 09:00
  • DevMode runs the java code, while SuperDevMode runs the JavaScript code. So when using SuperDevMode you are running the same code as in production mode. In DevMode this was not the case. In my experience your app was always A LOT slower when using DevMode, in SuperDevMode it runs at the same speed as the production mode. Also recompilations (just press F5 in the browser) are much faster (only a couple of seconds). I switched about 2 years ago to SuperDevMode. The downside is debugging but I find the Chrome debugger with sourcemaps more than enough... – Knarf May 12 '16 at 10:04
  • Thanks a lot Knarf, if you prefer you can repost your comment as answer below and I'll accept it. – Dan L. May 12 '16 at 10:22

1 Answers1

1

This is indeed how SDM works; the solution is to use distinct output folders for production and dev modes, but this all depends on your build tools, etc.

For instance you could assemble your web app in a distinct folder so you can run it with DevMode.
Or you can use a separate server (or even possibly a reverse proxy) that you configure to load the CodeServer-generated nocache.js in priority over the production one from your assembled webapp. This is what I do in Maven with the Tomcat or Jetty plugins for instance.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • Or just copy the nocache.js from the full compile and the nocache.js from the codeserver compile & copy back the one that you want to run, no server restarts required – timmacp Apr 12 '22 at 16:01