Open ibaca opened 7 years ago
I think we should aim at replacing c.g.g.dev.DevMode with a "devserver" (possibly baked into CodeServer, but not necessarily) similar to Webpack:
launcherDir
(don't assume a Java web app, only static content),/
) to be reverse-proxied, possibly from the command-line like devd
(so we don't need a config file; add notation to tell whether to rewrite the host header or not)*.nocache.js
(possibly only <modulename>/<modulename>.nocache.js
, maybe only for "known" modules) to trigger a recompile (i.e. serve the stub, without necessarily having to write it to disk in any public directory)That way:
launcherDir
, therefore not polluting your target directory, if you already compiled your app (as can be the case with Maven or Gradle) or your target directory is also your source directory (e.g. for standalone apps, so you don't even need to put your static resources into the module's "public path")-launcherDir
wouldn't work then, because you would have no way to serve the stub nocache.js)Proof-of-concept devserver at https://github.com/tbroyer/gwt-devserver
Whoa, I like the sounds of it.
By the way, there is another way around funky web app configurations. That's use the Compiler with incremental, to compile into the output directory with only one permutation for testing quickly. Then it doesn't matter if it's ssl, or has odd directory. The only issue here, is the web servlet container, or hosting container has to know about the new resources pushed into it, and refresh.
Currently only the codeserver first compilation or the launcherDir output uses the LauncherDir.generateStubNocacheJs (i.e. the app.nocache.js that recompile on reload). Is this some kind of limitation? Is it possible to use the auto-recompile.nocache.js for all Recompilations?
This is specially useful to get rid of devmode. Currently if you have a client only or a CORS enabled app, and you put your index.html inside your app module public folder, you can use the codeserver to bootstrap your app. The unique actual disadvantage compared to devmode is that devmode uses the auto-recompile.nocache.js but codeserver doesn't.