> 1) Can you give a concrete example on how much that cost will lower in 
> comparison with JSNI?
>

It won't lower. You still have to keep things in sync. If the library in 
question uses something like JsDoc you can code a generator to produce the 
Java API.
 

2) Right now I am using JSNI to fill even GWT unimplemented functionality - 
> for example querySelectorAll() 
> <http://www.google.com/url?q=http%3A%2F%2Fwww.w3schools.com%2Fjsref%2Fmet_document_queryselectorall.asp&sa=D&sntz=1&usg=AFQjCNFbjCJZGZLGgpoHrc2XuaF5cialHA>.
>  
> Will that would be possible with JsInterop? or this is an Elemental thingy?
>

Sure, JsInterop and JSNI are not very different. Instead of implementing 
JSNI one-liner methods you only define an interface and put an annotation 
on it. With Java8 there is even the idea that you can put a default method 
in your Jsinterop interface which contains a polyfill implementation. GWT 
will then transparently check if that method natively exists and if not 
call the polyfill code. But I don't know if that is still planned or if 
they expect you to install the polyfill manually.

Elemental 2.0 will be generated against html5index.org (which in turn is 
generated from all kinds of IDLs and spec pages) and thus will allow you to 
access all browser APIs. 


3) If it's an elemental thingy (creating java binidings from IDL) - 
> wouldn't that approach be usable also for other 3rd party js libraries 
> (write an IDL file for each one of them)?
>

Sure. You just need some extra metadata so you know the types returned and 
consumed by JS methods. This can be done through IDL or things like JsDoc. 
For example Vaadin has a JsDoc based generator they have used to generate 
the Polymer integration: https://github.com/vaadin/gwt-api-generator


-- 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to