Elemental2 and JsInterop base beta releases available.

1340 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