gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.52k stars 375 forks source link

Support runAsync in SuperDevMode #8559

Open dankurka opened 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 8581


Found in GWT Release (e.g. 2.4.0, 2.5.1, trunk):
2.6.0

Encountered on OS / Browser (e.g. WinXP, IE9, FF10):
Chrome

Detailed description (please be as specific as possible):

I'm dealing with a quite large GWT project (~12MB of javascript code when not using
runAsync). The problem is that Chrome hangs when loading source maps - probably because
the javascript / source map is too large.

The project I'm working on uses runAsync, and we have 15 fragments + initial + leftover.

I tried patching the gwt-codeserver.jar, changing CompilerOptionsImpl to return true
in isRunAsyncEnabled(), and the application works, but the source maps are only generated
for the initial download fragment.

I have posted https://groups.google.com/forum/#!topic/google-web-toolkit/dFyODLo7QMo
and was told that might be related to https://code.google.com/p/google-web-toolkit/issues/detail?id=7615
.

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

Any GWT application with GWT.runAsync(...) will be compiled to a single fragment when
running in SuperDevMode.

Workaround if you have one:
Use the plain old Develipment Mode with browser plugin

Links to relevant GWT Developer Forum posts:
https://groups.google.com/forum/#!topic/google-web-toolkit/dFyODLo7QMo

Link to patch posted at http://gwt-review.googlesource.com

Reported by lfpg.dev on 2014-02-17 14:39:19

dankurka commented 9 years ago

Reported by t.broyer on 2014-02-17 21:32:44

dankurka commented 9 years ago
It looks like we aren't going to support code splitting because it will slow the compile
a lot and isn't compatible with the incremental compiler work that should land in Super
Dev Mode soon. But we may do something similar. One idea is to output one .js file
per GWT module (each with its own sourcemap).

Reported by skybrian@google.com on 2014-03-24 21:05:09

dankurka commented 9 years ago
Can't the granularity be reduced to, for example, one .js file per source package, or
even per class?
We work with a single module, but split with several parts with runAsync. It works
well with the classic development mode and also fine in production.
However, SuperDevMode is a no-go for the size of the project.
Without something like that, we're out in the cold in the not-so-distant future.
But I guess something like that, 1 .js per package / class might do it. Is it feasible?

Reported by lfpg.dev on 2014-03-24 23:41:40

dankurka commented 9 years ago
I do recommend splitting up your code into GWT modules somehow because that is how separate
compilation will work. The compiler will compile each module separately, but if there's
a change anywhere within a module or anything it imports, it will recompile the module.

But even without that, there should still be some gain since gwt-user is split up into
many modules and that code shouldn't need to be recompiled.

Reported by skybrian@google.com on 2014-03-25 21:25:22

dankurka commented 9 years ago
That means that, even if I still have a single entry point module, if I split the source
packages in distinct modules, and make the entry point module inherit all those, I'd
end with several .js files (with separated source maps)?
That would solve the issue, I hope.

Reported by luisfpg on 2014-03-26 13:42:12