Is there an ETA for GWT 2.6 support?

84 views
Skip to first unread message

Sebastien Diot

unread,
Apr 29, 2014, 5:15:01 PM4/29/14
to gwtex...@googlegroups.com
Hi.

I've just tried gwtexport, using version 2.5.0-SNAPSHOT, as there does not seem to be a 2.6.0 version out yet, and I am encountering several issues. I can't tell if I'm doing something wrong, or have found a genuine bug(s), or if it's because of incompatibilities arising for using GWT 2.6.0.

First problem: I cannot use the "real package name" of my type. Using the fully qualified name, JS tells me the "package name" in which the type resides is "undefined". I could work around that by using @ExportPackage(), but the value I give to @ExportPackage() *must not contain any dot (.)* in it, otherwise it does not work.

Second problem: If I create an instance of my type from within JavaScript, with the non-dot-using package name, all seems OK. But if I return that instance from JS to my GWT code, I get a "JavaScriptObject", rather then my type.

Third problem: If I create an instance of the type in GWT, and pass it somehow to JavaScript, the object looks to JavaScript as if "not exported".

I declared my type like this:

ExportPackage("com_mydomain_mypackage")
@Export(all = true)
public class SomeDataType implements Exportable {
    public SomeDataType() {
    }
    public String name() {
        return "John";
    }
    public int age = 42;
}

And in my module file I have:

    <inherits name='org.timepedia.exporter.Exporter'/>
    <set-property name="export" value="yes"/>

And in my EntryPoint I have:

            ExporterUtil.exportAll();
            GWT.create(SomeDataType.class);

What I'm actually trying to do, is create a working emulation of javax.script.ScriptEngineManager and co (running the script using $wnd.eval(script)) My emulation works for primitive values, but I'm stuck when using "objects". I was hoping gwtexporter would solve this, but so far it doesn't.

So, is there an ETA for GWT 2.6 support, so I can at least eliminate "incompatibilities" as a source of errors?

Thomas Broyer

unread,
May 2, 2014, 6:06:51 PM5/2/14
to gwtex...@googlegroups.com
Note: I don't know gwt-exporter much, I'm here because you posted on the GWT forum: https://groups.google.com/d/topic/google-web-toolkit/OYBmi2mQl7Q/discussion


On Tuesday, April 29, 2014 11:15:01 PM UTC+2, Sebastien Diot wrote:
Hi.

I've just tried gwtexport, using version 2.5.0-SNAPSHOT, as there does not seem to be a 2.6.0 version out yet, and I am encountering several issues. I can't tell if I'm doing something wrong, or have found a genuine bug(s), or if it's because of incompatibilities arising for using GWT 2.6.0.

First problem: I cannot use the "real package name" of my type. Using the fully qualified name, JS tells me the "package name" in which the type resides is "undefined". I could work around that by using @ExportPackage(), but the value I give to @ExportPackage() *must not contain any dot (.)* in it, otherwise it does not work.

Have you looked at what's being generated? (introspect the window JS object in the browser; or pass the -gen argument to DevMode or Compiler and look at the generated code)
 
Second problem: If I create an instance of my type from within JavaScript, with the non-dot-using package name, all seems OK. But if I return that instance from JS to my GWT code, I get a "JavaScriptObject", rather then my type.

Is "your GWT code" a method exported through GWT-Exporter?
If so, from what I understood, GWT-Exporter should transparently unwrap the Java/GWT class from the JS class.
Otherwise, as I explained in the GWT forum thread, this is expected.
 
Third problem: If I create an instance of the type in GWT, and pass it somehow to JavaScript, the object looks to JavaScript as if "not exported".

Same as above: passing it to JS should go through GWT-Exporter for the Java/GWT object to be wrapped within a JS object.

phine...@gmail.com

unread,
May 10, 2014, 12:04:34 PM5/10/14
to gwtex...@googlegroups.com
I can't help, but I can comment that I'm trying to do pretty much exactly the same thing as you (https://groups.google.com/forum/#!topic/google-web-toolkit/9-Ju_LRxp_E). I just posted a question today about it, then came across gwt-exporter.

And I'm seeing the same issue, except for me, even when I specify @ExportPackage("mypackage") I can't seem to get a class to export at all. I always get "mypackage is not defined" when trying to access the class from JavaScript.

Since there's an issue filed saying that the unit tests fail under 2.6.0, it's pretty clear that that's the issue. This looks like a really nice project, so I hope it can be returned to a working state soon.

On Tuesday, April 29, 2014 11:15:01 PM UTC+2, Sebastien Diot wrote:
Reply all
Reply to author
Forward
0 new messages