[gwt-contrib] Steering committees stance on J2CL and the future of GWT?

2015-11-17 Thread Brian Pedersen
Based on the videos from the last meetup, and the notes from the steering 
committee, many of us got the impression that GWT was moving towards being 
a pure Java-to-Javascript transpiler, and that the official recommendations 
from the GWT team was for developers to plan ahead for this.

*GWT 2.8 and 
Beyond 
(https://www.youtube.com/watch?v=ltqWRoJ0S-o=PL1yReUCGwGvrqscLu1EAyYRPrr0ceEHLE)*

These recommendations were repeated at GWTcon, but this time with a 
reference to the J2CL compiler that Google is working on, and it was more 
or less directly stated that it is up to the GWT steering committee to 
decide, if *they* want to base a future version of GWT on J2CL or not. 

This is causing a lot of confusion in the GWT community, as we all have a 
hard time distinguishing between what is GWT and what is not, when it comes 
to the new transpiler.

*What are the steering committees future vision for GWT, and how does J2CL 
fit into this?*

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/9ccc58ea-ce33-4bfa-831e-ce4cf6b392ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Re: GWTCon 2015 keynote question

2015-11-15 Thread Brian Pedersen

>
> Yeah. The conundrum for me is that I'm addicted to the pure-JVM unit 
> testing/debugging that MVP gives you.
>

I believe Angular controllers, Flux Stores etc. can be just as 
JUnit-testable as MVP, when implemented in Java and exposed through 
JsInterop.

There is a lot of pioneering to do, and I can imagine future best practices 
varying based on the JS framework of choice, as well as other parameters.

The important thing is to keep an open mind, not trying to force JS 
frameworks into our current best practices, and willingness to be inspired 
by the best practices of the chosen JS framework.

Our best practices has emerged from the constraints of GWT, and those 
constraints has just changed.

At least that is my point of view :)

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/dd951ccd-3764-4bc8-b3c8-16c9a47fd619%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: GWTCon 2015 keynote question

2015-11-13 Thread Brian Pedersen
I was at GWTcon, and my perception of Juliens keynote and his presentation 
on JSInterop was, that he used AngularJS to demonstrate that it is now 
possible to use a JS based framework with GWT 2.8 through JSInterop, and to 
show solutions to common issues you might run into while doing so.

Which framework you choose if you take this route, depends entirely on your 
requirements and personal preference. It could be AngularJS or something 
else, as long as it is javascript based.

This approach should make our applications J2CL compatible.

I also took the following note during the conference: 'J2CL != GWT3'.

This again is my own personal perception. 

While the GWT team seems focused on doing the J2CL transpiler, and there 
appear to be a clear expectation that the next major version of GWT will be 
based on J2CL, the future of GWT seems unclear.

/Brian


Den fredag den 13. november 2015 kl. 10.52.13 UTC+1 skrev stuckagain:
>
> This points to the GWTCon keynote done by Julien Dramaix.
>
> 
>  
> 
> https://drive.google.com/a/vaadin.com/file/d/0BwVGJUurq6uVa2tpaTRLSzlBMDQ/view?pli=1
>
> I was not able to attend the meeting but I wondered what was said about 
> the last slide:
> Use modern framework instead of classic GWT libs
>
> In the same conference Julien also showed how you can use JsInterop to use 
> AngularJS from GWT.
> This looked really nice, but does that mean that we need to start looking 
> at AngularJS for any GUI work ?
>
> I'm just trying to get a clearer picture to decide what way to go for 
> implementing a new application and I 
> want to be as much future proof as possible.
>
> Should I use:
> - UiBinder
> - GQuery
> - AngularJS
> - Singular
> - GXT
> - Vaadin
>
> This application will have a extensive GUI and will need to be maintained 
> for at least 10 years. Rewriting large parts is not something we want to do 
> too often if not needed.
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/54a3ffe7-6766-4741-8f8c-9f945c46d305%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: JsInterop: Casting native javascript objects in gwt

2015-11-04 Thread Brian Pedersen
Thanks.

If it is any help, my code is here: 
https://github.com/bitwerk/jspoc/tree/master/src/main/java/com/acme

/Brian

Den torsdag den 5. november 2015 kl. 06.41.35 UTC+1 skrev Goktug Gokdogan:
>
> This should work. I need to take a look why it fails.
>
>
> On Wednesday, November 4, 2015 at 3:04:11 AM UTC-8, Brian Pedersen wrote:
>>
>> Here is another variant, failing with the same exception
>>
>> //In Java
>> package com.acme;
>>
>> @JsType
>> public class IntParser {
>>   public static int parseArray(String[] args) {
>> return Integer.parseInt(args[0]);
>>   }
>> }
>>
>> //In Javascript
>> var num = com.acme.IntParser.parseArray(["42"]); // Should return 42, but 
>> throws 'Uncaught [object Object]'!
>>
>>
>>
>> Den mandag den 2. november 2015 kl. 11.11.35 UTC+1 skrev Brian Pedersen:
>>>
>>> Thank you Gortug for making my aware of the isNative attribute. 
>>> Unfortunately the cast issue remains.
>>>
>>> I have taken the example from the new jsinterop doc, and modified it to 
>>> illustrate this: 
>>> https://github.com/bitwerk/jspoc/tree/master/src/main/java/com/acme
>>>
>>> // in Java
>>> package com.acme;
>>>
>>> @JsType(isNative = true)
>>> interface Foo {
>>> }
>>>
>>> @JsType(isNative = true)
>>> class Baz implements Foo{
>>>   public int qux;
>>> }
>>>
>>> class Bar {
>>>   @JsMethod
>>>   public static int action(Foo foo) {
>>> Baz baz = (Baz) foo;
>>> return baz.qux;
>>>   }
>>> }
>>>
>>> // in JavaScript
>>>
>>> var baz = { qux: 42 };
>>> com.acme.Bar.action(baz); // will return 42!
>>>
>>> The image below demonstrates the issue at runtime.
>>>
>>>
>>> <https://lh3.googleusercontent.com/-9z2t_Q8R0oI/Vjc1qBoQgfI/BEc/CAbDBqNfUZc/s1600/debugger3.png>
>>>
>>>
>>> I can't seem to find anywhere inside the generated javascript, where a 
>>> class literal is assigned to the value 33.
>>>
>>> /Brian
>>>
>>> Den torsdag den 29. oktober 2015 kl. 09.37.48 UTC+1 skrev Goktug 
>>> Gokdogan:
>>>>
>>>> You can only implement java contract (e.g. PayLoad class) in javascript 
>>>> if they are marked as isNative. See the related section in the new 
>>>> jsinterop doc.
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop: Casting native javascript objects in gwt

2015-11-04 Thread Brian Pedersen
Here is another variant, failing with the same exception

//In Java
package com.acme;

@JsType
public class IntParser {
  public static int parseArray(String[] args) {
return Integer.parseInt(args[0]);
  }
}

//In Javascript
var num = com.acme.IntParser.parseArray(["42"]); // Should return 42, but 
throws 'Uncaught [object Object]'!



Den mandag den 2. november 2015 kl. 11.11.35 UTC+1 skrev Brian Pedersen:
>
> Thank you Gortug for making my aware of the isNative attribute. 
> Unfortunately the cast issue remains.
>
> I have taken the example from the new jsinterop doc, and modified it to 
> illustrate this: 
> https://github.com/bitwerk/jspoc/tree/master/src/main/java/com/acme
>
> // in Java
> package com.acme;
>
> @JsType(isNative = true)
> interface Foo {
> }
>
> @JsType(isNative = true)
> class Baz implements Foo{
>   public int qux;
> }
>
> class Bar {
>   @JsMethod
>   public static int action(Foo foo) {
> Baz baz = (Baz) foo;
> return baz.qux;
>   }
> }
>
> // in JavaScript
>
> var baz = { qux: 42 };
> com.acme.Bar.action(baz); // will return 42!
>
> The image below demonstrates the issue at runtime.
>
>
> <https://lh3.googleusercontent.com/-9z2t_Q8R0oI/Vjc1qBoQgfI/BEc/CAbDBqNfUZc/s1600/debugger3.png>
>
>
> I can't seem to find anywhere inside the generated javascript, where a 
> class literal is assigned to the value 33.
>
> /Brian
>
> Den torsdag den 29. oktober 2015 kl. 09.37.48 UTC+1 skrev Goktug Gokdogan:
>>
>> You can only implement java contract (e.g. PayLoad class) in javascript 
>> if they are marked as isNative. See the related section in the new 
>> jsinterop doc.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop: Casting native javascript objects in gwt

2015-11-02 Thread Brian Pedersen
Thank you Gortug for making my aware of the isNative attribute. 
Unfortunately the cast issue remains.

I have taken the example from the new jsinterop doc, and modified it to 
illustrate 
this: https://github.com/bitwerk/jspoc/tree/master/src/main/java/com/acme

// in Java
package com.acme;

@JsType(isNative = true)
interface Foo {
}

@JsType(isNative = true)
class Baz implements Foo{
  public int qux;
}

class Bar {
  @JsMethod
  public static int action(Foo foo) {
Baz baz = (Baz) foo;
return baz.qux;
  }
}

// in JavaScript

var baz = { qux: 42 };
com.acme.Bar.action(baz); // will return 42!

The image below demonstrates the issue at runtime.




I can't seem to find anywhere inside the generated javascript, where a 
class literal is assigned to the value 33.

/Brian

Den torsdag den 29. oktober 2015 kl. 09.37.48 UTC+1 skrev Goktug Gokdogan:
>
> You can only implement java contract (e.g. PayLoad class) in javascript if 
> they are marked as isNative. See the related section in the new jsinterop 
> doc.
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop: Casting native javascript objects in gwt

2015-11-02 Thread Brian Pedersen
 I hate not being able to edit my posts on google groups :)

The comment "// will return 42!" should have contained "// Should return 
42, but throws 'Uncaught [object Object]'!"

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop: Casting native javascript objects in gwt

2015-10-26 Thread Brian Pedersen
Ahhh, I just realized that the new annotations are in a different 
package, jsinterop.annotations instead of com.google.gwt.core.client.js :)

/Brian

Den mandag den 26. oktober 2015 kl. 12.18.21 UTC+1 skrev Brian Pedersen:
>
> I am using GWT 2.8.0-SNAPSHOT, but the new annotations does not work for 
> me.
>
> I tried using @JsType(namespace = "acme", name = "MyJavaScriptObject"), 
> as described in the new version of the JsInterop document, but apparently 
> the namespace and name attributes are not there in the jar file.
> Same thing with the @JsExport and @JsNamespace, I currently have to use 
> them or things stop working.
>
> My gwt-user-2.8.0-SNAPSHOT.jar, which contains the annotations, is from 
> today.
>
> This is the pom I am using: 
> https://github.com/bitwerk/jspoc/blob/master/pom.xml
>
> /Brian
>  
> Den mandag den 26. oktober 2015 kl. 11.43.32 UTC+1 skrev Thomas Broyer:
>>
>> You may want to use GWT 2.8.0-SNAPSHOT and the new JsInterop annotations; 
>> as your usecase maybe is just not supported with the "old" annotations.
>>
>> On Monday, October 26, 2015 at 11:10:28 AM UTC+1, Brian Pedersen wrote:
>>>
>>> I have a dispatch method, exposed through JsInterop, which can take 
>>> various kinds of payloads.
>>>
>>> Once called from native javascript, I need to cast the payload, but this 
>>> doesn't quite work as I would like it too.
>>>
>>> Here is a simplified example.
>>>
>>> *GWT:*
>>> @JsExport
>>> @JsType
>>> @JsNamespace("foo")
>>> public class Dispatcher {
>>> public String dispatch(String action, Payload payload){
>>> if("action1".equals(action))
>>> return dispatchWithCast(payload);
>>> return "Unknown action: " + action;
>>> }
>>> public String dispatchWithCast(Payload payload){
>>> ConcretePayload w = (ConcretePayload) payload;
>>> return w.foo;
>>> }
>>> }
>>>
>>> @JsExport
>>> @JsType
>>> public class Payload {}
>>>
>>> @JsExport
>>> @JsType
>>> public class ConcretePayload extends Payload {
>>> public String foo;
>>> public int bar;
>>> }
>>>
>>> *Javascript:*
>>> var test = new foo.Dispatcher();
>>> alert("Dispatch: " + test.dispatch("action1", {"foo": "a", "bar": 2})); 
>>> // Uncaught java.lang.ClassCastException
>>>
>>> Everything works just fine if I replace the Payload type in the 
>>> Dispatcher class with ConcretePayload, and removes the cast.
>>>
>>> I guess this this may be beyond the capabilities of the transpiler, I 
>>> just need to figure out an alternative approach.
>>>
>>> Any ideas?
>>>
>>> (By the way, I am using the sso linker.)
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


JsInterop: Casting native javascript objects in gwt

2015-10-26 Thread Brian Pedersen
I have a dispatch method, exposed through JsInterop, which can take various 
kinds of payloads.

Once called from native javascript, I need to cast the payload, but this 
doesn't quite work as I would like it too.

Here is a simplified example.

*GWT:*
@JsExport
@JsType
@JsNamespace("foo")
public class Dispatcher {
public String dispatch(String action, Payload payload){
if("action1".equals(action))
return dispatchWithCast(payload);
return "Unknown action: " + action;
}
public String dispatchWithCast(Payload payload){
ConcretePayload w = (ConcretePayload) payload;
return w.foo;
}
}

@JsExport
@JsType
public class Payload {}

@JsExport
@JsType
public class ConcretePayload extends Payload {
public String foo;
public int bar;
}

*Javascript:*
var test = new foo.Dispatcher();
alert("Dispatch: " + test.dispatch("action1", {"foo": "a", "bar": 2})); 
// Uncaught java.lang.ClassCastException

Everything works just fine if I replace the Payload type in the Dispatcher 
class 
with ConcretePayload, and removes the cast.

I guess this this may be beyond the capabilities of the transpiler, I just 
need to figure out an alternative approach.

Any ideas?

(By the way, I am using the sso linker.)

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop: Casting native javascript objects in gwt

2015-10-26 Thread Brian Pedersen
I am using GWT 2.8.0-SNAPSHOT, but the new annotations does not work for me.

I tried using @JsType(namespace = "acme", name = "MyJavaScriptObject"), as 
described in the new version of the JsInterop document, but apparently the 
namespace and name attributes are not there in the jar file.
Same thing with the @JsExport and @JsNamespace, I currently have to use 
them or things stop working.

My gwt-user-2.8.0-SNAPSHOT.jar, which contains the annotations, is from 
today.

This is the pom I am using: 
https://github.com/bitwerk/jspoc/blob/master/pom.xml

/Brian
 
Den mandag den 26. oktober 2015 kl. 11.43.32 UTC+1 skrev Thomas Broyer:
>
> You may want to use GWT 2.8.0-SNAPSHOT and the new JsInterop annotations; 
> as your usecase maybe is just not supported with the "old" annotations.
>
> On Monday, October 26, 2015 at 11:10:28 AM UTC+1, Brian Pedersen wrote:
>>
>> I have a dispatch method, exposed through JsInterop, which can take 
>> various kinds of payloads.
>>
>> Once called from native javascript, I need to cast the payload, but this 
>> doesn't quite work as I would like it too.
>>
>> Here is a simplified example.
>>
>> *GWT:*
>> @JsExport
>> @JsType
>> @JsNamespace("foo")
>> public class Dispatcher {
>> public String dispatch(String action, Payload payload){
>> if("action1".equals(action))
>> return dispatchWithCast(payload);
>> return "Unknown action: " + action;
>> }
>> public String dispatchWithCast(Payload payload){
>> ConcretePayload w = (ConcretePayload) payload;
>> return w.foo;
>> }
>> }
>>
>> @JsExport
>> @JsType
>> public class Payload {}
>>
>> @JsExport
>> @JsType
>> public class ConcretePayload extends Payload {
>> public String foo;
>> public int bar;
>> }
>>
>> *Javascript:*
>> var test = new foo.Dispatcher();
>> alert("Dispatch: " + test.dispatch("action1", {"foo": "a", "bar": 2})); 
>> // Uncaught java.lang.ClassCastException
>>
>> Everything works just fine if I replace the Payload type in the 
>> Dispatcher class with ConcretePayload, and removes the cast.
>>
>> I guess this this may be beyond the capabilities of the transpiler, I 
>> just need to figure out an alternative approach.
>>
>> Any ideas?
>>
>> (By the way, I am using the sso linker.)
>>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop: Casting native javascript objects in gwt

2015-10-26 Thread Brian Pedersen
It seems the generated 
function 
com_google_gwt_lang_Cast_canCast__Ljava_lang_Object_2Lcom_google_gwt_core_client_JavaScriptObject_2Z
 
only supports strings, maps, numbers and booleans.

function 
com_google_gwt_lang_Cast_canCast__Ljava_lang_Object_2Lcom_google_gwt_core_client_JavaScriptObject_2Z(src_0,
 
dstId){
  return typeof src_0 === 'string' && 
!!com_google_gwt_lang_Cast_stringCastMap[dstId] 
  || src_0.java_lang_Object_castableTypeMap && 
!!src_0.java_lang_Object_castableTypeMap[dstId] 
  || typeof src_0 === 'number' && 
!!com_google_gwt_lang_Cast_doubleCastMap[dstId] 
  || typeof src_0 === 'boolean' && 
!!com_google_gwt_lang_Cast_booleanCastMap[dstId];
}

/Brian

Den mandag den 26. oktober 2015 kl. 13.01.40 UTC+1 skrev Brian Pedersen:
>
> Thank's for pointing that out. So i switched to the new annotations in 
> jsinterop.annotations and activated the new mode with -jsInteropMode JS_RC
> .
>
> The cast still doesn't work though :(
>
> Instead of a java.lang.ClassCastException, I now get a  Uncaught [object 
> Object] during the cast.
> Once again, everything works if I use the concrete type and remove the 
> cast.
>
> POM: https://github.com/bitwerk/jspoc/blob/master/pom.xml
> Javascript: 
> https://github.com/bitwerk/jspoc/blob/master/src/main/webapp/jspoc.html
> GWT: 
> https://github.com/bitwerk/jspoc/tree/master/src/main/java/dk/bitwerk/client
>
> /Brian
>
> Den mandag den 26. oktober 2015 kl. 12.29.21 UTC+1 skrev Jens:
>>
>>
>> I am using GWT 2.8.0-SNAPSHOT, but the new annotations does not work for 
>>> me.
>>>
>>> I tried using @JsType(namespace = "acme", name = "MyJavaScriptObject"), 
>>> as described in the new version of the JsInterop document, but apparently 
>>> the namespace and name attributes are not there in the jar file.
>>> Same thing with the @JsExport and @JsNamespace, I currently have to use 
>>> them or things stop working.
>>>
>>
>> The new annotations have a different package: jsinterop.annotations. 
>> Also @JsExport does not exist anymore in the new JsInterop version, you 
>> just use @JsType.
>>
>> To activate the new annotations you also have to change the JsInterop 
>> mode via -jsInteropMode JS_RC
>>
>>
>> -- J.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop: Casting native javascript objects in gwt

2015-10-26 Thread Brian Pedersen
Thank's for pointing that out. So i switched to the new annotations in 
jsinterop.annotations and activated the new mode with -jsInteropMode JS_RC.

The cast still doesn't work though :(

Instead of a java.lang.ClassCastException, I now get a  Uncaught [object 
Object] during the cast.
Once again, everything works if I use the concrete type and remove the cast.

POM: https://github.com/bitwerk/jspoc/blob/master/pom.xml
Javascript: 
https://github.com/bitwerk/jspoc/blob/master/src/main/webapp/jspoc.html
GWT: 
https://github.com/bitwerk/jspoc/tree/master/src/main/java/dk/bitwerk/client

/Brian

Den mandag den 26. oktober 2015 kl. 12.29.21 UTC+1 skrev Jens:
>
>
> I am using GWT 2.8.0-SNAPSHOT, but the new annotations does not work for 
>> me.
>>
>> I tried using @JsType(namespace = "acme", name = "MyJavaScriptObject"), 
>> as described in the new version of the JsInterop document, but apparently 
>> the namespace and name attributes are not there in the jar file.
>> Same thing with the @JsExport and @JsNamespace, I currently have to use 
>> them or things stop working.
>>
>
> The new annotations have a different package: jsinterop.annotations. Also 
> @JsExport does not exist anymore in the new JsInterop version, you just 
> use @JsType.
>
> To activate the new annotations you also have to change the JsInterop mode 
> via -jsInteropMode JS_RC
>
>
> -- J.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop: Casting native javascript objects in gwt

2015-10-26 Thread Brian Pedersen
I didn't get that quite right, the generated function seem to fail doing 
the lookup in the castableTypeMap, which must be it's way of assuring that 
the types are actually castable to the target type.

Den mandag den 26. oktober 2015 kl. 13.16.21 UTC+1 skrev Brian Pedersen:
>
> It seems the generated 
> function 
> com_google_gwt_lang_Cast_canCast__Ljava_lang_Object_2Lcom_google_gwt_core_client_JavaScriptObject_2Z
>  
> only supports strings, maps, numbers and booleans.
>
> function 
> com_google_gwt_lang_Cast_canCast__Ljava_lang_Object_2Lcom_google_gwt_core_client_JavaScriptObject_2Z(src_0,
>  
> dstId){
>   return typeof src_0 === 'string' && 
> !!com_google_gwt_lang_Cast_stringCastMap[dstId] 
>   || src_0.java_lang_Object_castableTypeMap && 
> !!src_0.java_lang_Object_castableTypeMap[dstId] 
>   || typeof src_0 === 'number' && 
> !!com_google_gwt_lang_Cast_doubleCastMap[dstId] 
>   || typeof src_0 === 'boolean' && 
> !!com_google_gwt_lang_Cast_booleanCastMap[dstId];
> }
>
> /Brian
>
> Den mandag den 26. oktober 2015 kl. 13.01.40 UTC+1 skrev Brian Pedersen:
>>
>> Thank's for pointing that out. So i switched to the new annotations in 
>> jsinterop.annotations and activated the new mode with -jsInteropMode 
>> JS_RC.
>>
>> The cast still doesn't work though :(
>>
>> Instead of a java.lang.ClassCastException, I now get a  Uncaught [object 
>> Object] during the cast.
>> Once again, everything works if I use the concrete type and remove the 
>> cast.
>>
>> POM: https://github.com/bitwerk/jspoc/blob/master/pom.xml
>> Javascript: 
>> https://github.com/bitwerk/jspoc/blob/master/src/main/webapp/jspoc.html
>> GWT: 
>> https://github.com/bitwerk/jspoc/tree/master/src/main/java/dk/bitwerk/client
>>
>> /Brian
>>
>> Den mandag den 26. oktober 2015 kl. 12.29.21 UTC+1 skrev Jens:
>>>
>>>
>>> I am using GWT 2.8.0-SNAPSHOT, but the new annotations does not work for 
>>>> me.
>>>>
>>>> I tried using @JsType(namespace = "acme", name = "MyJavaScriptObject"), 
>>>> as described in the new version of the JsInterop document, but apparently 
>>>> the namespace and name attributes are not there in the jar file.
>>>> Same thing with the @JsExport and @JsNamespace, I currently have to use 
>>>> them or things stop working.
>>>>
>>>
>>> The new annotations have a different package: jsinterop.annotations. 
>>> Also @JsExport does not exist anymore in the new JsInterop version, you 
>>> just use @JsType.
>>>
>>> To activate the new annotations you also have to change the JsInterop 
>>> mode via -jsInteropMode JS_RC
>>>
>>>
>>> -- J.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


[gwt-contrib] Re: Voice of the GWT Committee???

2015-10-15 Thread Brian Pedersen
+1 all the way.

I use every chance I have to spread the word about the changes JS Interop 
will bring to the web, but the apparent lack of engagement in the community 
from the people driving GWT, is giving me second thoughts.

The official blog used to be OK, but that changed when google open sourced 
it, and now the closest you get to official information is 6 months old 
videos on youtube.

I believe this is already driving people away from GWT, at a time where we 
should be getting people back, drawn by the awesomeness of GWT 3.0.


Den onsdag den 14. oktober 2015 kl. 21.51.57 UTC+2 skrev JonL:
>
> We've been using GWT for a long time.  There was some trepidation when 
> Google moved GWT into the open source realm and the steering committee was 
> announced.  A lot of good things are happening.  I see a lot of movement 
> here and there, but some of it appears as if it is un-directed and 
> un-coordinated.  Without joining like 15 different groups, it seems 
> impossible to get a full understanding of what is happening in GWT.  As a 
> project that is currently utilized by projects of many levels, I think the 
> only thing that keeps GWT at the forefront of anyones mind at this time has 
> more to do with inertia than anything else.  The closest thing that I can 
> come by, which appears to pull the disparate parts of GWT community 
> together is gwtdaily.com blog, but there is no indication how that is 
> run, it is not linked between any of the other gwt sites
>
> So here's my questions:
>
> Are there any plans to create a "Voice of GWT" presence anywhere which 
> could act as a goto location to view progress, like the old GWT blog?
>
> Besides each steering committee member advocating GWT as used in their 
> paradigm, is there anyone who is considered the advocate for just GWT 
> itself.  IE Vaadin promotes Vaadin, ArcBees promotes GWT-P and their 
> various GWT projects, Sencha promotes GXT, who is going out and saying, 
> lets just use GWT?
>
> I think if there was one person who was acting as part of the GWT steering 
> committee as that advocate that had a blog and was able to take the time to 
> bring all the disparate threads together to present a overall view of the 
> current development plan and future of GWT and status of the major efforts 
> under the various tents, I think that would go a long way to assuaging many 
> peoples fears that GWT is dying out and becoming irrelevant.
>
> Or even just a central blog where members of the committee would commit to 
> posting regularly.  The Google+ community is good, but I see as more of a 
> discussion board and not just the platform where the community can announce 
> things.
>
> The format of gwtdaily.com is good and I see that people can submit posts 
> to it so that might be a good location, I believe it is run by a 
> contributor/committee member, but it doesn't appear official and has no 
> links from the official GWT sites.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/67e4bbca-8394-46a2-aa78-c4a76cbcee2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: JsInterop hello world

2015-09-17 Thread Brian Pedersen
It all makes perfectly sense now, thank's a lot for taking your time to 
clarify your findings.

I like the concept of the sso linker, a pity it doesn't work with super dev 
mode yet. 
Using JsInterop with the xsiframe linker in super dev mode works equally 
bad for me, but maybe that's just me messing things up ;)

For some reason, I can't build your code with the 2.8.0-SNAPSHOT version of 
the gwt-maven-plugin.
I can check out and build the plugin sucessfully, but then when I build 
your projects, it apparently tries to resolve the gwt dependencies through 
the nexus.codehaus.org repository and fails.

But it all works perfectly when I build it with the 2.7.0 version of the 
gwt-maven-plugin, as long as I run it with jetty:run and not gwt:run.

What are your reasons for using the 2.8.0 version of the gwt-maven-plugin?

Thanks ...
/Brian


Den torsdag den 17. september 2015 kl. 10.02.13 UTC+2 skrev Cristiano:
>
> Update:
>
> with the sso linker the project responds as expected: the GWT code is 
> available as soon as page has loaded
>
> You could check it out on this branch:
> https://github.com/cristcost/jspoc/tree/test_with_sso
>
> note that: 
> - with sso linker super dev mode don't work (I've worked manually 
> compiling javascript and testing the compiled code directly)
> - sso works only if you have exactly one permutation, and to obtain 
> exactly 1 permutation I've removed inheritance of 
> 'com.google.gwt.user.User' module (in fact your example was not using 
> anything from that module)
>
>
>
>
>
> Il giorno giovedì 17 settembre 2015 09:18:34 UTC+2, Cristiano ha scritto:
>>
>> Hi Brian,
>>
>> I had problems similar to you when studying JsInterop, so I've tried your 
>> code.
>> I've forked your repo (see https://github.com/cristcost/jspoc) and I 
>> have made it work but with some considerations to take into account.
>> Other than the problems on using JsInterop annotations as reported by 
>> Jens, I've found a script load timing issue:
>> you execute the the Javascript code in the main page script, but at that 
>> point GWT has not yet loaded!
>>
>> Putting the execution of your javascript code inside window.onload event 
>> is not again enough: I think this is because of using the xsiframe linker 
>> (I'm curious to try out with the sso linker).
>> So I have used a 3 seconds timeout... 
>>
>> In the fork I've added some console logging to outline the time each part 
>> of the Javascript is executed, and the order is:
>> - first javascript inside main html page is executed
>> - then javascript inside the window.onload
>> - finally the GWT entry point
>>
>> Your javascript code, with the fixes suggested by Jens, has worked after 
>> a 3 seconds timeout.
>>
>> Of course I don't like this workaround, but a more general approach could 
>> be to have your application started from the GWT entry point (i.e. define a 
>> "main" function in javascript, then run it from GWT entry point). If you 
>> don't like the ping-pong between JS and GWT, you may try different solution 
>> to detect when GWT has loaded, or - if the problem is the xsiframe linker - 
>> try another linker.
>>
>>
>> Please note that I've changed totally the pom.xml and copied 
>> configuration from one of mines: in particular I have added a configuration 
>> for maven-jetty-plugin, 
>> so to try it out you need can execute the following commands:
>>
>> git clone https://github.com/cristcost/jspoc.git
>> cd jspoc
>> mvn clean install
>> mvn jetty:run
>>
>>
>> After this you should be able to open your browser at 
>> http://localhost:/ and you should see the alert popup (but 3 seconds 
>> after the page load!)
>>
>> Hope this is helpful,
>>
>> Cristiano
>>
>>
>> PS. I'm using gwt 2.8.0-SNAPSHOT and also gwt-maven-plugin 2.8.0-SNAPSHOT 
>> that I have compiled personally, so I don't have added the repo on the 
>> pom.xml,
>> you should re-add it from your pom.xml or compile the two by yourself. 
>> The gwt-maven-plugin 2.8.0-SNAPSHOT is available at 
>> https://github.com/gwt-maven-plugin/gwt-maven-plugin and I compile it 
>> skipping the tests with
>>
>>  mvn clean install -DskipTests 
>>
>>
>>
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop hello world

2015-09-16 Thread Brian Pedersen
Thank's Jens, your help is much appreciated. For now I will definitely go 
for a no-renaming approach.

It must be something with the way I run my code server.

I still get the same error, and when I inspect the generated javascript in 
my browser, it still has the obfuscated format. 
The generated javascript in the war file however, looks much better.

Maybe I just need to get the configuration of my gwt-maven-plugin right.

Thanks...
/Brian

Den tirsdag den 15. september 2015 kl. 23.32.36 UTC+2 skrev Jens:
>
> Ok just played a bit and its like the following:
>
>
> @JsExport // value attribute is ignored here, probably because it acts as 
> a shortcut to apply @JsExport to any static member
> @JsType // required so you also have exported instance members (your 
> sayHello method) and not just static members
> @JsNamespace("poc") // the default namespace, should probably go in a 
> package-info.java file
> public class JsHello {
>  public String sayHello(String name) {
>return "Hello " + name;
>  }
> }
>
> With the above you can do
>
>   
> var hello = new poc.JsHello(); hello.sayHello("World");
>
>
> If you want to rename JsHello to Hello you do
>
> @JsExport
> @JsType
> public class JsHello {
>  
>  @JsExport("poc.Hello") // replaces any @JsNamespace default value so you 
> need to add namespace here
>  public JsHello() {}
>  
>  public String sayHello(String name) {
>return "Hello " + name;
>  }
> }
>
>
> I would try to avoid renaming, as you must repeat the namespace in 
> @JsExport. Just name your classes correctly and stick with the first 
> example with @JsNamespace in a package-info.java file.
>
> -- J.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


Re: JsInterop hello world

2015-09-15 Thread Brian Pedersen
That didn't seem to make much of a difference, the generated javascript 
still have the wrong identifiers, and the error message is the same :(

I wonder if there is something wrong with my build, it looks to me as if 
the annotations are ignored.
I know that I run gwt 2.8, as I did a lambda to verify that, and I can see 
that the code server is started with '-XjsInteropMode, JS'.

Could I simplify it further, by removing the namespace or something?

Thanks ...

/Brian

Den tirsdag den 15. september 2015 kl. 14.46.01 UTC+2 skrev Brian Pedersen:
>
> So I am doing my first baby-steps in JsInterop, exposing a Java class to 
> javascript, and I can't seem to figure out what I am doing wrong.
>
> *My java class looks like this:*
> @JsExport("poc.Hello") 
> public class JsHello  {
>   public String sayHello(String name) {
> return "Hello " + name;
>   }
> }
>
> *And the javascript in my host page like this:*
> var obj = new poc.Hello();
> alert(obj.sayHello("there"));
>
> *My browser complains about 'poc' being undefined:*
> Uncaught ReferenceError: poc is not defined
>
> *Which is understandable, when looking at the implementation generated:*
> _.sayHello_0_g$ = function Cyb_g$(name_0_g$){
>   return 'Hello ' + name_0_g$;
> }
> ;
> var Ldk_bitwerk_client_JsHello_2_classLit_0_g$ = cDb_g$(
> 'dk.bitwerk.client', 'JsHello', 428, Ljava_lang_Object_2_classLit_0_g$);
>
> I have tried all sorts of things, such using the real package/class name 
> inside @JsExport, omiting the package/class name inside @JsExport and 
> adding @JsType to the class declaration.
> I have also tried annotating a constructor instead of the class.
>
> I am running gwt-2.8.0-snapshot with jsInteropMode=JS, and I have 
> committed the code here: https://github.com/bitwerk/jspoc
>
> Any help will be much appreciated ...
>
> /Brian
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


JsInterop hello world

2015-09-15 Thread Brian Pedersen
So I am doing my first baby-steps in JsInterop, exposing a Java class to 
javascript, and I can't seem to figure out what I am doing wrong.

*My java class looks like this:*
@JsExport("poc.Hello") 
public class JsHello  {
  public String sayHello(String name) {
return "Hello " + name;
  }
}

*And the javascript in my host page like this:*
var obj = new poc.Hello();
alert(obj.sayHello("there"));

*My browser complains about 'poc' being undefined:*
Uncaught ReferenceError: poc is not defined

*Which is understandable, when looking at the implementation generated:*
_.sayHello_0_g$ = function Cyb_g$(name_0_g$){
  return 'Hello ' + name_0_g$;
}
;
var Ldk_bitwerk_client_JsHello_2_classLit_0_g$ = cDb_g$('dk.bitwerk.client', 
'JsHello', 428, Ljava_lang_Object_2_classLit_0_g$);

I have tried all sorts of things, such using the real package/class name 
inside @JsExport, omiting the package/class name inside @JsExport and 
adding @JsType to the class declaration.
I have also tried annotating a constructor instead of the class.

I am running gwt-2.8.0-snapshot with jsInteropMode=JS, and I have committed 
the code here: https://github.com/bitwerk/jspoc

Any help will be much appreciated ...

/Brian

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@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.


[gwt-contrib] GWT 3 info on GWT CON?

2015-09-14 Thread Brian Pedersen
I am really looking forward to GWT CON in November, but so far no talks has 
been announced on GWT 3 related topics.

I know that the blueprint are still in flux, but I also have a feeling that 
the core team knows exactly which direction they are pushing GWT.

My biggest wish is to see a continuation of the GWT meetup talk Modernizing 
GWT Applications 
,
 
going even more in to details on how we can use GWT 2.8 and JsInterop to 
prepare for GWT 3.0. 

See you there ... :)

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/4789c00b-0caf-4b5e-93df-f32e7760b17e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Eclipse Mars + GWT Plugin?

2015-08-26 Thread Brian Pedersen
I use this one with 
Mars: http://gwt-plugins.github.io/documentation/index.html. 
I used it for a few weeks and it works really well, but as I have had 
stability issues with Mars, I have just reverted to Luna.

There is a recent video also, about the work being done to the eclipse 
plugin: 
https://www.youtube.com/watch?v=xq1NTzrXGWIindex=7list=PL1yReUCGwGvrqscLu1EAyYRPrr0ceEHLE

/Brian

Den torsdag den 27. august 2015 kl. 03.18.51 UTC+2 skrev Magnus:

 Hi,

 I want to install Eclipse Mars (4.5) with the GWT plugin.
 But the latest version of the plugin is for Eclipse Luna (4.4).
 Furthermore, the GWT plugin for Eclipse Luna contains GWT 2.6.0, not 2.7.0.

 What is the recommended combination?

 Thanks
 Magnus


-- 
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+unsubscr...@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.


Re: Starting with programming

2015-08-18 Thread Brian Pedersen
I have been working with Java for more than 15 years and I absolutely love 
it. I believe however that Java is no longer suitable for beginners.

As a beginner you can learn a lot about programming from the official Java 
tutorials, as well as from well written books, but once you enter the 
'real' world, Java is very much about plumbing, requiring extensive 
knowledge about all sorts of api's and tools. 

Javascript on the other hand, is a lot more versatile today than it used to 
be and increasingly popular. With Javascript you can do anything from web 
front-ends to apps and backend logic, without all the plumbing of Java.

My advice would be to start out looking at some Javascript tutorials, and 
see where that takes you. https://www.codecademy.com/tracks/javascript 
looks like pretty good place to start.

At some point you will probably have to look into HTML and CSS also, but to 
begin with, you can get pretty far with Javascript only.

Good luck ...

/Brian

Den mandag den 17. august 2015 kl. 01.37.16 UTC+2 skrev nick belterman:

 I would like to get started with programming. does anyone know good 
 software that is good for learning. BTW i am 14.


-- 
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+unsubscr...@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.


Re: GWT 3.0 Roadmap?

2015-03-13 Thread Brian Pedersen
I believe 2.8 will be first: http://gwtcreate.com/videos/index.html#keynote

/Brian

Den onsdag den 17. september 2014 kl. 16.07.14 UTC+2 skrev Martin Kersten:

 Hi There,

I am wondering what the current status of GWT 3.0 is. Is it already in 
 the making? Are there any release dates for GWT 3.0 - Beta, Mx or RC1?


 Cheers,

 Martin (Kersten)


-- 
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+unsubscr...@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.


Re: Singular (Angular for crossplatform) talk at GWT.create

2015-02-07 Thread Brian Pedersen
Looks amazing.

When can we get our hands on Singular?

/Brian


Den lørdag den 7. februar 2015 kl. 14.25.57 UTC+1 skrev Daniel Kurka:

 Hi all,

 here is me talking about Singular at GWT.create: 
 http://gwtcreate.com/videos/index.html#singular

 -Daniel


-- 
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+unsubscr...@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.