gwtproject / gwt

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

Support webworker as first class citizens in GWT #7543

Open dankurka opened 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 7546

Found in GWT Release (e.g. 2.4.0, 2.5.0 RC):

2.5.0 RC1

Encountered on OS / Browser (e.g. WinXP, IE8-9, FF7):

independend, problem is in compile time

Detailed description (please be as specific as possible):

In one GWT project I'm using a Web Worker implementation based on the speed tracer
implementation. This works well with GWT 2.4.0, it genereates two java-script files,
one is called searchworker.nocache.js and the other *.cache.js and contains the generated
code for all browsers. When I recompile the same project using GWT 2.5.0 RC1, there
are six *.cache.js files generated, one for every supported browser architecture. This
wouldn't be a problem if the web worker could detect the user-agent, but that's not
possible inside the web worker. So the web worker simply doesn't work.

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

checkout speedtracer and compile BreakyWorker, there's the same problem

Workaround if you have one:

-

Links to relevant GWT Developer Forum posts:

-

Link to patch posted at http://gwt-code-reviews.appspot.com:

-

Reported by Manfred.Tremmel@iiv.de on 2012-07-22 17:57:23

dankurka commented 9 years ago
Problem still exists in GWT 2.5.0 RC2.
Nobody interested in?

Reported by Manfred.Tremmel@iiv.de on 2012-10-07 17:08:43

dankurka commented 9 years ago
Ok, fixed the problem by adding

<set-property name="user.agent" value="safari"/>
<set-configuration-property name="user.agent.runtimeWarning" value="false" />

into the project-xml file. The generated JavaScript is browser independend, so it's
no problem to build special for safari (other would work, too).
What doesn't work is using the closure compiler, it adds a "window.gwtOnLoad=gwtOnLoad;"
what can't work in a web worker!

Reported by Manfred.Tremmel@iiv.de on 2012-10-31 22:48:15

dankurka commented 9 years ago

Reported by dankurka@google.com on 2013-05-28 03:19:30

davepuchyr commented 7 years ago

Any hope for web workers being first class citizens in GWT anytime soon?

Do any of these provide a path forward?

(Merge this issue with Add support for HTML5 web workers #6814 ?)