GWT - using compiled code (JsInterop) in a service worker

87 views Asked by At

I am trying to use JsInterop to call compiled gwt code from a service worker. I am just trying to do a test using a tutorial class:

@JsType(name = "TestJsInterop", namespace = "evc")
public class TestJsInterop {
    public boolean bool = true;

    public TestJsInterop(boolean bool) {
        this.bool = bool;
    }

    public String aPublicMethod(int x) {
        return "Hello " + x;
    }

    public static String aStaticMethd() {
        return "What's the meaning of life?";
    }

}

As far as I know, I have to use the -generateJsInteropExports flag, but I don't want to import my entry point GWT module (for ex. 'mymodule/mymodule.nocache.js'), because that contains all the application (UI) logic.

Is there a way to specify the javascript file name for the jsinterop output? or do I have to create another gwt module? If so, how do I specify that I want it to contain the jsinterop annotated classes? (because that module will be empty since those classes are not used)

0

There are 0 answers