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?