Controlling Inling in GWT compiler

2017-10-17 Thread Peter Donald
Hi, So I am trying to figure out a way to control inlining in GWT compiler and potentially if it will be compatible with J2CL. My motivation is that I want to build type-safe builders that are compiled away at runtime. The idea is to compile something like new InputBuilder().type(

Re: Custom Events and Elements with Elemental 2

2017-10-17 Thread James Nelson
It is possible to create web components with "fake" ES2015 classes built out of raw javascript. https://github.com/WeTheInternet/xapi/blob/master/gwt/components/src/main/java/xapi/components/impl/WebComponentBuilder.java#L108 Note that the library above depends on a custom fork of Gwt that is

Re: Custom Events and Elements with Elemental 2

2017-10-17 Thread James Nelson
Also, feel free to ignore the bit of insanity around virtual shadow roots. That's just something I built because an older version of webcomponentjs was severely borked, and I needed to... make my own virtual shadow DOM implementation. I have allowed it to survive after upstream bug was fixed

Re: Controlling Inling in GWT compiler

2017-10-17 Thread Peter Donald
On Wed, Oct 18, 2017 at 1:14 PM, Colin Alworth wrote: > For the first one, chaining methods has the unfortunate detail that each > method has a return value, which the next object is called on. To my > knowledge, there is no optimization in the compiler which currently can >

Re: Controlling Inling in GWT compiler

2017-10-17 Thread Peter Donald
> > I still suspect (having not experimented with it) that the "return this" > aliasing will still confuse matters, at least without deliberate code in > closure to handle it. At least with strings, it isn't smart enough: > https://closure-compiler.appspot.com/home#code%3D%252F%252F%2520%253D% >