Sunday, March 22, 2015

Re: Troubles Getting Started with JsInterop

I'm also trying to get @JsExport to work with either 2.7.0 or 2.8.0 SNAPSHOT (well, the latest SNAPSHOT from a week ago when they were still published, it's broken now).

All I have is a JsInteropMode=JS and a public class with @JsExport and implicit constructor, but it's not exported/visible anywhere. I've also noticed some issues with the persistentunitcache and SDM restarts but I'm not sure anymore if that's related to my problem.

I've uploaded my code here: https://github.com/christianbauer/sometest

After staring at the (few) examples from other people and the GWT tests all day I'm kind of stuck now and have no idea how to continue. Any help would be appreciated.

Thanks,
Christian

On Sunday, February 15, 2015 at 12:32:31 AM UTC+1, Vasco Andrade Silva wrote:
New insights: I manage to get the things working with @JsNamespace("$wnd.mylib") However, I ran in the following issues:
  • I've to reboot super dev mode each time I change the namespace
  • If I call @JsExport(<name>) (with a name) the symbol isn't exported to the namespace no more (it only worked with @JsExport without arguments)
    • I also tested with @JsExport("$wnd.<name>") without success
  • I couldn't mage to @JsExport to work with @JsType (not sure if I did and understand everything correctly)

On Saturday, February 14, 2015 at 8:12:46 PM UTC, Vasco Andrade Silva wrote:
Thank you Jens for your comment.

So my Issue #1 is closed until the JS.js method (or other alike) is out. By the way isn't there any library you know that has an implementation for a method like that?

However I was lazy regarding my copy for Issue #2 as I had the Foo class public - didn't work. Did you manage to get a simple @JsExport working?


On Saturday, February 14, 2015 at 7:56:57 PM UTC, Jens wrote:
I guess you have to make your Foo class public. While code examples in the doc uses default visibility I guess it is just because of laziness during writing the doc ;-)

Here is a recent commit that enforces public visibility: 


Well and as already said the JS.js functionality is simply not yet implemented. So you have to use JSNI factory methods for now.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment