Elemental2 and JsInterop base beta releases available.

1311 views
Skip to first unread message

Julien Dramaix

unread,
Apr 5, 2017, 5:42:52 PM4/5/17
to google-web-toolkit-contributors


The beta version of Elemental2 using the JsInterop specification has been released on Sonatype today and is available on Maven central.


This release introduces the concept of union types (which are heavily used in JavaScript) and many more improvements. More information about union types can be found in this document.


We also split Elemental into smaller jar files:


Jar file

artifact-id

GWT module

elemental2-core.jar

elemental2-core

elemental2.core.Core

elemental2-promise.jar

elemental2-promise

elemental2.promise.Promise

elemental2-dom.jar

elemental2-dom

elemental2.dom.Dom

elemental2-svg.jar

elemental2-svg

elemental2.svg.Svg

elemental2-webgl.jar

elemental2-webgl

elemental2.webgl.WebGl

elemental2-media.jar

elemental2-media

elemental2.media.Media

elemental2-indexeddb.jar

elemental2-indexeddb

elemental2.indexeddb.IndexedDb

elemental2-webstorage.jar

elemental2-webstorage

elemental2.webstorage.WebStorage



You can try them by downloading the jar files or adding Maven dependencies:


<dependency>

 <groupId>com.google.elemental2</groupId>

 <artifactId>${artifact-id}</artifactId>

 <version>1.0.0-beta-1</version>

</dependency>


Then inherit the right gwt module in your gwt.xml file.


This beta version works only with the latest HEAD_SNAPSHOT release of GWT.


We’ve also released a beta version of JsInterop.base. This library contains base classes and utilities that provide access to JavaScript language constructs that are not available in pure Java.


You can try it by downloading the jar file or use the following Maven dependency:


<dependency>

 <groupId>com.google.jsinterop</groupId>

 <artifactId>base</artifactId>

 <version>1.0.0-beta-1</version>

</dependency>


Don’t hesitate to report any bugs, issues, concerns you have on this mailing list.


Important note: They are beta releases and future updates (up until the final release) may break code!  


-Julien


--

Julien Dramaix | Software Engineer | dra...@google.com | 650-750-6053

Brandon Donnelson

unread,
Apr 5, 2017, 5:43:50 PM4/5/17
to google-web-toolkit-contributors
Nice job!

--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABXeq2QsTarhDKbYmz0y1SOrjpuFNdoNmAnvAYKacO1f4rLcLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
Brandon Donnelson
GXT Support Engineer

James Nelson

unread,
Apr 5, 2017, 5:46:21 PM4/5/17
to GWT Contributors
Huzzah!!

I'll be taking this for a spin on my week off; see if I can make custom elements completely hack free (at long last)!

Many thanks good sirs.

Alain Ekambi

unread,
Apr 5, 2017, 5:49:26 PM4/5/17
to google-web-tool...@googlegroups.com
DOPE !!!!!

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/1ce76a70-bb1d-42a6-adc4-8bc31526644d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Alain Ekambi

Co-Founder

Ahomé Innovation Technologies

http://www.ahome-it.com/

Predrag Remark

unread,
Apr 6, 2017, 1:14:42 AM4/6/17
to GWT Contributors
Great news ! Thanks Julien.

Ali Jalal

unread,
Apr 6, 2017, 2:59:29 AM4/6/17
to google-web-tool...@googlegroups.com
Thank you guys for this great work.

On Thu, Apr 6, 2017 at 8:44 AM, Predrag Remark <codeless...@gmail.com> wrote:
Great news ! Thanks Julien.

--
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+unsubscribe@googlegroups.com.

David Yu

unread,
Apr 6, 2017, 5:47:20 AM4/6/17
to google-web-tool...@googlegroups.com
On Thu, Apr 6, 2017 at 5:42 AM, 'Julien Dramaix' via GWT Contributors <google-web-tool...@googlegroups.com> wrote:


The beta version of Elemental2 using the JsInterop specification has been released on Sonatype today and is available on Maven central.

Better late than never I guess :-) 
--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
When the cat is away, the mouse is alone.
- David Yu

James Horsley

unread,
Apr 6, 2017, 2:44:14 PM4/6/17
to google-web-tool...@googlegroups.com
Wonderful news. Thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.



--
When the cat is away, the mouse is alone.
- David Yu

--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAOkdovKQn1wo%2BR2jrZ3iGrh4ko199_bt6%3DUC-Xd_HYUc%2B65-Yw%40mail.gmail.com.

Jens

unread,
Apr 6, 2017, 6:17:57 PM4/6/17
to GWT Contributors
Hmm, I have just built gwt head from source and used the above jars but SDM tells me:

 Errors in jsinterop/base/Js.java
     [ERROR] Line 56: JsProperty 'void Js.debugger()' should have a correct setter or getter signature.


Can anyone confirm?


-- J.

Julien Dramaix

unread,
Apr 6, 2017, 6:33:52 PM4/6/17
to GWT Contributors
good catch! It's a bug in GWT. Roberto is fixing it and will propose a patch for that. 


--
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-co...@googlegroups.com.

Ignacio Baca Moreno-Torres

unread,
Apr 6, 2017, 6:35:11 PM4/6/17
to GWT Contributors
Yep, same problem here https://github.com/ibaca/dndfiles-gwt. BUT! if you compile GWT do not fails, only throws this error the codeserver.

Anyway, good work! independent libs and specially base lib are really good news! thanks.

Roberto Lublinerman

unread,
Apr 6, 2017, 7:57:44 PM4/6/17
to google-web-tool...@googlegroups.com
We relaxed restriction checking to allow void return type from getters. 

Cl is up for review:

--
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+unsubscribe@googlegroups.com.

Ignacio Baca Moreno-Torres

unread,
Apr 13, 2017, 4:42:02 PM4/13/17
to GWT Contributors
Hi, a question about JsPropertyMap.

It does not have a keys() method, ideally using Object.keys, this is on purpose?
And, the unique method to obtain the keys is the forEach method, but current implementation iterates over all properties wich might be dangerous, why this method do not use Object.keys or isOwnProperty? 

Thanks!

Goktug Gokdogan

unread,
Apr 13, 2017, 4:53:30 PM4/13/17
to google-web-toolkit-contributors
jsinterop.base doesn't try to replace elemental, just provide methods that would normally require special syntax in js. You can find Object.keys in the related elemental class (JsObject)

On Thu, Apr 13, 2017 at 1:42 PM, Ignacio Baca Moreno-Torres <ign...@bacamt.com> wrote:
Hi, a question about JsPropertyMap.

It does not have a keys() method, ideally using Object.keys, this is on purpose?
And, the unique method to obtain the keys is the forEach method, but current implementation iterates over all properties wich might be dangerous, why this method do not use Object.keys or isOwnProperty? 

Thanks!

On Friday, April 7, 2017 at 1:57:44 AM UTC+2, Roberto Lublinerman wrote:
We relaxed restriction checking to allow void return type from getters. 

Cl is up for review:
On Thu, Apr 6, 2017 at 3:17 PM, Jens <jens.ne...@gmail.com> wrote:
Hmm, I have just built gwt head from source and used the above jars but SDM tells me:

 Errors in jsinterop/base/Js.java
     [ERROR] Line 56: JsProperty 'void Js.debugger()' should have a correct setter or getter signature.


Can anyone confirm?


-- J.

--
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+unsu...@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

Ignacio Baca Moreno-Torres

unread,
Apr 14, 2017, 4:05:15 PM4/14/17
to GWT Contributors
Elemental 1 has this goal (http://www.gwtproject.org/articles/elemental.html):
Elemental also includes high-performance collections and a new JSON library. These libraries work equally well in a browser or in a server (JVM) environment.
Is this still true for elemetal2? I use JsInterop to define DTOs, they area easy and clean, but collections are still a small problem, if elemental solve this will be awesome, but not sure if this is going to be true. New union types can be influenced to be used easily in the JVM too if this is true (I mean, that elemental2 should take care of collections in the browser and the server).

On Thursday, April 13, 2017 at 10:53:30 PM UTC+2, Goktug Gokdogan wrote:
jsinterop.base doesn't try to replace elemental, just provide methods that would normally require special syntax in js. You can find Object.keys in the related elemental class (JsObject)
On Thu, Apr 13, 2017 at 1:42 PM, Ignacio Baca Moreno-Torres <ign...@bacamt.com> wrote:
Hi, a question about JsPropertyMap.

It does not have a keys() method, ideally using Object.keys, this is on purpose?
And, the unique method to obtain the keys is the forEach method, but current implementation iterates over all properties wich might be dangerous, why this method do not use Object.keys or isOwnProperty? 

Thanks!

On Friday, April 7, 2017 at 1:57:44 AM UTC+2, Roberto Lublinerman wrote:
We relaxed restriction checking to allow void return type from getters. 

Cl is up for review:
On Thu, Apr 6, 2017 at 3:17 PM, Jens <jens.ne...@gmail.com> wrote:
Hmm, I have just built gwt head from source and used the above jars but SDM tells me:

 Errors in jsinterop/base/Js.java
     [ERROR] Line 56: JsProperty 'void Js.debugger()' should have a correct setter or getter signature.


Can anyone confirm?


-- J.

--
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+unsubscribe@googlegroups.com.

Jens

unread,
Apr 14, 2017, 4:59:27 PM4/14/17
to GWT Contributors
Is this still true for elemetal2? I use JsInterop to define DTOs, they area easy and clean, but collections are still a small problem, if elemental solve this will be awesome, but not sure if this is going to be true. New union types can be influenced to be used easily in the JVM too if this is true (I mean, that elemental2 should take care of collections in the browser and the server).

So far elemental2 does not do any magic. It is just JsInterop for browser APIs. IMHO it is fine that elemental2 is small and focused. Anything else should be developed in separate projects.

-- J.

Thomas Broyer

unread,
Apr 15, 2017, 3:35:42 AM4/15/17
to GWT Contributors
Elemental 1 won't be retired until we have a replacement for elemental.json and possibly "lightweight collections". Could possibly be as easy as moving them to their own project.

Daniel Harezlak

unread,
May 9, 2017, 7:03:00 AM5/9/17
to GWT Contributors
HI, what are the replacements for elemental2.Global.window and similar in this new release?

Thomas Broyer

unread,
May 9, 2017, 7:03:41 AM5/9/17
to GWT Contributors


On Tuesday, May 9, 2017 at 1:03:00 PM UTC+2, Daniel Harezlak wrote:
HI, what are the replacements for elemental2.Global.window and similar in this new release?

elemental2.DomGlobal.window (in elemental2-dom dependency) 

Daniel Harezlak

unread,
May 9, 2017, 8:02:40 AM5/9/17
to GWT Contributors
Thanks!

Another inconsistency with the previous release of elemental2 which broke my code is the use of elemental2.core.Function for the onreadystatechange field in the elemental2.dom.XMLHttpRequest type which prevents providing the function as a lambda. Other function fields in the mentioned type (e.g. onprogress or onloadstart) seem to keep the functional interface semantics. Is this intended or is it an oversight?

Thomas Broyer

unread,
May 9, 2017, 9:02:22 AM5/9/17
to GWT Contributors

Julien Dramaix

unread,
May 9, 2017, 12:38:14 PM5/9/17
to GWT Contributors
Yes, the externs use the Function object as type instead of using a function type like {function():any}.
We'll fix that for the next version.

--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/e1331a22-74f7-4648-b76b-0a2fb43a2dfc%40googlegroups.com.

Julien Dramaix

unread,
May 9, 2017, 5:32:47 PM5/9/17
to GWT Contributors
I forgot to mention: as a workaround, you can create your own JsFunction callback and cast it to Function:
@JsFunction
interface MyJsFunction {
  void onInvoke(....);
  
  default Function asFunction() {
    return (Function) this;
  }
}

Goktug Gokdogan

unread,
May 9, 2017, 6:06:12 PM5/9/17
to google-web-toolkit-contributors
BTW, if you are using elemental2, keep in mind that these are beta releases to get feedback and APIs will keep changing until we finalize it. So be prepared for breakages in releases until we do the final release cut.

To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.

Ignacio Baca Moreno-Torres

unread,
May 10, 2017, 2:30:13 AM5/10/17
to GWT Contributors
Question about OscilatorNode (https://github.com/google/closure-compiler/blob/c77ca197a1f6674e4c267a29a3643a86b61cf51d/externs/browser/w3c_audio.js)

This start method is translated as a "StartCallbackFunction start", should it not be translated as a method directly? This callback field cannot be called so it doesn't work.
/** @param {number=} when */
OscillatorNode.prototype.start = function(when) {};

Thomas Broyer

unread,
May 10, 2017, 3:28:30 AM5/10/17
to GWT Contributors
It was declared as function(number) not long ago: https://github.com/google/closure-compiler/commit/91500d4cd57a608a442ba7466eb015e9ad40afcf
So next version of jsinterop JARs should have it right.

Ignacio Baca Moreno-Torres

unread,
May 10, 2017, 7:55:50 AM5/10/17
to GWT Contributors
I see, thanks!

Paul Stockley

unread,
May 11, 2017, 10:11:28 AM5/11/17
to GWT Contributors
Do you have a general idea for how long the Beta phase will take? Is it predicated on reaching a certain quality level?

Goktug Gokdogan

unread,
May 11, 2017, 6:05:15 PM5/11/17
to google-web-toolkit-contributors
 Is it predicated on reaching a certain quality level

Yes. It needs to be at a point that we can comfortable commit to maintain in the longer term since it will be very like a base for compatibility across different libraries / APIs.
We have some rough corners that we already aware and we hope to discover more as developers play with different APIs.

To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsu...@googlegroups.com.

--
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+unsu...@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

Lars

unread,
May 16, 2017, 2:34:29 AM5/16/17
to GWT Contributors
Looks like the jsinterop generator in on the way :-)

https://github.com/google/jsinterop-generator

Predrag Remark

unread,
May 16, 2017, 8:43:40 AM5/16/17
to GWT Contributors
Great !

Daniel Harezlak

unread,
May 28, 2017, 5:15:17 PM5/28/17
to GWT Contributors
Hi, where did the URL class go? Previously I had it under elemental2.URL.

Daniel Harezlak

unread,
May 29, 2017, 3:15:34 AM5/29/17
to GWT Contributors
Hi,
I just tested it and the asFunction method needs the @JsOverlay annotation for this to compile. After the modification the code works as expected. Thanks!

Marcin Okraszewski

unread,
Jun 1, 2017, 3:37:35 PM6/1/17
to GWT Contributors
Hi,
First of all, thanks for working on this.

I have some doubt if Array really work on double indexes? I know in JS every number is floating point, but still, indexes are logically integers, it would be more natural to work with integers here. Moreover, JsArrayLike interface is using int for interfaces, so it is even not consistent in this respect. 

I mean for instance those methods of Array:

  public native double indexOf(T obj, double fromIndex);

  public native double indexOf(T obj);

While in JsArrayLike 

  default T getAt(int index) 

  default int getLength() 

Marcin

Goktug Gokdogan

unread,
Jun 1, 2017, 4:10:28 PM6/1/17
to google-web-toolkit-contributors
This is a known issue that we will address.

--
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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages