Elemental 2?

1,395 views
Skip to first unread message

Rene Hangstrup Møller

unread,
Nov 19, 2015, 4:39:20 AM11/19/15
to GWT Contributors
Hi

A year ago I tried to write a tool for generating JsInterop classes from WebIDL, I abandoned the project because there was no good solution for method overloading and constructors back then. I know others have attempted the same.

It looks like the new JsInterop spec solves those problems, so i was considering reviving that project, but I don't want to waste the time if Elemental 2 is going to be released within the next couple of months.

I guess it should be possible to release it as a separate project that can be used from GWT 2.8 and the in the far future J2CL.

Any chance that Elemental 2 will be available shortly or should I build my own?

Best regards
Rene

Bademus l.

unread,
Nov 19, 2015, 5:35:12 AM11/19/15
to GWT Contributors
Hello,
Excellent question!
Please let me put my 2cents: 
I'm interested in Chrome Extension API for GWT, it also can be easily generated from Chrome's IDL.

Goktug Gokdogan

unread,
Nov 19, 2015, 1:04:28 PM11/19/15
to google-web-toolkit-contributors, Julien Dramaix
We have been actively working on a JsInterop generator and Elemental 2.0 in the last month or so.
We will make a separate Elemental release and yes that will be J2CL ready.
However I don't expect it to be released before the next quarter. Also having other tools that are investigating the same problem and coming with its own solutions usually helps us to learn new stuff.

(adding dramaix@, as he is the one who is actively working on this and might provide some feedback as well)

--
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/9d50d507-f79a-4596-a259-a14213f37875%40googlegroups.com.

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

Julien Dramaix

unread,
Nov 20, 2015, 4:32:40 AM11/20/15
to google-web-toolkit-contributors
Yes I'm currently working on Elemental2 and other intersting stuffs around JsInterop. It's a bit to early to communicate something right now. But you can expect to have more news in one or two months.

Julien

James Horsley

unread,
Nov 20, 2015, 4:50:26 AM11/20/15
to google-web-toolkit-contributors
Thanks for the update Julien. Do you know if Elemental2 will be at all backwards compatible with Elemental1? I was trying to decide on whether to use the Elemental1 interfaces for something I'm working on.

Julien Dramaix

unread,
Nov 20, 2015, 5:05:44 AM11/20/15
to GWT Contributors
It's a bit too early to answer to this question with absolute certainty but I don't think I can guarantee the full backward compatibility with the first version of elemental.


On Friday, November 20, 2015 at 10:50:26 AM UTC+1, James Horsley wrote:
Thanks for the update Julien. Do you know if Elemental2 will be at all backwards compatible with Elemental1? I was trying to decide on whether to use the Elemental1 interfaces for something I'm working on.

On Fri, Nov 20, 2015 at 9:32 AM 'Julien Dramaix' via GWT Contributors <google-web-toolkit-contri...@googlegroups.com> wrote:
Yes I'm currently working on Elemental2 and other intersting stuffs around JsInterop. It's a bit to early to communicate something right now. But you can expect to have more news in one or two months.

Julien
On Thu, Nov 19, 2015 at 7:04 PM Goktug Gokdogan <gok...@google.com> wrote:
We have been actively working on a JsInterop generator and Elemental 2.0 in the last month or so.
We will make a separate Elemental release and yes that will be J2CL ready.
However I don't expect it to be released before the next quarter. Also having other tools that are investigating the same problem and coming with its own solutions usually helps us to learn new stuff.

(adding dramaix@, as he is the one who is actively working on this and might provide some feedback as well)
On Thu, Nov 19, 2015 at 2:35 AM, Bademus l. <bad...@gmail.com> wrote:
Hello,
Excellent question!
Please let me put my 2cents: 
I'm interested in Chrome Extension API for GWT, it also can be easily generated from Chrome's IDL.

On Thursday, November 19, 2015 at 10:39:20 AM UTC+1, Rene Hangstrup Møller wrote:
Hi

A year ago I tried to write a tool for generating JsInterop classes from WebIDL, I abandoned the project because there was no good solution for method overloading and constructors back then. I know others have attempted the same.

It looks like the new JsInterop spec solves those problems, so i was considering reviving that project, but I don't want to waste the time if Elemental 2 is going to be released within the next couple of months.

I guess it should be possible to release it as a separate project that can be used from GWT 2.8 and the in the far future J2CL.

Any chance that Elemental 2 will be available shortly or should I build my own?

Best regards
Rene

--
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.

--
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.

James Horsley

unread,
Nov 20, 2015, 5:10:58 AM11/20/15
to GWT Contributors
Makes sense, just thought I'd check. Will look forward to hearing more about it in the coming months. 

Thanks!

On Fri, Nov 20, 2015 at 10:05 AM Julien Dramaix <dra...@google.com> wrote:
It's a bit too early to answer to this question with absolute certainty but I don't think I can guarantee the full backward compatibility with the first version of elemental.


On Friday, November 20, 2015 at 10:50:26 AM UTC+1, James Horsley wrote:
Thanks for the update Julien. Do you know if Elemental2 will be at all backwards compatible with Elemental1? I was trying to decide on whether to use the Elemental1 interfaces for something I'm working on.

On Fri, Nov 20, 2015 at 9:32 AM 'Julien Dramaix' via GWT Contributors <google-web-tool...@googlegroups.com> wrote:
Yes I'm currently working on Elemental2 and other intersting stuffs around JsInterop. It's a bit to early to communicate something right now. But you can expect to have more news in one or two months.

Julien
On Thu, Nov 19, 2015 at 7:04 PM Goktug Gokdogan <gok...@google.com> wrote:
We have been actively working on a JsInterop generator and Elemental 2.0 in the last month or so.
We will make a separate Elemental release and yes that will be J2CL ready.
However I don't expect it to be released before the next quarter. Also having other tools that are investigating the same problem and coming with its own solutions usually helps us to learn new stuff.

(adding dramaix@, as he is the one who is actively working on this and might provide some feedback as well)
On Thu, Nov 19, 2015 at 2:35 AM, Bademus l. <bad...@gmail.com> wrote:
Hello,
Excellent question!
Please let me put my 2cents: 
I'm interested in Chrome Extension API for GWT, it also can be easily generated from Chrome's IDL.

On Thursday, November 19, 2015 at 10:39:20 AM UTC+1, Rene Hangstrup Møller wrote:
Hi

A year ago I tried to write a tool for generating JsInterop classes from WebIDL, I abandoned the project because there was no good solution for method overloading and constructors back then. I know others have attempted the same.

It looks like the new JsInterop spec solves those problems, so i was considering reviving that project, but I don't want to waste the time if Elemental 2 is going to be released within the next couple of months.

I guess it should be possible to release it as a separate project that can be used from GWT 2.8 and the in the far future J2CL.

Any chance that Elemental 2 will be available shortly or should I build my own?

Best regards
Rene

--
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.

--
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.

--
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/9069ea83-8229-46b6-8e1b-cb94f3eebe4a%40googlegroups.com.

Rene Hangstrup Møller

unread,
Nov 20, 2015, 7:14:18 AM11/20/15
to GWT Contributors
Thanks for the update.
Looking forward to seeing what you have been cooking up.
Meanwhile I will revive my own generator project.

/Rene

Stephen Haberman

unread,
Nov 20, 2015, 8:34:05 AM11/20/15
to google-web-toolkit-contributors
Meanwhile I will revive my own generator project.

I'll take the opportunity to hop on a soapbox, but the "closed source/eventually open source" model is a curious trend that I think I've only seen in the GWT community (are their other examples?)...

Musing, it probably stems from Google setting the example with GWT itself, where historically a lot happened internally before being mirrored externally, but it happens a bit for non-Google-GWT projects as well, like the repackaging of GPE, which was closed during initial development (although the result is great, and I really appreciate it), Singular, which is still closed during initial development, now Elemental2. I dunno, I find it curious.

E.g. with Singular, it's like it's being developed like the next Apple phone; we have to be secret about it, not say anything, so we can have an awesome keynote where we surprise the world with how awesome it is.

Granted, I'm sure those keynotes are very fun, but I guess I don't understand, wtf, why not just open source things from day 1? IMO the best case scenario, and most likely, is that you're going to attract early adopters who will a) give you feedback to validate approaches/etc and b) give you free work by tracking down bugs and committing patches.

Keeping things closed source "until they're ready", IMO, stifles the potential contributor/committer pool that's needed for the long term health of an open source project.

I suppose the risk is people writing a 100k LOC production app on a pre-1.0 project, and then they bitch about changes...but hopefully lots of disclaimers and 0.x release points would help mitigate that...

Anyway, that is my soapbox. Or one of them, I guess. :-P Of course, we're all getting this work for free, so everyone is free to do what they please, and I will be very excited and thankful for both Elemental2/Singular when they are available to us.

So please don't read this as "bah, that is dumb", but just as "gentle nudge towards open sourcing sooner, if that's okay, thanks!". :-)

- Stephen



--
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/98a1cb61-aafa-4c80-9c0d-f1a1d4e6bd1d%40googlegroups.com.

Goktug Gokdogan

unread,
Nov 20, 2015, 12:59:10 PM11/20/15
to google-web-toolkit-contributors
Singular is not a Google project and not being developed internally. It is Daniel's personal project and as fas as I know it is already in the open source.

We don't have anything to share for Elemental yet. We are talking with other teams, thinking about alternatives etc. Also when we release, it will not be part of GWT-SDK so there is going be extra work to move the development outside; which doesn't make sense at this stage.

The big things we recently developed for GWT, JsInterop and SuperDevMode and they were all open source from day one.

Stephen Haberman

unread,
Nov 20, 2015, 1:27:30 PM11/20/15
to google-web-toolkit-contributors
Hi Goktug,

That's all true, thanks for providing a counter data point. You're right, the JsInterop design docs/etc. were all out in the open from day 1, which I thought was pretty exiting.

I definitely can't take any credit for providing useful feedback, but I enjoyed seeing the thoughts and process from the community.

So, apologies for the sweeping statement.

- Stephen



Goktug Gokdogan

unread,
Nov 20, 2015, 1:31:07 PM11/20/15
to google-web-toolkit-contributors

Ray Cromwell

unread,
Nov 20, 2015, 3:36:22 PM11/20/15
to google-web-toolkit-contributors
Another thing to consider is that J2CL was developed as a 'bake off', in which multiple prototypes and designs were discussed/looked at (compile from Java with JDT, compile from bytecode, compile using Javac APIs, writing parser by hand, etc) It would have been a bit premature to release any of them as they were all known ahead of time to be throwaways. 

I have a hacky Elemental2 prototype (which is not the official one that Julien is working on), if you want to take it and play around.



Erik Kuefler

unread,
Nov 21, 2015, 4:42:57 PM11/21/15
to GWT Contributors
What's the current thinking regarding JSON in Elemental 2? That part has always been a bit different from the DOM libraries, and I know there was talk a long time back about splitting it out. I've been using Elemental JSON extensively in my projects just to have a JSON library that works in GWT and in JVM, but I've found it to be extremely buggy (mostly in terms of behavior differences between jvm, optimized gwt, and draft mode gwt). Are these bugs worth reporting? Is it all being reworked for Elemental 2?
No worries :)

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.
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.
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.
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.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.

Goktug Gokdogan

unread,
Nov 22, 2015, 1:28:39 AM11/22/15
to google-web-toolkit-contributors
Elemental2 will be just an auto-generated thin wrapper around the browser APIs. Unlike Elemental1, it will not provide a cross platform JSON implementation.

I don't think you need to report compatibility bugs for Elemental1 unless a maintainer steps up and shows interest.

No worries :)

To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@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-co...@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-co...@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-co...@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-co...@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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/aca1d509-2b68-4db9-99a7-0c928d7d6024%40googlegroups.com.

Ray Cromwell

unread,
Nov 22, 2015, 1:45:04 AM11/22/15
to google-web-toolkit-contributors
There could be a separate Json library build with JsInterop. Some of the decisions I made in the design of the original Elemental JSON were made specifically because of DevMode support and GWT optimization internals. Given the unboxing of Double and Boolean, and the elimination of DevMode, the library can be much simpler now and still have a JVM implementation to be portable. 

James Horsley

unread,
Nov 22, 2015, 3:19:25 AM11/22/15
to google-web-tool...@googlegroups.com
When both Elemental2 and JsInterop are released I think that the community will start to innovate on this front and new libraries will pop up on github to address these needs; "if you build it, they will come" and all that.

I know I'm very much looking forward to Elemental2 + Jsinterop as a platform to build on.

dad

unread,
Nov 23, 2015, 4:24:52 AM11/23/15
to google-web-tool...@googlegroups.com
Hi Ray,

We are keenly interested in this. 
How does one get hold of your hacky Elemental2 prototype in order to play with?

Thanks

James Nelson

unread,
Dec 1, 2015, 1:42:23 AM12/1/15
to GWT Contributors
+1 for hacky prototype to play with.

Collide was built with hacky pre Elemental1, and it was rescuable,
and I may have a use case to upgrade it again to Elemental2 (plus a little other top secret magic).

https://github.com/cromwellian/gwt-sandbox was where I got the hacky pre java 8 version. 
Maybe a quick push and we can start the Elemental2 bake off.  v 0.0.1  :-)

Benjamin Tillman

unread,
Dec 11, 2015, 11:10:21 AM12/11/15
to GWT Contributors
For sure this will be the case. Elemental2 + JsInterop are so foundational, and much will be built on top of them. Even the simplest things like cleanly working with web-sockets. I'm also very much looking forward to something complete to work from, and a big thanks to those who are working on this.

Regards,
Ben.

Ray Cromwell

unread,
Dec 11, 2015, 11:48:42 AM12/11/15
to google-web-toolkit-contributors
JsInterop2 solves many of the problems of JsInterop1 and JSOs that plagued Elemental1 and made it hard to pull off.


--
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.

James Northrup

unread,
Mar 22, 2016, 5:52:59 AM3/22/16
to GWT Contributors
+1 for hacky prototype to play with.  this is the top search result for 'gwt elemental2'  +4 months since last post 

Goktug Gokdogan

unread,
Mar 22, 2016, 2:28:49 PM3/22/16
to google-web-toolkit-contributors
The prototype will be available soon, we are close but not there yet.

--
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.

Ming-Yee Iu

unread,
May 18, 2016, 2:19:11 PM5/18/16
to GWT Contributors
Is it possible to get some hints about what's cooking for Elemental 2?

Is the code generator still going to be Python or is it going to be rewritten in Java? I found modifying the Python code generator when I wanted to change Elemental 1 to be annoying.

Is the output going to be a direct remapping of JS APIs to Java or are some of the more common APIs going to be massaged to be more Java-like? With Elemental 1, I found that the JS APIs were cumbersome to use in Java because they were designed for use in JavaScript.  A lot of type casting was required to use the APIs, a lot of potential opportunities for compile-time type safety were missed, lots of strings used as parameters etc.

e.g.
CanvasRenderingContext2D ctx = (CanvasRenderingContext2D)canvas.getContext("2d");

(I often forget whether it's "2d" or "2D", and that type cast is gross)

e.g.
div.addEventListener(Events.CLICK, new EventListener() {
   void handleEvent(Event evt) {
      MouseEvent e = (MouseEvent)evt;
      ...
   }
});

(that would work so much better as something like 

<U extends Event> EventRemover addEventListener( EventType<U> type, EventListener<U> listener )

so that it would be possible to do a 

div.addEventListener(Events.CLICK, (MouseEvent e) -> {...});

Ray Cromwell

unread,
May 18, 2016, 4:05:19 PM5/18/16
to google-web-toolkit-contributors
I agree with you on Java idiomatic API design, but the first version
won't be so specialized, we will have to hand curate overrides of the
auto-generated APIs, it's not really possible to automate 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-co...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/e4eeefd6-cfdf-462d-8ae7-000fa8969d07%40googlegroups.com.

Ming-Yee Iu

unread,
May 18, 2016, 5:10:23 PM5/18/16
to GWT Contributors
It would also be nice if Elemental 2 also has an easy way to selectively knock out certain fields/methods in the code generator. I don't know how many times I'll be using code completion and accidentally end up writing something like 

   div.setInnerText("click me")

because innerText is available in WebKit when I should have been using

   div.setTextContent("click me")

which is cross-platform. I would like to be able to easily go in and regenerate my own Elemental with innerText (among others) removed so that I can't accidentally do that.

There's also the issue of dealing with variants like webkitRequestAnimationFrame(), mozRequestAnimationFrame(), msRequestAnimationFrame(), and requestAnimationFrame() without having four different methods. I guess I can just polyfill stuff like that though.

Ray Cromwell

unread,
May 18, 2016, 5:17:52 PM5/18/16
to google-web-toolkit-contributors
Elemental2 just generates code from whatever WebIDLs or Typescript
headers you feed it. If you want to knock out certain APIs, just
comment them out in the IDL file.
> --
> 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/01214f04-0b6a-48bc-bb57-530b29c539ea%40googlegroups.com.

Thomas Broyer

unread,
May 19, 2016, 4:47:28 AM5/19/16
to GWT Contributors


On Wednesday, May 18, 2016 at 11:10:23 PM UTC+2, Ming-Yee Iu wrote:
It would also be nice if Elemental 2 also has an easy way to selectively knock out certain fields/methods in the code generator. I don't know how many times I'll be using code completion and accidentally end up writing something like 

   div.setInnerText("click me")

because innerText is available in WebKit when I should have been using

   div.setTextContent("click me")

which is cross-platform.

You mean that innerText: http://caniuse.com/#feat=innertext and that textContent: http://caniuse.com/#feat=textcontent
They look (almost) as "cross platform" as each other (Firefox 45 is ESR).
They're not interchangeable though, although very similar when it comes to setting their value: https://rocallahan.github.io/innerText-spec/index.html#setting-innertext

Ming-Yee Iu

unread,
May 19, 2016, 10:04:05 AM5/19/16
to GWT Contributors
Wow, that's great! I noticed yesterday that Firefox finally added support for stuff like clientX and pageX too. For years, they refused to implement stuff like that.

Oh, mighty Apple web developers! Your absolute refusal to test your code on anything except Safari has finally felled even the mighty Mozilla! Despite its limited market share, Safari truly is the new IE6 of Internet.

Nevertheless, having easy knockouts of API functionality would be nice. In fact, my dream API would be to have something like @Deprecated. There would be annotations on the APIs with the browser compliance level of each method. Then, you could get the compiler to automatically analyze your code and issue warnings about what browsers your code works on. Of course, then you would need additional annotations to suppress some of those warnings. And then there would be another layer to detect when your warning suppression annotation is, itself, no longer valid. Something like that is probably beyond the scope of Elemental though.

Paul Stockley

unread,
May 20, 2016, 10:27:42 AM5/20/16
to GWT Contributors
It will be interesting to see how using typescript definitions work out. From my experience of using them, many leave a lot to be desired from a strict typing point of view. A lot of people get lazy and just use 'any' everywhere. How will you handle union types? e.g.  string | int | someobject | array<some object>

I can see them being a good starting point but probably they will require manual changes to make user friendly Java API's.

Goktug Gokdogan

unread,
May 20, 2016, 2:09:51 PM5/20/16
to google-web-toolkit-contributors
Just a correction; we have a prototype generator that allows TypeScript inputs but currently we are not using TypeScript for generating Elemental. We instead use Closure externs files that are nicely typed:

Generator currently using common ancestor for union types. 

--
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.
Reply all
Reply to author
Forward
0 new messages