Re: JSInterop and "JSON.stringify" method return "Converting circular structure to JSON"

2024-05-22 Thread Vassilis Virvilis
>
> or passing a @JsFunction to JSON.stringify() as its second argument


I wish I knew that some time before...

-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExeTQcBh9nHaUpqVYFzjjw%3DVQqvth7g3ZEjE2NoAdYVjg%40mail.gmail.com.


Re: Is moving away from RPC a good idea?

2024-01-11 Thread Vassilis Virvilis
Hi Vegegoku,

Thanks for clearing that up.

At some point I will definitely try the domino-rest/jackson.

For now I dread the time I will eventually be forced to port my current
setup.


On Thu, Jan 11, 2024 at 5:13 PM Vegegoku  wrote:

> The annotation on the POJO is not required at all, Domino-rest will auto
> generate the json-mapping classes if the jax-rs/jakarata resource
> consumes/produces a json even if the annotation is missing, so you can keep
> the POJO clean or only have Jackson compatible annotations. ;-)
>
> On Thursday, January 11, 2024 at 11:35:05 AM UTC+3 Vassilis Virvilis wrote:
>
>> First of all thanks for doing this work. It is hugely appreciated and
>> required in order to avoid GWT and GWT projects look like zombies in a dead
>> landscape.
>>
>> I am using RestyGWT and yes I also believe it uses Generators
>> (GWT.create() ?). I am facing a problem there since RestyGWT is deadish
>> itself.
>>
>> One of the reasons I abandoned GWT-RPC was Jsinterop. With Jsinterop you
>> can include and link to js libraries in the client. Some of them require
>> data from the backend e.g. datatables.net, d3 etc. GWT-RPC is not
>> compatible with them so I would need to use RequestFactory, which I never
>> liked or another framework. So why have two of them? Use one. Go to JSON.
>> RestyGWT was the only viable choice at the time.
>>
>> With Resty-GWT I can have my POjOs *without annotations*, and I can
>> share them between backend, frontend and other clients (non web). RestyGWT
>> has 2 backends:
>> - an older private jackson like (forked) implementation. That's the one I
>> use.
>> - a newer gwt-jackson based one. This one never worked for me.
>>
>> Furthermore I have invested in RestGWT and I have some custom patches so
>> RestyGWT can transmit my generics.
>>
>> At this point domino-jackson and domino-rest looks like the way forward
>> but from a quick look require annotations in the POJO and this is something
>> that I would like to avoid.
>>
>> Just my 2 bits. Sorry if incoherent...
>>
>>
>>
>>
>> On Wed, Jan 10, 2024 at 9:45 PM Michael Conrad  wrote:
>>
>>> You should investigate the DominoKit project. They have a much more
>>> up-to-date JSON/Jackson-ish implementation.
>>>
>>> Ref: https://github.com/DominoKit/domino-rest
>>>
>>>
>>>
>>> On 1/10/24 11:26, Christian Hebert wrote:
>>>
>>> Hi guys, I've seen the changes in the new release regarding jakarta
>>> servlets, which is great, it's a step toward jakarta but to this day,  GWT
>>> is still based on the Servlet API 3.1.
>>>
>>> Prior of seeing that change, I tried to move away from RPC calls and use
>>> http requests instead. I found a nice library called RestyGWT (
>>> https://resty-gwt.github.io/) who can really simplify the process of
>>> handling json data from/to a Rest API.
>>>
>>> So I converted my GWT remote servlets to a Rest API, made a few minor
>>> changes in my client code and voilà, I was able to deploy it on a Jakarta
>>> Application server since there is no GWT involved on the server side
>>> anymore.
>>>
>>> The last version of RestyGWT has been release in 2020 so I'm not sure
>>> how active this project is but from what I've seen it's enough for me.
>>>
>>> So, I would like to get your thoughts on that.  Would you go on that
>>> road? stick to RPC calls and wait for a version of GWT based on Jakarta?
>>> build your "own" GWT with the changes introduced in the vew version?
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "GWT Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-web-tool...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-web-toolkit/8fa7dc19-2a15-442d-93b2-adebb947046cn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-web-toolkit/8fa7dc19-2a15-442d-93b2-adebb947046cn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "GWT Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-web-tool...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d

Re: Is moving away from RPC a good idea?

2024-01-11 Thread Vassilis Virvilis
First of all thanks for doing this work. It is hugely appreciated and
required in order to avoid GWT and GWT projects look like zombies in a dead
landscape.

I am using RestyGWT and yes I also believe it uses Generators (GWT.create()
?). I am facing a problem there since RestyGWT is deadish itself.

One of the reasons I abandoned GWT-RPC was Jsinterop. With Jsinterop you
can include and link to js libraries in the client. Some of them require
data from the backend e.g. datatables.net, d3 etc. GWT-RPC is not
compatible with them so I would need to use RequestFactory, which I never
liked or another framework. So why have two of them? Use one. Go to JSON.
RestyGWT was the only viable choice at the time.

With Resty-GWT I can have my POjOs *without annotations*, and I can share
them between backend, frontend and other clients (non web). RestyGWT has 2
backends:
- an older private jackson like (forked) implementation. That's the one I
use.
- a newer gwt-jackson based one. This one never worked for me.

Furthermore I have invested in RestGWT and I have some custom patches so
RestyGWT can transmit my generics.

At this point domino-jackson and domino-rest looks like the way forward but
from a quick look require annotations in the POJO and this is something
that I would like to avoid.

Just my 2 bits. Sorry if incoherent...




On Wed, Jan 10, 2024 at 9:45 PM Michael Conrad  wrote:

> You should investigate the DominoKit project. They have a much more
> up-to-date JSON/Jackson-ish implementation.
>
> Ref: https://github.com/DominoKit/domino-rest
>
>
>
> On 1/10/24 11:26, Christian Hebert wrote:
>
> Hi guys, I've seen the changes in the new release regarding jakarta
> servlets, which is great, it's a step toward jakarta but to this day,  GWT
> is still based on the Servlet API 3.1.
>
> Prior of seeing that change, I tried to move away from RPC calls and use
> http requests instead. I found a nice library called RestyGWT (
> https://resty-gwt.github.io/) who can really simplify the process of
> handling json data from/to a Rest API.
>
> So I converted my GWT remote servlets to a Rest API, made a few minor
> changes in my client code and voilà, I was able to deploy it on a Jakarta
> Application server since there is no GWT involved on the server side
> anymore.
>
> The last version of RestyGWT has been release in 2020 so I'm not sure how
> active this project is but from what I've seen it's enough for me.
>
> So, I would like to get your thoughts on that.  Would you go on that road?
> stick to RPC calls and wait for a version of GWT based on Jakarta? build
> your "own" GWT with the changes introduced in the vew version?
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/8fa7dc19-2a15-442d-93b2-adebb947046cn%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/8fa7dc19-2a15-442d-93b2-adebb947046cn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/156e77ff-25bd-4743-8798-0d0347d1866d%40newsrx.com
> <https://groups.google.com/d/msgid/google-web-toolkit/156e77ff-25bd-4743-8798-0d0347d1866d%40newsrx.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEy6q14UbmhrQYj-4CrTD6QjFwuygPxM757DjD4%3DkRs1dg%40mail.gmail.com.


Re: com.ait.toolkit.core.Core not found in Gwt-tour

2023-08-22 Thread Vassilis Virvilis
  initTour(tour);
return tour;
}
}

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public static class Callout extends Step {
// Mandatory
public String id;
}

/* this may be step ? should we delete this */
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name =
"HopscotchBubble")
public static class Bubble {
}

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name =
"HopscotchCalloutManager")
public static class CalloutManager {
public static native Bubble createCallout(Callout callout);

public static native Bubble getCallout(String id);

public static native void removeCallout(String id);

public static native void removeAllCallouts();
}

@JsFunction
public static interface Callback {
public void execute();
}

public static native Hopscotch startTour(Tour tour, int stepNum);

public static native Hopscotch startTour(Tour tour);

public static native Hopscotch showStep(int idx);

public static native Hopscotch prevStep();

public static native Hopscotch nextStep();

public static native Hopscotch endTour();

public static native Hopscotch endTour(boolean clearCookie);

public static native Hopscotch configure(Tour options);

public static native Tour getCurrTour();

public static native int getCurrStepNum();

public static native String getState();

public static native Hopscotch listen(String eventName, Callback
callback);

public static native Hopscotch unlisten(String eventName, Callback
callback);

public static native Hopscotch removeCallbacks(String eventName,
boolean tourOnly);

public static native Hopscotch removeCallbacks(String eventName);

public static native Hopscotch removeCallbacks();

public static native void registerHelper(String id, Callback helper);

public static native void unregisterHelper(String id);

public static native Hopscotch resetDefaultI18N();

public static native Hopscotch resetDefaultOptions();

public static native CalloutManager getCalloutManager();
}

On Tue, Aug 22, 2023 at 5:05 PM Frank  wrote:

> Looking at my code.
>
> It seems that I also had troubles getting this to work. I actually copied
> code from the GWT-tour project in my own project.
> Also looking at the code I see this is using JSNI. If this is a new
> project, you probably want to avoid using JSNI in favor of JsInterop.
>
> I could not found any JsInterop library for hopscotch, so best bet is to
> create it yourself, or look for another library which does the same thing.
> Or create your own pure GWT library doing this...
>
> Op dinsdag 22 augustus 2023 om 15:58:54 UTC+2 schreef Frank:
>
>> I think gwt-tour is part of Ahome as far as I know.
>>
>>
>> Have you had this working in the past and if so what change broke it?
>> What version of GWT are you using? I have this working in GWT2.9.0...
>>
>>
>>
>>
>>
>> Op donderdag 17 augustus 2023 om 14:45:22 UTC+2 schreef Colin Alworth:
>>
>>> I'm broadly aware that gwt-tour exists (though it hasnt had an update in
>>> 8 years), but I don't see any com.ait packages or references in it. On the
>>> other hand, I think com.ait.toolkit.core refers to
>>> https://github.com/dikalo/ahome-core/, which is a different thing
>>> entirely. It appears that ahome-core shadows a few GWT classes, which
>>> likely makes it incompatible with newer GWT versions - did you recently
>>> update GWT version and then start having this issue?
>>>
>>> On Thursday, August 17, 2023 at 7:11:43 AM UTC-5 prasenji...@altizon.com
>>> wrote:
>>>
>>>> GWT Module com.ait.toolkit.core.Core not found in project sources or
>>>> resources
>>>>
>>>> in Gwt-Tour library HopScotch.gwt.xml has inherited
>>>> com.ait.toolkit.core.Core which is not found bye goal
>>>> org.codehaus.mojo:gwt-maven-plugin
>>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/6c238278-9295-46bd-ab8a-b520cd4cedefn%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/6c238278-9295-46bd-ab8a-b520cd4cedefn%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExx534f72JZoV3qOuq78n%3D27Ox%3DDzZjLJnYrkT-CeLN2w%40mail.gmail.com.


Re: GWT RPC call recognized as a Java Method Injection by Fortiweb

2023-07-26 Thread Vassilis Virvilis
Wrong thread. Sorry. Please ignore.

On Wed, 26 Jul 2023, 20:26 Vassilis Virvilis,  wrote:

> Super sourcing is a hackish but very powerful tool.
> I have used it to override some gwt widgets in order to expose or change
> some private methods.
>
> Is this feature so difficult to be implemented? I mean at that point J2CL
> looked like a cool upgrade when Google was standing behind GWT. But since
> it took forever to be released as part of GWT one may wonder if it is
> really needed at this point.
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExhogkAdxekOyw8GajibTHy6PBzto3BhS8SYY03jd4_dQ%40mail.gmail.com.


Re: GWT RPC call recognized as a Java Method Injection by Fortiweb

2023-07-26 Thread Vassilis Virvilis
Super sourcing is a hackish but very powerful tool.
I have used it to override some gwt widgets in order to expose or change
some private methods.

Is this feature so difficult to be implemented? I mean at that point J2CL
looked like a cool upgrade when Google was standing behind GWT. But since
it took forever to be released as part of GWT one may wonder if it is
really needed at this point.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExXCB6kGyFB6%3D9-iTHiRwgT1azo9Zqg_kJEa3DVwD62dw%40mail.gmail.com.


GWT SDM Compile Extension

2023-06-18 Thread Vassilis Virvilis
Hi everybody,

My setup where some GWT modules are running both standalone but also inside
in iframes. If you add HTTPS to the mix, having to constantly edit
bookmarklets is not fun.

So I created this little extension that you can find here:
https://github.com/vasvir/gwt-sdm-compile

>From the README:

This extension replaces the following bookmarklets:

   - Dev Mode On
   - Compile
   - Dev Mode Off

It works in Firefox and Chrome and it is Manifest V3 based.
The extension scans for all GWT modules in all frames (main window and
iframes) but iframes with different origin do not work in Firefox currently.

[image: image.png]
The extension provides some rudimetary support to save the configuration so
it can be reused for the specific module/protocol combination. This is
useful when you have multiple GWT modules or HTTPS setups as described here
https://vasvir.wordpress.com/2017/02/07/gwt-super-dev-mode-https-setup-in-7-steps/

Hope that you will find this useful.




-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEztO%2BNdyhsNfx8s4upuSVmr40EvpXa528wkUYzktoGNHg%40mail.gmail.com.


Re: Window.Location.Reload Issue

2023-05-06 Thread Vassilis Virvilis
Hi,

It is not clear from your description but let's assume that you have 2 GWT
applications. One runs at the toplevel window and one runs in an iframe. At
some point you want to reload the main page from the iframe.

The thing is the iframe thinks it runs in the main window. You have to
access the parent and do the reload.

If the iframe and the main window is on the same domain then

   -
   https://stackoverflow.com/questions/11207900/change-parent-url-from-iframe
   -
   
https://stackoverflow.com/questions/4361479/how-do-i-change-the-url-of-the-parent-frame

If the iframe and main window are not on the same domain then maybe it is
more difficult.

Hope that helps.


On Sat, May 6, 2023 at 1:04 PM JaldiSeDekho  wrote:

> Hi Everyone,
>
> I am having a GWT page with a Header, Left Nav and an iFrame besides the
> left nav which reloads.
>
> After a particular condition on a button reload I want the complete
> browsers page to reload, hence I am hitting the Window.Location.reload()
> however this is reloading the iFrame and not the browsers page.
> I even tried to assign Window.Location.assign() like this, however it
> opened the URL inside the iFrame.
>
> Kindly help how I can reload the browsers window completely.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/dd2d3dfd-346d-4135-ab67-569462322862n%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/dd2d3dfd-346d-4135-ab67-569462322862n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEy7AeOsqYYozwMTB6fy4JwK3Oe_-X%2Bq_XM%3D2H2c%2BwU4WA%40mail.gmail.com.


Re: [gwt-contrib] Re: New home for GWT Eclipse Plugin

2023-03-02 Thread Vassilis Virvilis
thanks for that.

On Thu, Mar 2, 2023 at 5:58 PM Colin Alworth  wrote:

> The marketplace entry is updated, and is using the 4.0.0 release at
> plugins.gwtproject.org. There is a subdirectory that lists all deployed
> versions, including a nightly build - each of these directories can be
> added directly to eclipse as an update site:
> https://plugins.gwtproject.org/eclipse/gwt-eclipse-plugin/.
>
> This deployment is managed presently by
> https://github.com/Vertispan/gwtproject.org.
>
> On Friday, February 3, 2023 at 1:39:10 PM UTC-6 Jens wrote:
>
>> Seems fine to use the gwtproject.org domain for it. I slightly tend
>> towards plugins.gwtproject.org/eclipse because it is slightly more
>> descriptive and then we could also provide
>> plugins.gwtproject.org/browser-extensions to publish the last working
>> classic dev mode browser extensions for people having such an old setup.
>> Currently they are all hosted on google.com domain (see:
>> https://www.gwtproject.org/missing-plugin/) and might disappear at any
>> time.
>>
>> As there was some trouble getting access to the marketplace maybe in the
>> long run some mechanisms should be put into place to avoid that situation
>> in the future. For example some online password manager with password
>> sharing between trustworthy community members. I appreciate the commitment
>> of Vertispan but there should be a backup plan in case something unexpected
>> happens.
>>
>> -- J.
>>
>> Colin Alworth schrieb am Samstag, 28. Januar 2023 um 03:45:13 UTC+1:
>>
>>> The GWT Eclipse Plugin has become unmaintained, and over the last
>>> several months several community members have stepped up to update it to
>>> run on recent Eclipse versions, and support the new GWT groupId.
>>>
>>> As part of that process, we've created a new marketplace entry, and
>>> while it is still pointed at the old 3.0 release, we're preparing a new
>>> release, and hope to have it out within a week.
>>>
>>> https://marketplace.eclipse.org/content/gwt-plugin/
>>>
>>> In order to deploy a new version, we need to deploy the unpacked
>>> repository somewhere - which rules out a maven repository. The footprint of
>>> the unpacked workspace is fairly large, around 350mb, which would be too
>>> big for github pages after three releases. We could still deploy releases
>>> zips, but need somewhere else to put the unpacked content.
>>>
>>> There is probably another clever solution, but the straightforward
>>> solution seems to be to add a subdomain on gwtproject.org and unpack
>>> the content there - I propose eclipse.gwtproject.org. As we did for
>>> www.gwtproject.org and samples.gwtproject.org, I've put an example of
>>> this at eclipse.gwtproject.org.vertispan.com, and deployed a single
>>> snapshot of the 4.0 plugin (note that as with many eclipse plugin repos,
>>> this doesn't load correctly in a browser):
>>> https://eclipse.gwtproject.org.vertispan.com/2023-01-18/
>>>
>>> If there are no objections, once we've finished the 4.0 plugin and are
>>> ready for a release, I'll formally set up *eclipse.gwtproject.org
>>> <http://eclipse.gwtproject.org>*. For the moment I anticipate only a
>>> plugins/ directory, with each versioned release (and maybe a nightly build
>>> setup too), to allow for additional content later.
>>>
>>> Using the gwtproject.org domain name seems natural as a large number of
>>> GWT developers use Eclipse and this plugin, and the documentation at
>>> gwtproject.org has long since offered Eclipse instructions, with little
>>> space given to IntelliJ or Maven/Gradle. I'd further propose we should
>>> improve that situation, but that's a separate discussion. Vertispan intends
>>> to host this new plugin content, and we are already hosting the
>>> gwtproject.org domain content.
>>>
>>> If there are reservations about gwtproject.org also hosting the eclipse
>>> plugin, we can set up an alternate domain name for this work, though at
>>> least for the time being, Vertspan will be hosting these together.
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/5a849455-6192-48aa-8c4d-cb724ebc120bn%40googleg

Re: Modern browsers support for Copyclipboard functionality

2022-11-02 Thread Vassilis Virvilis
The problem is that reading from the clipboard is a great security threat
and browsers are reluctant to let you do it.I have managed to access the
clipboard both read/write through an event handler because a Ctrl+C, Ctrl+V
is an explicit way for the browser to confirm that is is indeed a user
desired action and not the action of an evil website page.

As Craig said maybe there is a way to relax browser security but I haven't
done so I don't really know.

Look at MDN: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/read
says tha firefox asks explicitely which is a scary user experience for end
usres.

That's all I know...

On Wed, Nov 2, 2022 at 7:27 AM Pramod Patil 
wrote:

> Thanks  Vassilis,   Craig for your responses, as I mentioned I am a
> beginner with these things, I would like to put exact flow in my
> application, maybe then I may get some specific help,
> 1. We have tool button- with name "Paste from excel"  on click of it below
> code gets called
> protected Function pasteFromExcelFunction =new Function(){
> public void execute(){
>  if(readOnly){
>  return;
>  }// its false
> try{
>
>  if(pasteFromExcelHelper.pasteDataIntoGrid(BaseEditorGridPanel.this,
> getRecordDef()));
>doAfterPaste();
>}
> }
>   }
> 2. public boolean pasteDataIntoGrid(BaseEditorGridPanel grid,
> BaseGridRecordDef recordDef)
> {
>   boolean pasteSuccessful=true;
>  String pastedText= readFromClipboard(); // this method calls the
> javascript code like below in point 3
>  //further code goes here
>  }
> 3 .private String readFromClipboard (){
> return JavaScriptUtils.getClipboardData();
>}
> 4.
> public static native String getClipboardData()/*-{
> i*f($wnd.clipboardData && clipboardData.setData){*
> *return $wnd.clipboardData.getData('Text');*
> }
>
> So can you please suggest me the code change in above function  point no.4
> which will enable paste support with modern browsers, I am aware I am
> asking very specific things, but I have constraints that I am not able to
> debug as remote server where gwt code deployed needs some configuration and
> code is using old version of GWT
>
> Thanks.
>
> On Wed, Oct 26, 2022 at 6:20 AM Craig Mitchell 
> wrote:
>
>> The  doc.execCommand('copy'), while deprecated, still works.  Eg:
>>
>> @UiField TextBox myTextBox;
>>
>> myTextBox.setFocus(true);
>> myTextBox.selectAll();
>> boolean success = copyToClipboard();
>>
>> private static native boolean copyToClipboard() /*-{
>> return $doc.execCommand('copy');
>> }-*/;
>>
>> If you run your site over HTTPS, the user grants permissions, and you
>> jump though lots of hoops, you can also use
>> the $wnd.clipboardData.readText() and $wnd.clipboardData.writeText(myText).
>>
>> On Saturday, 22 October 2022 at 8:10:57 pm UTC+11 vas...@gmail.com wrote:
>>
>>> Well it's the event "copy" as in my example. You need an eventHandler
>>> and then the event is passed as argument to your handler.
>>>
>>> Hope that helps.
>>>
>>> On Thu, Oct 20, 2022 at 7:47 PM Pramod Patil 
>>> wrote:
>>>
>>>> Thanks again,
>>>> In below method - how to get "event " ?  so as to use
>>>> event.clipboard.setData("text/plain", data), if I can get event handle then
>>>> I may achieve desired results.
>>>> public static native String setClipboardData(String data)/*-{
>>>>
>>>> if($wnd.clipboardData && clipboardData.setData){
>>>> return $wnd.clipboardData.setData('Text',Data);
>>>> }
>>>> }
>>>> }-
>>>>
>>>> On Thu, Oct 20, 2022 at 5:17 PM Vassilis Virvilis 
>>>> wrote:
>>>>
>>>>> I believe I did
>>>>>
>>>>> It's this snippet for copy
>>>>>
>>>>> event.clipboardData.setData("text/plain", data);
>>>>>
>>>>> On Thu, Oct 20, 2022 at 1:52 PM Pramod Patil 
>>>>> wrote:
>>>>>
>>>>>> Thank you again, I understand security implications but objective is
>>>>>> to make it work for Edge, I have control over native methods,
>>>>>> getClipBoardata and setClipboardData(String data)  which are native 
>>>>>> methods
>>>>>> in java. The code which I have pasted above is working fine with IE
>>>>>> browser, but not with modern browsers. So can you help me with the
>>>>>> code/pointers which ca

Re: Modern browsers support for Copyclipboard functionality

2022-10-22 Thread Vassilis Virvilis
Well it's the event "copy" as in my example. You need an eventHandler and
then the event is passed as argument to your handler.

Hope that helps.

On Thu, Oct 20, 2022 at 7:47 PM Pramod Patil 
wrote:

> Thanks again,
> In below method - how to get "event " ?  so as to use
> event.clipboard.setData("text/plain", data), if I can get event handle then
> I may achieve desired results.
> public static native String setClipboardData(String data)/*-{
>
> if($wnd.clipboardData && clipboardData.setData){
> return $wnd.clipboardData.setData('Text',Data);
> }
> }
> }-
>
> On Thu, Oct 20, 2022 at 5:17 PM Vassilis Virvilis 
> wrote:
>
>> I believe I did
>>
>> It's this snippet for copy
>>
>> event.clipboardData.setData("text/plain", data);
>>
>> On Thu, Oct 20, 2022 at 1:52 PM Pramod Patil 
>> wrote:
>>
>>> Thank you again, I understand security implications but objective is to
>>> make it work for Edge, I have control over native methods, getClipBoardata
>>> and setClipboardData(String data)  which are native methods in java. The
>>> code which I have pasted above is working fine with IE browser, but not
>>> with modern browsers. So can you help me with the code/pointers which can
>>> replace above code and work for Edge,Chrome. Thanks.
>>>
>>> On Thursday, 20 October 2022 at 14:52:22 UTC+5:30 vas...@gmail.com
>>> wrote:
>>>
>>>> Well if I remember correctly it is not supposed to access the clipboard
>>>> directly because that would be a huge security issue.
>>>>
>>>> Consider the following scenario. You copy / paste your password for
>>>> your bank somewhere. Then you go to a random webpage. If the javascript of
>>>> this webpage that runs on your computer/browser could access
>>>> (getClipboardData()) your clipboard your bank password would be 
>>>> compromised.
>>>>
>>>> So you can only access the clipboard from inside an event handler that
>>>> handles the "copy" event aka Ctrl+C.
>>>>
>>>> The necessary details to access the data differ from IE and so I have
>>>> posted examples.
>>>>
>>>> I do not know why your code does not compile. I think native methods
>>>> are not checked so they tend to give NULL errors during runtime. If that is
>>>> your case then caniuse is your friend.
>>>>
>>>> Vassilis
>>>>
>>>>
>>>>
>>>> On Thu, Oct 20, 2022 at 11:12 AM Pramod Patil 
>>>> wrote:
>>>>
>>>>> Hi Thanks for your response,
>>>>> on both front at GWT and Javascript  I am at beginners level, will it
>>>>> be possible to have modification in below function, which will
>>>>> support copyclipboard functionality with Microsoft Edge. I tried
>>>>> navigator.clipboard.writeText() but code is not getting compiled.
>>>>> public static native String getClipboardData()/*-{
>>>>> i*f($wnd.clipboardData && clipboardData.setData){*
>>>>> *return $wnd.clipboardData.getData('Text');*
>>>>> }
>>>>>
>>>>> On Thu, Oct 20, 2022 at 12:36 PM Vassilis Virvilis 
>>>>> wrote:
>>>>>
>>>>>> For non IE browsers I have this:
>>>>>>
>>>>>> // attach event listeners
>>>>>> // copy - cut - paste handlers
>>>>>> ((Element)
>>>>>> Js.cast(getElement())).addEventListener("copy", copy_li);
>>>>>> ((Element) Js.cast(getElement())).addEventListener("cut",
>>>>>> cut_li);
>>>>>> ((Element)
>>>>>> Js.cast(getElement())).addEventListener("paste", paste_li);
>>>>>>
>>>>>> where (Element) is elemental2.dom.Element
>>>>>>
>>>>>> copy_li is something like this:
>>>>>>
>>>>>> final elemental2.dom.EventListener copy_li = new
>>>>>> elemental2.dom.EventListener() {
>>>>>> @Override
>>>>>> public void handleEvent(elemental2.dom.Event evt) {
>>>>>> final ClipboardEvent event = Js.cast(evt);
>>>>>> copy(event);
>>>>>> }
>>>>>

Re: Modern browsers support for Copyclipboard functionality

2022-10-20 Thread Vassilis Virvilis
I believe I did

It's this snippet for copy

event.clipboardData.setData("text/plain", data);

On Thu, Oct 20, 2022 at 1:52 PM Pramod Patil 
wrote:

> Thank you again, I understand security implications but objective is to
> make it work for Edge, I have control over native methods, getClipBoardata
> and setClipboardData(String data)  which are native methods in java. The
> code which I have pasted above is working fine with IE browser, but not
> with modern browsers. So can you help me with the code/pointers which can
> replace above code and work for Edge,Chrome. Thanks.
>
> On Thursday, 20 October 2022 at 14:52:22 UTC+5:30 vas...@gmail.com wrote:
>
>> Well if I remember correctly it is not supposed to access the clipboard
>> directly because that would be a huge security issue.
>>
>> Consider the following scenario. You copy / paste your password for your
>> bank somewhere. Then you go to a random webpage. If the javascript of this
>> webpage that runs on your computer/browser could access
>> (getClipboardData()) your clipboard your bank password would be compromised.
>>
>> So you can only access the clipboard from inside an event handler that
>> handles the "copy" event aka Ctrl+C.
>>
>> The necessary details to access the data differ from IE and so I have
>> posted examples.
>>
>> I do not know why your code does not compile. I think native methods are
>> not checked so they tend to give NULL errors during runtime. If that is
>> your case then caniuse is your friend.
>>
>> Vassilis
>>
>>
>>
>> On Thu, Oct 20, 2022 at 11:12 AM Pramod Patil 
>> wrote:
>>
>>> Hi Thanks for your response,
>>> on both front at GWT and Javascript  I am at beginners level, will it be
>>> possible to have modification in below function, which will
>>> support copyclipboard functionality with Microsoft Edge. I tried
>>> navigator.clipboard.writeText() but code is not getting compiled.
>>> public static native String getClipboardData()/*-{
>>> i*f($wnd.clipboardData && clipboardData.setData){*
>>> *return $wnd.clipboardData.getData('Text');*
>>> }
>>>
>>> On Thu, Oct 20, 2022 at 12:36 PM Vassilis Virvilis 
>>> wrote:
>>>
>>>> For non IE browsers I have this:
>>>>
>>>> // attach event listeners
>>>> // copy - cut - paste handlers
>>>> ((Element) Js.cast(getElement())).addEventListener("copy",
>>>> copy_li);
>>>> ((Element) Js.cast(getElement())).addEventListener("cut",
>>>> cut_li);
>>>> ((Element) Js.cast(getElement())).addEventListener("paste",
>>>> paste_li);
>>>>
>>>> where (Element) is elemental2.dom.Element
>>>>
>>>> copy_li is something like this:
>>>>
>>>> final elemental2.dom.EventListener copy_li = new
>>>> elemental2.dom.EventListener() {
>>>> @Override
>>>> public void handleEvent(elemental2.dom.Event evt) {
>>>> final ClipboardEvent event = Js.cast(evt);
>>>> copy(event);
>>>> }
>>>> };
>>>>
>>>> where ClipboardEvent is elemental2.dom.ClipboardEvent
>>>>
>>>> I need a copy function because I reuse it in the "Cut" functionality
>>>> also.
>>>>
>>>> and finally copy is something like this
>>>>
>>>>private void copy(ClipboardEvent event) {
>>>> if (!hasData()) {  // <-- hasData() is your application
>>>> specific function
>>>> return;
>>>> }
>>>>
>>>> // do application stuff get/iterate and finally get the data in
>>>> a String form somehow...
>>>> final String data = getData();  // application specific
>>>>
>>>> event.clipboardData.setData("text/plain", data);
>>>> event.preventDefault();
>>>> }
>>>>
>>>> Similarly the paste evenListener:
>>>>
>>>> final elemental2.dom.EventListener paste_li = new
>>>> elemental2.dom.EventListener() {
>>>> @Override
>>>> public void handleEvent(elemental2.dom.Event evt) {
>>>> final ClipboardEvent event = Js.cast(evt);
>>>&

Re: Modern browsers support for Copyclipboard functionality

2022-10-20 Thread Vassilis Virvilis
Well if I remember correctly it is not supposed to access the clipboard
directly because that would be a huge security issue.

Consider the following scenario. You copy / paste your password for your
bank somewhere. Then you go to a random webpage. If the javascript of this
webpage that runs on your computer/browser could access
(getClipboardData()) your clipboard your bank password would be compromised.

So you can only access the clipboard from inside an event handler that
handles the "copy" event aka Ctrl+C.

The necessary details to access the data differ from IE and so I have
posted examples.

I do not know why your code does not compile. I think native methods are
not checked so they tend to give NULL errors during runtime. If that is
your case then caniuse is your friend.

Vassilis



On Thu, Oct 20, 2022 at 11:12 AM Pramod Patil 
wrote:

> Hi Thanks for your response,
> on both front at GWT and Javascript  I am at beginners level, will it be
> possible to have modification in below function, which will
> support copyclipboard functionality with Microsoft Edge. I tried
> navigator.clipboard.writeText() but code is not getting compiled.
> public static native String getClipboardData()/*-{
> i*f($wnd.clipboardData && clipboardData.setData){*
> *return $wnd.clipboardData.getData('Text');*
> }
>
> On Thu, Oct 20, 2022 at 12:36 PM Vassilis Virvilis 
> wrote:
>
>> For non IE browsers I have this:
>>
>> // attach event listeners
>> // copy - cut - paste handlers
>> ((Element) Js.cast(getElement())).addEventListener("copy",
>> copy_li);
>> ((Element) Js.cast(getElement())).addEventListener("cut",
>> cut_li);
>> ((Element) Js.cast(getElement())).addEventListener("paste",
>> paste_li);
>>
>> where (Element) is elemental2.dom.Element
>>
>> copy_li is something like this:
>>
>> final elemental2.dom.EventListener copy_li = new
>> elemental2.dom.EventListener() {
>> @Override
>> public void handleEvent(elemental2.dom.Event evt) {
>> final ClipboardEvent event = Js.cast(evt);
>> copy(event);
>> }
>> };
>>
>> where ClipboardEvent is elemental2.dom.ClipboardEvent
>>
>> I need a copy function because I reuse it in the "Cut" functionality also.
>>
>> and finally copy is something like this
>>
>>private void copy(ClipboardEvent event) {
>> if (!hasData()) {  // <-- hasData() is your application specific
>> function
>> return;
>> }
>>
>> // do application stuff get/iterate and finally get the data in a
>> String form somehow...
>> final String data = getData();  // application specific
>>
>> event.clipboardData.setData("text/plain", data);
>> event.preventDefault();
>> }
>>
>> Similarly the paste evenListener:
>>
>> final elemental2.dom.EventListener paste_li = new
>> elemental2.dom.EventListener() {
>> @Override
>> public void handleEvent(elemental2.dom.Event evt) {
>> final ClipboardEvent event = Js.cast(evt);
>> final String data =
>> event.clipboardData.getData("text/plain")
>> event.preventDefault();
>> if (data == null)
>> return;
>>
>> // now you need somehow to propagate data to the
>> interesting parties (methods, classes etc)
>> // I am using the EventBus from GWT
>> getEventBus().fireEvent(new PasteEvent(data));
>> }
>> };
>>
>> Hope that helps
>>
>>  Vassilis
>>
>> On Thu, Oct 20, 2022 at 9:18 AM Pramod Patil 
>> wrote:
>>
>>> Hi All,
>>> In our GWT application we are using Java native method call for
>>> Copytoclipboard functionality. Please refer below code
>>>
>>> public static native String getClipboardData()/*-{
>>> if($wnd.clipboardData && clipboardData.setData){
>>> return $wnd.clipboardData.getData('Text');
>>> }
>>> }
>>> }-*/
>>> public static native String setClipboardData(String data)/*-{
>>> if($wnd.clipboardData && clipboardData.setData){
>>> return $wnd.clipboardData.setData('Text',Data);
>>> }
>>> }
>>> }-*/
>>>
>>> So above code is working fine with IE browser but not working with
&g

Re: Modern browsers support for Copyclipboard functionality

2022-10-20 Thread Vassilis Virvilis
For non IE browsers I have this:

// attach event listeners
// copy - cut - paste handlers
((Element) Js.cast(getElement())).addEventListener("copy",
copy_li);
((Element) Js.cast(getElement())).addEventListener("cut",
cut_li);
((Element) Js.cast(getElement())).addEventListener("paste",
paste_li);

where (Element) is elemental2.dom.Element

copy_li is something like this:

final elemental2.dom.EventListener copy_li = new
elemental2.dom.EventListener() {
@Override
public void handleEvent(elemental2.dom.Event evt) {
final ClipboardEvent event = Js.cast(evt);
copy(event);
}
};

where ClipboardEvent is elemental2.dom.ClipboardEvent

I need a copy function because I reuse it in the "Cut" functionality also.

and finally copy is something like this

   private void copy(ClipboardEvent event) {
if (!hasData()) {  // <-- hasData() is your application specific
function
return;
}

// do application stuff get/iterate and finally get the data in a
String form somehow...
final String data = getData();  // application specific

event.clipboardData.setData("text/plain", data);
event.preventDefault();
}

Similarly the paste evenListener:

final elemental2.dom.EventListener paste_li = new
elemental2.dom.EventListener() {
@Override
public void handleEvent(elemental2.dom.Event evt) {
final ClipboardEvent event = Js.cast(evt);
final String data =
event.clipboardData.getData("text/plain")
event.preventDefault();
if (data == null)
return;

// now you need somehow to propagate data to the
interesting parties (methods, classes etc)
// I am using the EventBus from GWT
getEventBus().fireEvent(new PasteEvent(data));
}
};

Hope that helps

 Vassilis

On Thu, Oct 20, 2022 at 9:18 AM Pramod Patil 
wrote:

> Hi All,
> In our GWT application we are using Java native method call for
> Copytoclipboard functionality. Please refer below code
>
> public static native String getClipboardData()/*-{
> if($wnd.clipboardData && clipboardData.setData){
> return $wnd.clipboardData.getData('Text');
> }
> }
> }-*/
> public static native String setClipboardData(String data)/*-{
> if($wnd.clipboardData && clipboardData.setData){
> return $wnd.clipboardData.setData('Text',Data);
> }
> }
> }-*/
>
> So above code is working fine with IE browser but not working with modern
> browser. I know this is not GWT specific question, but I don't have much
> knowledge with Javascript, so anyone who knows Javascript, please help here.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/c7ebae01-b41f-440a-b4da-b6c1c91231e3n%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/c7ebae01-b41f-440a-b4da-b6c1c91231e3n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEybr2Kr5hEZ12tKccfMMuR6QZGazTZuZqRHVMd0bKg3ZA%40mail.gmail.com.


Re: What else is missing in elemental2-dom?

2022-05-11 Thread Vassilis Virvilis
for me it is the element.children
https://developer.mozilla.org/en-US/docs/Web/API/Element/children

There is an issue open https://github.com/google/elemental2/issues/86

I tried to look at it but failed early in the build phase.

The workaround for me is to use the elemental2 package from org.realityforge

On Mon, May 9, 2022 at 9:31 PM pavel@gmail.com 
wrote:

> Hi,
> Does someone know what percentage of api is covered by elemental-dom?
> Today I have noticed that elemental2.dom.UIEvent does not have property
> 'view'
> The UiEvent (w3schools.com)
> <https://www.w3schools.com/jsref/obj_uievent.asp>
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/42f09048-f1e8-45b2-9373-cf9ea4166af7n%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/42f09048-f1e8-45b2-9373-cf9ea4166af7n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExomM7P43-u_tuisPU-RjSK0prYhiQ%3DE4Vs_%3DdtD_TdBw%40mail.gmail.com.


Re: Upgrading from 2.8.1 to 2.9.0 yields "...type not found, or there are compile errors..."?!?

2021-12-07 Thread Vassilis Virvilis
I would try to enable the verbose and debug flags of the compilation.

In my experience sometimes the compilation fails for whatever reason and
then the GWT compiler complains that it cannot find the class.

The debug logs of the compilation usually have enough information to
diagnose and fix the problem.

Hope this helps a bit.

On Tue, Dec 7, 2021 at 11:21 AM mmo  wrote:

> Hi and thanks for responding. We will double-check in that direction
> although I have doubts that this is the issue, because this has worked fine
> with the previous version, i.e. with v2.8.1 the compiler obviously *did*
> find the files. Has v2.9.0 a different or more rigid search strategy?
> On Tuesday, December 7, 2021 at 12:26:11 AM UTC+1 robn...@gmail.com wrote:
>
>> It looks like the GWT compiler cannot find the source .java file for that
>> class, which it will need.  Perhaps it is in a directory that is not
>> covered by the  tag in your module.gwt.xml file?
>>
>> On Tuesday, December 7, 2021 at 3:02:09 AM UTC+11 mmo wrote:
>>
>>> We are trying to migrate a GWT application that is running fine with GWT
>>> 2.8.1 to GWT 2.9.0.
>>> When we do a gwt:run the usual Jetty dialog comes up and without errors
>>> nor exceptions and comes to the point where it offers to copy the URL or
>>> launch the default browser.
>>>
>>> When we copy/paste the URL to the browser we get a ""Compiling SSt"
>>> message and then the browser hangs ("SSt" is the name of the application).
>>>
>>> On the console we get the output:
>>> ...
>>> GET /recompile/sstweb
>>>Job ch.zh.ksta.sst.SstWebDevelopment_1_2
>>>   starting job: ch.zh.ksta.sst.SstWebDevelopment_1_2
>>>   binding: gxt.device=desktop
>>>   binding: gxt.user.agent=ie11
>>>   binding: user.agent=gecko1_8
>>>   binding: user.agent.os=windows
>>>   Compiling module ch.zh.ksta.sst.SstWebDevelopment
>>>  Ignored 20 units with compilation errors in first pass.
>>> Compile with -strict or with -logLevel set to TRACE or DEBUG to see all
>>> errors.
>>>  Computing all possible rebind results for
>>> 'com.gwtplatform.mvp.client.ApplicationController'
>>> Rebinding com.gwtplatform.mvp.client.ApplicationController
>>>Invoking generator
>>> com.gwtplatform.mvp.rebind.ApplicationControllerGenerator
>>>   [ERROR] The type
>>> 'ch.zh.ksta.sst.client.SstBootstrapper' was not found, either the class
>>> name is wrong or there are compile errors in your code.
>>>   [ERROR] The type
>>> 'ch.zh.ksta.sst.client.SstBootstrapper' was not found, either the class
>>> name is wrong or there are compile errors in your code.
>>>   [ERROR] There was a problem generating the
>>> ApplicationController, this can be caused by bad GWT module configuration
>>> or compile errors in your source code.
>>>  [WARN] For the following type(s), generated source was never
>>> committed (did you forget to call commit()?)
>>> [WARN] com.gwtplatform.mvp.client.ApplicationControllerImpl
>>>  Unification traversed 29116 fields and methods and 2736 types.
>>> 2699 are considered part of the current module and 2699 had all of their
>>> fields and methods traversed.
>>>  Compiling 1 permutation
>>> Compiling permutation 0...
>>> Linking per-type JS with 2678 new/changed types.
>>> Source Maps Enabled
>>>  Compile of permutations succeeded
>>>  Compilation succeeded -- 6,609s
>>> ...
>>>
>>> We don't understand why the client boots trapper class is not found
>>> (assuming the message is correct). It *is* contained in both, the classes
>>> folder as well as in the generated .war file and the class' name is
>>> correct. We also don't see any compile errors in the code (at least
>>> IntelliJ doesn't display any...).
>>> Any idea or hint, what might be wrong here? Or in which direction we
>>> could search?
>>> Or any info that might be helpful here to pinpoint this issue?
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/088dce7f-05d1-4d2f-81bd-701fb1c27ac6n%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/088dce7f-05d1-4d2f-81bd-701fb1c27ac6n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwjnE7BULCieaeEOBWh8Us1%2BjOcsOC_pjNA5Aai3LxY%3Dw%40mail.gmail.com.


Re: Trying to get GWT app deployed in local Tomcat (using Eclipse)

2021-08-08 Thread Vassilis Virvilis
>
> So maybe it is possible for you to skip GWT compilation while building the
> *.war directory to save some minutes.


In my case this is a huge understatement. In superdevmode the compilation
is nearly instant (1-2secs maybe less)  instead of 90sec of the full
compile.

I don't know how it behaves in really big codebases that take several
minutes to compile but I bet it would make a big difference.

So follow Jens' advice and try to setup superdevmode for development. For
production you still need the final compilation step.

The other solution is to use code splitting
http://www.gwtproject.org/doc/latest/DevGuideCodeSplitting.html but a) I
have never done it and b) certainly looks more invasing.
-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEw7tKKzS2oniP8S7%2BN4qV%2B5AK%2BRa0gbQgzBQ0GJki7fnw%40mail.gmail.com.


Re: [ANN] Akasha: Typed Browser API

2021-05-27 Thread Vassilis Virvilis
cularly with
>>respect to union types.
>>
>> One of the greatest advantages of Akasha is the ability to quickly
>> generate API for new specifications. First you run a single command to
>> register the spec url, extracting the WebIDL from the specification and
>> extract the documentation from MDN. Then you run a second command to
>> regenerate the java and library and closure externs.
>>
>> <https://github.com/akasha/akasha/blob/master/README.md#how-does-this-relate-to-webtack>How
>> does this relate to WebTack?
>>
>> WebTack was the former name of this project when the scope encompassed
>> building a tool to fetch and process WebIDL files. That name still lives on
>> with that part of the suite but the name is no longer used outside this
>> project.
>>
>> <https://github.com/akasha/akasha/blob/master/README.md#the-project-evolution>The
>> project evolution
>>
>> Akasha grew out of several experiments that helped shape the way the code
>> was generated. Several web apps have been created to explore the feel of
>> using the generated code and these may be interesting to investigate to get
>> a feel of how the project evolved. This has included experiments with the Web
>> Bluetooth API <https://webbluetoothcg.github.io/web-bluetooth/> by
>> creating a browser based Heart Rate Monitor
>> <https://github.com/react4j/react4j-heart-rate-monitor>, experiments
>> with speech synthesis <https://github.com/react4j/react4j-webspeechdemo> 
>> using
>> the Web Speech API <https://wicg.github.io/speech-api/>, experiments
>> with WebRTC <https://w3c.github.io/webrtc-pc/> by creating a video chat
>> application <https://github.com/react4j/react4j-vchat> and several other
>> experiments that are not open source.
>>
>> The next major milestone was for integration of Akasha into a medium
>> sized application with ~600K lines of GWT code that has been in development
>> since 2011. This integration has successfully replaced our previous browser
>> API layers and we are now focusing on fine tuning and optimizing the output.
>>
>> Adopting Akasha has made it trivial to integrate with new Web APIs as
>> they come out with minimal fuss compared to past approaches such as the
>> handwritten DOM adapters, elemental or elemental2 libraries and we think
>> Akasha is nearing a time where it is suitable for adoption in a broader
>> context.
>> --
>> Cheers,
>>
>> Peter Donald
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4sfFH-JWYnU2OLpEYtC%3Djp4z2k3w80rLDjJRUBhNScBQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4sfFH-JWYnU2OLpEYtC%3Djp4z2k3w80rLDjJRUBhNScBQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/CA%2BkiFsez%3DWz-BwH-HuEXpcWqyXHNAo7vh1h%3DPyU_59c%2BkWJt%2Bw%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-web-toolkit/CA%2BkiFsez%3DWz-BwH-HuEXpcWqyXHNAo7vh1h%3DPyU_59c%2BkWJt%2Bw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEyeyh%3DqwaqASUiUi3f_9A1FZMvBbqJBqt2AVB%2BPSF9JWQ%40mail.gmail.com.


Re: Disabling class name obfuscation?

2021-05-21 Thread Vassilis Virvilis
I am using -style DETAILED in gwtc arguments during developments. I believe
this turns off the obfuscation.

I also use -strict -logLevel TRACE but I believe this has to do with the
compiler log output.

Hope this helps.

On Fri, May 21, 2021 at 5:17 AM Slava Imeshev  wrote:

> So, I'm working on styling the CellTable, and the CSS classes are coming
> in the inlined form with names such as "GBG2FFLDFD". So I end up
> correlating the content of the unbofuscated CellTable.css while building a
> custom CssResource. That works but it's a fairly slow process. Is there a
> way to disable obfuscation, at least for the dev time?
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/371150b6-f0a4-47f7-a7e3-0cd45fa1634bn%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/371150b6-f0a4-47f7-a7e3-0cd45fa1634bn%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwoHrG1M-7tiy-gd8NXrzbrjVHsoxnZnDbFvBidMLWDgg%40mail.gmail.com.


Re: Change CodeServer URL

2021-04-27 Thread Vassilis Virvilis
No sure about that, but if you want to debug in https:// I have written a
blog post after reading the github issue:
https://github.com/gwtproject/gwt/issues/7535

https://vasvir.wordpress.com/2017/02/07/gwt-super-dev-mode-https-setup-in-7-steps/

Hope this helps.


On Tue, Apr 27, 2021 at 12:40 PM Gordan Krešić 
wrote:

> Is there a way to force .nocache.js file to use CodeServer's URL different
> from $wnd.location.hostname?
>
> I would like to run CodeServer via HAProxy (to enable HTTPS, so I can test
> features available only on HTTPS).
>
> Currently, I'm modifying .nocache.js file and change URL by hand and that
> works, but it gets rewritten on every CodeServer start.
>
> So, back to my initial question: does anyone knows a way to configure
> CodeServer's URL stored in .nocache.js file?
>
> -gkresic.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/dc1ed392-6e0d-304e-b375-15b83bb8b4bd%40steatoda.com
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzep8jJGOX5uNLK71jJgAHD%3Du2q0mEiSwDnE7FR--TkBg%40mail.gmail.com.


Re: [gwt-contrib] Asking for decision on DevMode embedded Jetty support

2021-04-16 Thread Vassilis Virvilis
Thomas,

Thanks for the writeup. This clears the things a bit.

I had already understood the reasons you want to get rid of jetty.

What I hadn't understood was the term DevMode was not referring to the
legacy plugin based mode. Hm... Let's remove the double negatives.
I believed that DevMode was referring to the legacy plugin mode (port ).

To my defense the documentation needs a bit of love. The old devmode is
very prominent in google searches. It is under Docs/Coding Basics/Compile &
Debug
http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html and
the http://www.gwtproject.org/articles/superdevmode.html mentions
-launcherDir in soup of options and text. It needs some formatting there.
Furthermore it mentions the bookmarklet as the suggested way of compiling.

So AFAIKT assuming I don't use servlets if jetty is removed I will run the
codeserver locally (localhost) and we will export its output (nocache.js )
with the server that I choose such as jetty, apache, tomcat nginx whatever.
The capability to debug live production sites with dev_mode_on.js (with the
bookmarklet or other similar means) will be unaffected because (now I get
it) it has nothing to do with the codeserver. dev_mode_on.js
overrides/rewrites from where we are loading the nocache.js script.

Sorry for the trouble and thanks for the explanations.

   Vassilis

On Fri, Apr 16, 2021 at 6:07 PM Thomas Broyer  wrote:

>
>
> On Fri, Apr 16, 2021 at 3:12 PM Vassilis Virvilis 
> wrote:
>
>> That's great news to hear. Is there any doc about this?
>>
>
> It's been there since 2.7, *checks notes* more than 6 years ago.
> Either pass `-launcherDir` to CodeServer, or use DevMode, which defaults
> to using that (legacy DevMode has to be explicitly reenabled through
> -nosuperDevMode)
> See http://www.gwtproject.org/articles/superdevmode.html
>
>
>> How does it know when to switch between codeserver and production code?
>>
>
> A stub nocache.js file is generated (overwriting your production one if
> you use the same dir) that will trigger a recompile on the CodeServer and
> load the generated script, similar to clicking the bookmarklet.
>
> What we're talking about here is more or less about removing DevMode "as
> we know it" that directly serves a web app following the "exploded WAR"
> layout, and only keeping the CodeServer; or possibly serve static files
> from DevMode but no longer host servlets et al.
> The issue here is conflicts between Jetty/DevMode and the project's
> server-side dependencies in the classpath (due to a project with mixed
> client and server code, and the fact that we have a custom
> WebAppClassLoader that loads from both the WEB-INF/classes+WEB-INF/lib and
> the classpath), and even conflicts between Jetty and the WEB-INF/lib, and
> of course issues with the version of ASM from GWT used by Jetty to scan the
> webapp classloader when it encounters module-info.class files.
>
> --
> Thomas Broyer
> /tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAEayHEMoy2bfbATDMstqUsmS88Zg0N8w1bYatdgwZrOYtJtbPQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAEayHEMoy2bfbATDMstqUsmS88Zg0N8w1bYatdgwZrOYtJtbPQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEx9wwO6m%2BuO4xf0NJPU7ZUJ%2Bj95qjcHG1EkkmWibV8VuQ%40mail.gmail.com.


Re: [gwt-contrib] Asking for decision on DevMode embedded Jetty support

2021-04-16 Thread Vassilis Virvilis
That's great news to hear. Is there any doc about this?

How does it know when to switch between codeserver and production code?

On Fri, Apr 16, 2021, 15:46 Paul Robinson  wrote:

> Vassilis - I don't use the bookmarklet. It may still work (I don't know)
> but it's not needed in recent GWT versions. I just refresh my browser and
> it recompiles automatically if anything has changed.
>
> Paul
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAGHNWNJQdCRQ5NfRA--B7SLmxBZikc1tjfiabfX8%2BKnDWTgYOQ%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEyzUkkQ96cvoUqakoALzEVbOAacV3_F%2BtG6MGL3VXJOaw%40mail.gmail.com.


Re: [gwt-contrib] Asking for decision on DevMode embedded Jetty support

2021-04-16 Thread Vassilis Virvilis
put a proxy in it
> (when they use host relative services/links/whatnot, SSL or other
> capabilities). Seems to work fine for us ;)
>
> --
> Cheers,
>
> Peter Donald
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CACiKNc7nSFd9PUzHQwtgai7EZriU3EOimzBtRgRro1TQ4jfObg%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CACiKNc7nSFd9PUzHQwtgai7EZriU3EOimzBtRgRro1TQ4jfObg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEw-0w5k2UL9koazaFCsrvvUeoDn6AfQMmYozXr9zjV6RQ%40mail.gmail.com.


Re: [gwt-contrib] Asking for decision on DevMode embedded Jetty support

2021-04-15 Thread Vassilis Virvilis
Paul,

What about the bookmarklet?. Is out working in your setup?

On Thu, Apr 15, 2021, 09:56 Paul Robinson  wrote:

> I used the built in Jetty server until a year or so ago. Occasionally I
> have to use the older version in development as we haven't upgraded
> everybody in production to the new version yet.
>
> From a development perspective, I find running a separate code server and
> Jetty to be much more productive.
>
> Whenever I need to restart, it's usually only Jetty I need to restart, and
> it's much faster to not restart the code server part as well.
>
> So there may be an extra step, but I'm much happier with it this way.
>
> Paul
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAGHNWN%2BYgug5qMirEg-6fDC1Lyj6xvsh7VHBJ4xdicq1UwPOAA%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEyDaFzcK1hiKd_L4Oux1CYng1LHDsEimaXjX2jH91zdBw%40mail.gmail.com.


Re: Our 10+ year journey with GWT (+ job opening)

2021-01-25 Thread Vassilis Virvilis
Thanks for the insightful reply. You seem to focus on optimization which I
agree is a worthy target.

I was focusing on development practices and reuse. For example I have
created bindings for jQuery. I would love to just use somebody else's
bindings. But here is the thing. I didn't need jQuery for me or my
application. I needed it for DataTables.net. I created bindings for them
too and jQuery was a requirement.

Having done the exercise I believe that it is impossible to reuse jQuery
from another source and DataTables.net from another. They have to be
developed in sync or at least first the jQuery and then the DataTables.net
bindings. It looks like a huge waste of effort to me and not very scalable
regarding ecosystem growth if every gwt developer develops his own bindings
every time.

But what would be a proper solution here? Create a mega project to
coordinate smaller bindings only projects? Provisions have to be taken for
packaging and namespaces in order to avoid collisions and a ton of other
things that are massive headaches.

Thanks again.




On Mon, Jan 25, 2021 at 10:35 AM Peter Donald 
wrote:

>
>
> On Sun, Jan 24, 2021 at 8:17 PM Vassilis Virvilis 
> wrote:
>
>> I asked here one or two times but IIRC the answer was there should be an
>> automatic way to import js libraries. Maybe through DefinitelyTyped
>> typescript https://github.com/DefinitelyTyped/DefinitelyTyped
>> definitions? not sure if it is even possible.
>>
>
> There are a few problems that we became aware of quickly. To get dead code
> elimination / minimization / optimization you really need to have a
> consistent type model for all code within an output target. When we
> experimented with this approach we used the same model that I believe is
> used inside google. i.e. closure typed javascript is the definitive
> representation, java is compiled to closure compiler annotated js via j2cl,
> typescript is compiled is compiled to closure annotated js via tsickle,
> jsinterop-generator converted closure annotated code into jsinterop
> annotated java and then closure compiler was responsible for
> optimization/assembly.
>
> However you could rarely take an off-the-shelf typescript library and
> import it into the mix as tsickle was usually on an older version of
> typescript or the library was not completely typed or it used some
> typescript features not supported by tsickle. This usually meant that the
> library had to be patched and/or was not stripped of unused code and/or was
> not optimized etc. We often ended up writing our own library event when
> there was an equivalent available in the js ecosystem. (Which is no
> different to what we have to do with java-to-js solutions but generally the
> tooling available for long term maintenance is less good for js than for
> java). Even when all the stars aligned we often found that closure could
> not detect some code was unused due to the way js works and so we had to
> patch code so we could eliminate unused code by changing how we used a
> library. This is probably one of the reasons we ended back writing code in
> java. We could not use the existing ecosystem and had to work with a
> limited ecosystem if we wanted high-quality, minimized code .
>
> So while it may be possible to use existing libraries from typescript
> and/or DefinitelyTyped, unless the typing is 100% then bugs will creep in
> and you won't be able to eliminate unused code. Where we are using js
> libraries we tend to write our own bindings or we just rewrite the
> functionality we need in java and get all the benefits provided by the
> compiler.
>
> I am not aware of such a way or at least a roadmap. Do you think that with
>> the WASM target the jsinterop binidings will be more automatic / easier /
>> less manual?
>>
>
> WASM is still a moving target and I haven't tracked it of late ... but
> there were specs that defined the inter module API which would be trivial
> to automatically generate bindings for. There was also primitive tooling
> that did dead code elimination and optimization between modules (by
> essentially removing the unused API ingress and re-running intra module
> optimizer to strip dead code) but I don't know how good it is. I don't know
> if it will ever be possible to do whole application optimization and
> combining into a single module but I am not sure that will be much of a
> problem in practice. At least not for languages that do not have much
> overhead during compilation.
>
> Anyhoo - it will be an interesting time regardless.
>
> --
> Cheers,
>
> Peter Donald
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, s

Re: Our 10+ year journey with GWT (+ job opening)

2021-01-24 Thread Vassilis Virvilis
t;>>>> collection and analysis platform for humanitarian relief, was built 
>>>>>>>>>>> with
>>>>>>>>>>> GWT, GXT and Google Gears in 2009 and seriously would not have been
>>>>>>>>>>> possible without GWT.
>>>>>>>>>>>
>>>>>>>>>>> In 2018, nearly 10 years later, we looked at the amazing js
>>>>>>>>>>> ecosystem and considered moving to Typescript or Elm.
>>>>>>>>>>>
>>>>>>>>>>> Instead, we decided to keep the bits that we loved about GWT:
>>>>>>>>>>> the typesafety, code-reuse with the server, i18n, code splitting, 
>>>>>>>>>>> linkers,
>>>>>>>>>>> and the amazing compiler, and add SCSS for styles and our own port 
>>>>>>>>>>> of
>>>>>>>>>>> Preact + rxJava-like reactivity for dom manipulation using 
>>>>>>>>>>> Elemental2.
>>>>>>>>>>>
>>>>>>>>>>> Three years after the start of ActivityInfo 4.0 we couldn't be
>>>>>>>>>>> happier with the choice, and are more productive than ever.
>>>>>>>>>>>
>>>>>>>>>>> If you're an experienced GWT developer that would enjoy the
>>>>>>>>>>> challenge of a working on a modern GWT codebase, I hope you'll 
>>>>>>>>>>> consider
>>>>>>>>>>> joining our team!
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Best,
>>>>>>>>>>> Alex
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>>> Google Groups "GWT Users" group.
>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from
>>>>>>>>>>> it, send an email to google-web-tool...@googlegroups.com.
>>>>>>>>>>> To view this discussion on the web visit
>>>>>>>>>>> https://groups.google.com/d/msgid/google-web-toolkit/46240bd9-f716-4448-a481-acfc87229f8fn%40googlegroups.com
>>>>>>>>>>> <https://groups.google.com/d/msgid/google-web-toolkit/46240bd9-f716-4448-a481-acfc87229f8fn%40googlegroups.com?utm_medium=email_source=footer>
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>>> --
>> You received this message because you are subscribed to the Google Groups
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-web-toolkit/2c7b6eec-67cd-4361-8777-18490db3dba7n%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-web-toolkit/2c7b6eec-67cd-4361-8777-18490db3dba7n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-web-toolkit/25324b20-e0d8-4a7b-a292-9782066fdf1b%40Spark
>> <https://groups.google.com/d/msgid/google-web-toolkit/25324b20-e0d8-4a7b-a292-9782066fdf1b%40Spark?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> Cheers,
>
> Peter Donald
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4QQnbo4cJARmYT_fPWEAJ_iK6o8oXiJi0Z%3DT7cVgn%3D5g%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4QQnbo4cJARmYT_fPWEAJ_iK6o8oXiJi0Z%3DT7cVgn%3D5g%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwsH4%3De54C0J94PZhPFj7Lfmi7hSQ1%3DPFuMHC7CLnmwfg%40mail.gmail.com.


Re: CodeServer looks for (not required?) source

2021-01-10 Thread Vassilis Virvilis
I have seen differences between code server and the compiler. Not sure if
that was such a case.

I do remember however that the reference was in my java code thrown to the
codeserver.

How about a grep org.apache.commons.lang3.LocaleUtils in your source code
(classpath)?

Hope that helps.

On Sun, Jan 10, 2021 at 11:28 PM Gordan Krešić 
wrote:

> On 10. 01. 2021. 21:58, lofid...@gmail.com wrote:
> > Actually you have following options for the transpiler with Maven
> plugin.
> > Maybe it is the same with the Gradle?
> >
> > -logLevel
> > INFO
>
> This changes log level for compiled code, not code server's output. Out of
> despair I even tried changing this to ALL, but, of course, it didn't help.
>
> > -style
> > PRETTY
>
> How this could be of any effect? It also affects only JS output, while my
> problem is with Java input files.
>
> -gkresic.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/a65cabc3-09a0-b4a4-08ab-dffaea04e7ae%40steatoda.com
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEyEfOmvNiurbC0PGyVha%2BMuX6SN1%2BaFGuEdpx8MxZQGDg%40mail.gmail.com.


Re: CodeServer looks for (not required?) source

2021-01-10 Thread Vassilis Virvilis
AFAIK the reference is in the code you try to compile not in the GWT
compiler per se...

  Vassilis

On Sun, Jan 10, 2021 at 4:53 PM Gordan Krešić 
wrote:

> When using SDM's Code Server, I get following error during initial load:
>
> [ERROR] Could not find org.apache.commons.lang3.LocaleUtils in
> types
> compiled from source. Is the source glob too strict?
>
> That's it, no further reference which class depends on LocaleUtils. Is
> there
> a way to increase log verbosity of code server?
>
> Possibly relevant: "normal" GWT compile task works fine. Probably
> optimizer
> strips some unused methods that causes problems for Code Server (which
> doesn't do code pruning).
>
> If it's relevant, I'm running CodeServer via steffenschaefer's
> gwt-gradle-plugin, but not there, nor in official GWT docs do I find any
> option for making Code Server more verbose:
>
>
> http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#SuperDevMode
>
>
> https://github.com/steffenschaefer/gwt-gradle-plugin/blob/master/gwt-gradle-plugin/src/main/java/de/richsource/gradle/plugins/gwt/GwtSuperDevOptions.java
>
> -gkresic.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/5586e08b-7076-643f-ce87-493a8c22c386%40steatoda.com
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEymzwV1F0ZCPKvvNqQr2f%3DPdt9jxPZOe--ioOkrLD4KrA%40mail.gmail.com.


Re: Why Don’t You Use Java for Programming the Client-Side Web Apps on Web Browser?

2020-12-23 Thread Vassilis Virvilis
>>>>
>>>>>>> I'm not familiar with React (only Hello World )
>>>>>>>
>>>>>>> Can you integrate React with these GWT React frameworks? So write
>>>>>>> your components in Java and integrate them back into React JavaScript?
>>>>>>>
>>>>>>>- https://github.com/GWTReact/gwt-react
>>>>>>>- https://github.com/react4j/react4j.github.io
>>>>>>>
>>>>>>> I don't know whether it is possible?
>>>>>>>
>>>>>>
>>>>>> It may be possible in react4j to publish a java component as a react
>>>>>> component but not without significant overhead/boilerplate. It is also
>>>>>> possible to consume a js react component from within react4j with a 
>>>>>> little
>>>>>> overhead and we built some of our early apps like this. However, 
>>>>>> react4j's
>>>>>> sweet spot is when the majority of the application is written in java.
>>>>>>
>>>>>> With gwt-react it is much easier to both consume js components and
>>>>>> publish java components ... except for the normal constraints of 
>>>>>> publishing
>>>>>> java to js. My guess is that the sweet spot for gwt-react is for
>>>>>> applications that combine js components into a java app but I have never
>>>>>> used it in anger.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Cheers,
>>>>>>
>>>>>> Peter Donald
>>>>>>
>>>>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/b7746457-b2e0-404a-8775-59a01d53f576n%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/b7746457-b2e0-404a-8775-59a01d53f576n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExwbL-F3znuTuHte0_8OhEMq48SrQ5yGU0-kUCy2de4Vg%40mail.gmail.com.


Re: excluding GWT-DEV.jar from final build?

2020-12-22 Thread Vassilis Virvilis
Hi,

I think gwt-dev.jar is where the gwt compiler lives. So you need this jar
for compilation.

For deployment:

   - You don't need it for client side only projects
   - 99% you don't even need it for RPC based servlets

Hope that helps.

Vassilis

On Tue, Dec 22, 2020 at 8:17 PM Elhanan  wrote:

> hi..
> assuming my code will only run in client mode (i.e won't run in any
> server, or any servlet container) is it save to exclude it from maven
> dependencies during build? mark it as provided ?
> according to this it seems i can
>
> https://stackoverflow.com/questions/17678410/trying-to-deploy-gwt-project-in-tomcat-ends-with-offending-class-error/17678786#17678786
>
> (it's never meant to run under a servlet container)
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/f7b77575-cfce-4f13-b081-825bf8691072n%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/f7b77575-cfce-4f13-b081-825bf8691072n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExsFXUGdXtYwrsRwOuhjR4gS0FBhQ076Nb9jxdk1%3DxPTA%40mail.gmail.com.


Re: [gwt-contrib] First org.gwtproject.* modules published to Central

2020-05-25 Thread Vassilis Virvilis
Jens,

That makes perfect sense. Thank you.

I hadn't notice the package name change. This allows same functionality
classes to coexist and allows for gradual transition.

  Vassilis

On Mon, May 25, 2020 at 10:46 AM Jens  wrote:

> My understanding is that:
>
>>
>>- these projects/classes are builtin in GWT 2.9
>>
>> Their old, non J2CL compatible versions are buildin in GWT 2.9. No
> changes are made here.
>
>
>
>
>> Is it possible to start preparing now with GWT 2.9 before GWT 3? Maybe if
>> we drop gwt-user from the dependencies and include these mini gwt-project*
>> ? Or it is not supposed to work like that?
>>
>
> gwt-user code is still in package com.google.gwt while the package for the
> various small gwt-* projects is org.gwtproject. So you would add the small
> projects to your class path and then update your imports in your project to
> point to the new classes / projects.
>
> You would continue to do that with all the other upcoming gwt-* projects
> until your projects does not use any com.google.gwt imports anymore. Then
> you can drop gwt-user.jar.
>
> The projects above should be relatively easy to integrate into your app.
> Maybe gwt-events needs a little more work since you generally want your own
> custom events to move away from GwtEvent / EventHandler as both are not
> required.
>
>
> -- 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/b95a95fa-460d-482c-9374-b7b405309024%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/b95a95fa-460d-482c-9374-b7b405309024%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEzxcpbt-DBKfR42hShVvUD2DEPO8OWW6UxXtQ5%3DzeP4Pg%40mail.gmail.com.


Re: [gwt-contrib] First org.gwtproject.* modules published to Central

2020-05-25 Thread Vassilis Virvilis
Congrats Thomas and to any other if involved in this.

I skimmed the repositories a little bit.

Can you please reiterate or confirm a bit the porting strategy?

My understanding is that:

   - these projects/classes are builtin in GWT 2.9
   - but there will be no more in GWT 3.0 so we need to include them as
   separate projects when we will make the switch to GWT 3 with minimal source
   changes.

Is it possible to start preparing now with GWT 2.9 before GWT 3? Maybe if
we drop gwt-user from the dependencies and include these mini gwt-project*
? Or it is not supposed to work like that?

  Vassilis




On Sat, May 23, 2020 at 1:08 AM Thomas Broyer  wrote:

> Hi all,
>
> I updated gwt-http, gwt-events, gwt-window, gwt-history, and gwt-places to
> GWT 2.9.0 and Elemental2 1.0.0, and just released 1.0.0-RC1 versions of
> each of them.
> Time to test and report any issues with them:
>
>
>- https://github.com/gwtproject/gwt-http
>- https://github.com/gwtproject/gwt-events
>- https://github.com/gwtproject/gwt-window
>- https://github.com/gwtproject/gwt-history
>- https://github.com/gwtproject/gwt-places
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/9d202c46-e1ba-49ef-8144-881a9c50555b%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/9d202c46-e1ba-49ef-8144-881a9c50555b%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjExCsWU6wAmtHX%2BrKs7HQJp%2BngcoXEEX7qswAeS4dk7gjQ%40mail.gmail.com.


Re: Conflict between gwt-dev.jar and the Java 11 Module system still exists in GWT 2.9.0.

2020-05-19 Thread Vassilis Virvilis
Sorry premature hit on the Send button.

The reason I don't have this is that I have completely separate my
frontends from my backends. Usually this is tricky (impossible for me) if
you use GWT RPC. GWT RPC requires gwt classes in the frontend. I am using
CXF in the backend and RestyGWT in the front end and I have converted my
service to a Rest Service (sort of).

So my GWT projects are frontend only and link with js and other gwt
libraries and not with the javaee classes.

You have my sympathies. You are in a tight spot indeed.



On Tue, May 19, 2020 at 12:41 PM Vassilis Virvilis 
wrote:

> Aah now I see,
>
> I just added
>
>javax.xml.stream.util.EventReaderDelegate erd;
>
> in my GWT project and I saw the error.
>
>
> On Tue, May 19, 2020 at 12:23 PM 'Jim Douglas' via GWT Users <
> google-web-toolkit@googlegroups.com> wrote:
>
>> Hi Vassilis,
>>
>> You'll see an error in the format I mentioned ("The package org.w3c.dom
>> is accessible from more than one module: , java.xml") for each
>> time your application directly references any class that's included in
>> gwt-dev.jar and also exists in the core JDK (e.g. any of the classes that
>> you see in my first message at the top of this thread). If you don't happen
>> to have used any of those classes, then you won't see these errors.
>>
>> On Tuesday, May 19, 2020 at 1:33:45 AM UTC-7, Vassilis Virvilis wrote:
>>>
>>> Hi,
>>>
>>> I am an eclipse user and I am running eclipse with java 11. I am using
>>> ant + ivy for building (not Maven) but I am flirting with the idea of
>>> Gradle.
>>>
>>> I have  GWT Eclipse Plugin 3.0.0.201710131939
>>> com.gwtplugins.eclipse.suite.v3.feature.feature.group GWT Eclipse Plugin.
>>>
>>> However I have GWT build from git tree. It is not the latest version
>>> though. It is like 6 months old. I haven't yet upgraded to 2.9 but I will
>>> (try).
>>>
>>> I had specifies my git GWT-SDK as the default GWT-SDK and I am using SDM
>>> command-line gwt codeserver for compile and debug cycles. It works great
>>> for me. I don't use the eclipse debugger and I don't care for the old
>>> development mode.
>>>
>>> Java 11 does not have several EE classes so I have moved to Jakarta.
>>> Another fun story for weird values of fun.
>>>
>>> I remember having several issues with the java modularization thingy all
>>> over my workspace with non GWT projects also but I don't remember how I
>>> solved it.
>>>
>>> This how I have it in my project's setup. I don't need to manually trim
>>> classes from GWT
>>>
>>> [image: image.png]
>>>
>>> So it is possible to have eclipse, java 11 and a newish GWT.
>>>
>>> Hope that helps.
>>>
>>>
>>>
>>>
>>> On Tue, May 19, 2020 at 2:47 AM 'Jim Douglas' via GWT Users <
>>> google-we...@googlegroups.com> wrote:
>>>
>>>> I sincerely appreciate that you're trying to offer advice about this,
>>>> Thomas, especially in the middle of the night where you are, but it's hard
>>>> to imagine a non-Eclipse user fully understanding what I'm describing here.
>>>> Is there nobody who still works on GWT who knows about Eclipse and the GWT
>>>> Eclipse Plugin? This is a completely vanilla classpath-based,
>>>> non-modulepath, Eclipse project that we've been updating with new versions
>>>> of Eclipse, Java, and GWT for a decade. The modulepath conflict is
>>>> introduced by the JDK itself, with the modularization of the entire JDK
>>>> starting in Java 9. You can find many other people trying to make sense of
>>>> this inexplicable error message over the past year or so:
>>>>
>>>>
>>>> https://www.google.com/search?q=%22The+package+org.w3c.dom+is+accessible+from+more+than+one+module%3A+%3Cunnamed%3E%2C+java.xml%22
>>>>
>>>> I first ran into this brick wall when I tried to update a Java 11 test
>>>> environment from Eclipse 2018-12 to Eclipse 2019-03. I finally isolated the
>>>> problem to the fact that GWT bundles several classes that are also
>>>> distributed as part of the core JDK. The conflict is that GWT is
>>>> classpath-oriented, and the JDK is now modulepath-oriented, and as of
>>>> version 2019-03, Eclipse started to enforce the recent rule that a given
>>>> class cannot appear in both the modulepath and the classpath. For now, I've
>>>> hacked around this by stripping the offendin

Re: Conflict between gwt-dev.jar and the Java 11 Module system still exists in GWT 2.9.0.

2020-05-19 Thread Vassilis Virvilis
Aah now I see,

I just added

   javax.xml.stream.util.EventReaderDelegate erd;

in my GWT project and I saw the error.


On Tue, May 19, 2020 at 12:23 PM 'Jim Douglas' via GWT Users <
google-web-toolkit@googlegroups.com> wrote:

> Hi Vassilis,
>
> You'll see an error in the format I mentioned ("The package org.w3c.dom is
> accessible from more than one module: , java.xml") for each time
> your application directly references any class that's included in
> gwt-dev.jar and also exists in the core JDK (e.g. any of the classes that
> you see in my first message at the top of this thread). If you don't happen
> to have used any of those classes, then you won't see these errors.
>
> On Tuesday, May 19, 2020 at 1:33:45 AM UTC-7, Vassilis Virvilis wrote:
>>
>> Hi,
>>
>> I am an eclipse user and I am running eclipse with java 11. I am using
>> ant + ivy for building (not Maven) but I am flirting with the idea of
>> Gradle.
>>
>> I have  GWT Eclipse Plugin 3.0.0.201710131939
>> com.gwtplugins.eclipse.suite.v3.feature.feature.group GWT Eclipse Plugin.
>>
>> However I have GWT build from git tree. It is not the latest version
>> though. It is like 6 months old. I haven't yet upgraded to 2.9 but I will
>> (try).
>>
>> I had specifies my git GWT-SDK as the default GWT-SDK and I am using SDM
>> command-line gwt codeserver for compile and debug cycles. It works great
>> for me. I don't use the eclipse debugger and I don't care for the old
>> development mode.
>>
>> Java 11 does not have several EE classes so I have moved to Jakarta.
>> Another fun story for weird values of fun.
>>
>> I remember having several issues with the java modularization thingy all
>> over my workspace with non GWT projects also but I don't remember how I
>> solved it.
>>
>> This how I have it in my project's setup. I don't need to manually trim
>> classes from GWT
>>
>> [image: image.png]
>>
>> So it is possible to have eclipse, java 11 and a newish GWT.
>>
>> Hope that helps.
>>
>>
>>
>>
>> On Tue, May 19, 2020 at 2:47 AM 'Jim Douglas' via GWT Users <
>> google-we...@googlegroups.com> wrote:
>>
>>> I sincerely appreciate that you're trying to offer advice about this,
>>> Thomas, especially in the middle of the night where you are, but it's hard
>>> to imagine a non-Eclipse user fully understanding what I'm describing here.
>>> Is there nobody who still works on GWT who knows about Eclipse and the GWT
>>> Eclipse Plugin? This is a completely vanilla classpath-based,
>>> non-modulepath, Eclipse project that we've been updating with new versions
>>> of Eclipse, Java, and GWT for a decade. The modulepath conflict is
>>> introduced by the JDK itself, with the modularization of the entire JDK
>>> starting in Java 9. You can find many other people trying to make sense of
>>> this inexplicable error message over the past year or so:
>>>
>>>
>>> https://www.google.com/search?q=%22The+package+org.w3c.dom+is+accessible+from+more+than+one+module%3A+%3Cunnamed%3E%2C+java.xml%22
>>>
>>> I first ran into this brick wall when I tried to update a Java 11 test
>>> environment from Eclipse 2018-12 to Eclipse 2019-03. I finally isolated the
>>> problem to the fact that GWT bundles several classes that are also
>>> distributed as part of the core JDK. The conflict is that GWT is
>>> classpath-oriented, and the JDK is now modulepath-oriented, and as of
>>> version 2019-03, Eclipse started to enforce the recent rule that a given
>>> class cannot appear in both the modulepath and the classpath. For now, I've
>>> hacked around this by stripping the offending classes from GWT to eliminate
>>> the conflict. All of the classes that I was forced to elmininate exist in
>>> the JDK at least as early as Java 8 (I haven't checked Java 7), so it ought
>>> to be possible for the GWT team to simply drop them from gwt-dev.jar, since
>>> it can count on them existing in the JDK itself.
>>>
>>> I do recognize that your strong preference is that every application
>>> should now be based on Maven, but ours isn't; it's a traditional
>>> application that just defines the classpath, and rearchitecting our
>>> development environment for a few dozen developers just isn't on the table
>>> anytime soon.
>>>
>>> On Monday, May 18, 2020 at 4:24:56 PM UTC-7, Thomas Broyer wrote:
>>>>
>>>> Disclaimer: I'm not an Eclipse user.
>>>>
>>>> Your problem is tha

Re: GWT 2.9.0 release

2020-05-14 Thread Vassilis Virvilis
gt;- Add partial emulation for ExecutorService and
>>ScheduledExecutorService
>>- Emulate java.util.concurrent.Flow
>>- Emulate javax.annotation{,.processing}.Generated
>>- Make sure "goog.global" is $wnd if not defined.
>>- Add when-linker-added element definition
>>- Add Reader and StringReader emulation.
>>- Remove GWT version check.
>>- Do not show "unusable-by-js" warning for synthetic methods.
>>- Update unmodifiableList to throw on Java8 methods.
>>- Disable DataflowOptimizer by default and emit a warning when used
>>
>> For more detail, see the commit log
>> <https://gwt.googlesource.com/gwt/+log/2.8.2..release/2.9.0>.
>>
>>
>> 
>>
>> Finally, if you haven't already done so, please join the very active GWT
>> discussions happening at https://gitter.im/gwtproject/gwt!
>>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/e0eed686-7f78-47e0-b250-79d6f8e9b73e%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/e0eed686-7f78-47e0-b250-79d6f8e9b73e%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzUprh0n-bSQbavPqrrE-HZ6oytMf-yMJ_v%2B4%3DhykmXPw%40mail.gmail.com.


Re: (Unofficial) Elemental2 2.27 question

2020-04-25 Thread Vassilis Virvilis
Hi,

Thanks for answering.

a)
children is an Element property and it returns a HTMLCollection. See here:
https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/children
Also this issue has been brought up as a bug before but It had never bitten
me personally. See here: https://github.com/google/elemental2/issues/33

b) Yes but this where I am now. I have two copies of
jsinterop-annotations-2.8.2-v20191108.jar
in my system.
Ok actually scratch that.
I am not 100% sure because I also don't have and IDE handly and I have
reverted to 2.25
but if you care I can update to 2.27 and report If I two versions of
jsinterop-annotations
in my system and possibly who brings it in.

Just let me know.

Thanks again

Vassilis
.


On Sat, Apr 25, 2020 at 12:56 PM Peter Donald 
wrote:

> On Fri, Apr 24, 2020 at 11:15 PM Vassilis Virvilis 
> wrote:
> > I updated to Elemental 2.27 from 2.25 and
> > a) Element has no children property
>
> I haven't got an IDE handy but that is what I would expect. IIRC
> Element extends Node and Node has a read only attribute childNodes ...
> at least according to the spec WebIDL AFAIK. I would have to
> investigate the closure externs to figure out why it used to have a
> children property.
>
> > b) it depends on jsinterop-annotations-1.0.2.jar but
> jsinterop-annotations-2.8.2-v20191108.jar exists. Is
> jsinterop-annotations-2.8.2-v20191108.jar a J2CL thing?
>
> 1.0.2 is released by google so I just preferred the use of that as I
> expect other libraries would depend on this jar and having a shared
> coordinate reduces the likelihood of ending up with two copies of it
> in the project class path
>
> --
> Cheers,
>
> Peter Donald
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc6famF88h-Vsjqdta%2BQ4GgtvqUJm1kLBPtxUkyeGhLyLA%40mail.gmail.com
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEyPinaVqxCUi-ZWscUazaUEcka40nUPjvHU6xiSg-yDxQ%40mail.gmail.com.


(Unofficial) Elemental2 2.27 question

2020-04-24 Thread Vassilis Virvilis
Hi,

I updated to Elemental 2.27 from 2.25 and
a) Element has no children property
b) it depends on jsinterop-annotations-1.0.2.jar but
jsinterop-annotations-2.8.2-v20191108.jar exists. Is
jsinterop-annotations-2.8.2-v20191108.jar a J2CL thing?

Any ideas?

-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzwSVLiSJyJYxw%2BOksetPVDnB%3D-mXER8m_Av%2BEMQWTvUg%40mail.gmail.com.


Re: JsFunction length is zero

2020-01-14 Thread Vassilis Virvilis
I just did it.

Thanks for the help and the patience.

On Tue, Jan 14, 2020 at 11:11 AM Jens  wrote:

>
> I just got my first positive review and I noticed the 'Add Reviewer/ Add
>> CC' buttons and I am wondering if I should manually enter the names you
>> suggested previously in the thread?
>>
>
> Sure, you would use the Add Reviewer button. The person you add will then
> receive an email notification (if they haven't deactivated it).
>
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/fe261053-1fbe-400d-9a8f-982249348e4a%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/fe261053-1fbe-400d-9a8f-982249348e4a%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExgrDR4M4wNDHGo6bcp01dfEWySvRKjT08LqG3-OLdbBA%40mail.gmail.com.


Re: JsFunction length is zero

2020-01-14 Thread Vassilis Virvilis
Hi Jens,

Sorry for bothering you again but I am new to this.

I just got my first positive review and I noticed the 'Add Reviewer/ Add
CC' buttons and I am wondering if I should manually enter the names you
suggested previously in the thread?

Thanks

On Fri, Jan 10, 2020 at 4:21 PM Vassilis Virvilis  wrote:

> I actually added a pull/review request on gerrit at 3 Dec 2019
>
>
> https://gwt-review.googlesource.com/q/I7af77f4b5e05c29a275c5b4a3f5610288f11dba9
>
> but no signs of life so far. It certainly takes a lot of time to review...
>
> Vassilis
>
>
> On Mon, Dec 2, 2019 at 1:38 PM Vassilis Virvilis 
> wrote:
>
>> Here is the commit
>> https://github.com/vasvir/gwt/commit/decf6974a284b24042c072e47662554ed0613a60
>>
>> Unfortunately GWT does not accept pull request on GitHub.
>>
>>
>> On Thu, Nov 28, 2019 at 3:12 PM Vassilis Virvilis 
>> wrote:
>>
>>> ok then.
>>>
>>> Here is the submitted issue
>>> https://github.com/gwtproject/gwt/issues/9675
>>>
>>> I will try to come with a patch in the next few days.
>>>
>>> Thanks
>>>
>>>   Vassilis
>>>
>>> On Thu, Nov 28, 2019 at 9:38 AM Jens  wrote:
>>>
>>>>
>>>> Do you think a patch like that has any chance to be accepted? or this
>>>>> is not considered to be an issue?
>>>>>
>>>>
>>>> Seems like a valid behavior for JS libraries to check argument count,
>>>> so I guess it should be accepted. Goktug or Roberto should probably review
>>>> it.
>>>>
>>>> -- J.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "GWT Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to google-web-toolkit+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>>
>>>
>>> --
>>> Vassilis Virvilis
>>>
>>
>>
>> --
>> Vassilis Virvilis
>>
>
>
> --
> Vassilis Virvilis
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEy5e1ETbVWL6L8Rts73BJbZaSAh5S1jU-QM8cKNT_AjHw%40mail.gmail.com.


Re: JsFunction length is zero

2020-01-10 Thread Vassilis Virvilis
I actually added a pull/review request on gerrit at 3 Dec 2019

https://gwt-review.googlesource.com/q/I7af77f4b5e05c29a275c5b4a3f5610288f11dba9

but no signs of life so far. It certainly takes a lot of time to review...

Vassilis


On Mon, Dec 2, 2019 at 1:38 PM Vassilis Virvilis  wrote:

> Here is the commit
> https://github.com/vasvir/gwt/commit/decf6974a284b24042c072e47662554ed0613a60
>
> Unfortunately GWT does not accept pull request on GitHub.
>
>
> On Thu, Nov 28, 2019 at 3:12 PM Vassilis Virvilis 
> wrote:
>
>> ok then.
>>
>> Here is the submitted issue https://github.com/gwtproject/gwt/issues/9675
>>
>> I will try to come with a patch in the next few days.
>>
>> Thanks
>>
>>   Vassilis
>>
>> On Thu, Nov 28, 2019 at 9:38 AM Jens  wrote:
>>
>>>
>>> Do you think a patch like that has any chance to be accepted? or this is
>>>> not considered to be an issue?
>>>>
>>>
>>> Seems like a valid behavior for JS libraries to check argument count, so
>>> I guess it should be accepted. Goktug or Roberto should probably review it.
>>>
>>> -- J.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "GWT Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-web-toolkit+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> --
>> Vassilis Virvilis
>>
>
>
> --
> Vassilis Virvilis
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzgxL0%2BCBZbZ9a_NQi4Eub1ptujwzYy0tRwx8zf0yGGWg%40mail.gmail.com.


Re: Jsinterop: java arrays, native arrays, JsArray and strings

2019-12-18 Thread Vassilis Virvilis
Thanks for the info.

Maybe with GWT 3 since many things will break, it is a good idea to map
float[] to Float32Array, double[] to Float64Array etc...

But even more than that I would love a java.lang.String to js.String direct
mapping first. I don't know if this is even possible but hey it's almost
Christmas!

   Vassilis

On Wed, Dec 18, 2019 at 11:43 AM Kirill Prazdnikov 
wrote:

> So
>>
>>- Arrays, double are mapped to native types.
>>
>>
> Not really, for float[] or for double[] there is
> corresponding Float32Array and Float64Array, or Int32Array for int[].
>
> But the GWT uses JsArray of JsObjects and use JsNumber (boxed double) for
> any primitive types.
> As result, any generic multiplatform algorithm using arrays is extremely
> memory and performance *inefficient.*
>
> Other java->js compilers offer more correct solution.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/52d9465a-bbd5-496c-bfa3-e3e59a18e9d4%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/52d9465a-bbd5-496c-bfa3-e3e59a18e9d4%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwPk4j%2Bx8JcQjY2PJCyHp3bMZg2ExG0ypE0uKKN1%3Dnetw%40mail.gmail.com.


Re: JsFunction length is zero

2019-12-02 Thread Vassilis Virvilis
Here is the commit
https://github.com/vasvir/gwt/commit/decf6974a284b24042c072e47662554ed0613a60

Unfortunately GWT does not accept pull request on GitHub.


On Thu, Nov 28, 2019 at 3:12 PM Vassilis Virvilis  wrote:

> ok then.
>
> Here is the submitted issue https://github.com/gwtproject/gwt/issues/9675
>
> I will try to come with a patch in the next few days.
>
> Thanks
>
>   Vassilis
>
> On Thu, Nov 28, 2019 at 9:38 AM Jens  wrote:
>
>>
>> Do you think a patch like that has any chance to be accepted? or this is
>>> not considered to be an issue?
>>>
>>
>> Seems like a valid behavior for JS libraries to check argument count, so
>> I guess it should be accepted. Goktug or Roberto should probably review it.
>>
>> -- J.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> Vassilis Virvilis
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExsX5nUnBnFsB4yLjMj8pK8x852oYF1_m-U_rhYBCACwQ%40mail.gmail.com.


Re: JsFunction length is zero

2019-11-28 Thread Vassilis Virvilis
ok then.

Here is the submitted issue https://github.com/gwtproject/gwt/issues/9675

I will try to come with a patch in the next few days.

Thanks

  Vassilis

On Thu, Nov 28, 2019 at 9:38 AM Jens  wrote:

>
> Do you think a patch like that has any chance to be accepted? or this is
>> not considered to be an issue?
>>
>
> Seems like a valid behavior for JS libraries to check argument count, so I
> guess it should be accepted. Goktug or Roberto should probably review it.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExjVWLLBO%3DJHgiudD6g%2BDtSc-PGnj%3DWdH%3DPWh43ugu8ww%40mail.gmail.com.


Re: JsFunction length is zero

2019-11-27 Thread Vassilis Virvilis
Hi Jens,

Thanks for the reply and the pointer. Your answers are spot on as always
but in this case I had managed to find the specific code fragment by my
self.

I was thinking a patch could look like the accepted answer in this Stack
Overflow question:
https://stackoverflow.com/questions/7316688/how-to-programmatically-set-the-length-of-a-function

assuming arguments and arguments.length carry the necessary information.

Do you think a patch like that has any chance to be accepted? or this is
not considered to be an issue?

Thanks



On Wed, Nov 27, 2019 at 1:57 PM Jens  wrote:

> You can see here how GWT compiler creates lambdas:
> https://github.com/gwtproject/gwt/blob/master/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Runtime.java#L162
>
> In case you also want to try to fix the issue ;-)
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/e6e9e9ea-e921-41c7-9283-9734902e3d41%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/e6e9e9ea-e921-41c7-9283-9734902e3d41%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzsNhqhPWbUQENie-mx-g-pMYWs-09vt5w8fqbf8qnUDQ%40mail.gmail.com.


JsFunction length is zero

2019-11-26 Thread Vassilis Virvilis
Hi,

Looks like that some javascript libraries are checking on the argument
length of the callbacks that are passed to them.

So for example D3 bisector can take a function with one or two arguments.
If it is one then it is an accessor if it is two then it is a comparator.

I searched on github issues. Should I report it?

The following snippet demonstrates the problem. The Function.length should
be 1 and not 0.

@JsFunction
public static interface SomeFunction {
public double call(double x);
}
/** * This is the entry point method. */
@Override
public void onModuleLoad() {
final SomeFunction y = new SomeFunction() {
@Override
public double call(double x) {
return 2 * x;
}
};
DomGlobal.console.log(y);
return;}

[image: image.png]

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzhR%3DGgF8S7SMmpq9WzjmqViKjZtcWLCKMp%3DaK0uZmHLQ%40mail.gmail.com.


Re: ClassCastException in some browser, but not others (

2019-10-05 Thread Vassilis Virvilis

Probably

 --> IDBDatabase idb = Js.uncheckedCast(idbr.result);

would work too.

The point is is uncheckedCast is (AFAIU) considered dangerous.

There are two other casts that perform run-time checks but they have a 1) 
performance penalty and 2) some times throw exceptions not due to a bug but 
because the casting is invalid based on the type definitions GWT compiler knows 
about.

Here is the first type:
   a) Java cast --> MyObject x = (MyObject) yourObject;
   b) Js checked cast   --> MyObject x = Js.cast(yourObject);
and of course
   c) Js unchecked cast --> MyObject x = Js.uncheckedCast(yourObject);

I think (not sure) that a) and b) are the same at least on development mode. 
Not so sure what they are doing in production mode.

My 2 cents of limited understanding...

   Vassilis



On 10/6/19 7:00 AM, Shawn Asamoto-Brown wrote:

OK, this works --> IDBDatabase idb = Js. 
uncheckedCast(idbr.result);

@SuppressWarnings({ "unchecked" })
public  static  void initIndexedDb(){

IDBFactory idbf=  IndexedDbGlobal.indexedDB;
IDBOpenDBRequest idbr=  idbf.open(INDEXEDDB_NAME);

idbr.onsuccess=  new  OnsuccessFn()  {

@Override
public  Object  onInvoke(elemental2.dom.Event  p0)  {

// fails w java.lang.ClassCastException
// IDBDatabase idb = (IDBDatabase) idbr.result;
// IDBDatabase idb = Js. cast(db);

//this works
IDBDatabase idb=  Js.  
uncheckedCast(idbr.result);

DOMStringList  dsl=  idb.objectStoreNames;

dsl.asList().forEach(s->  {
Log.info("FOUND DB "  +  s);
});

return  idbr.result;
}
};

idbr.onerror=  new  OnerrorFn()  {

@Override
public  Object  onInvoke(elemental2.dom.Event  p0)  {
Log.error("OnerrorFn "  +  p0.type);
return  null;
}
};
}


On Sat, Oct 5, 2019 at 10:47 PM Shawn mailto:sh...@koyuru.com>> wrote:

Meant to add that I am sure indexeddb is supported in all the browsers I am 
using.

Here is the code again ... sorry about the previous formatting.

IDBFactory idbf = IndexedDbGlobal./indexedDB/;

IDBOpenDBRequest idbr = idbf.open(*/INDEXEDDB_NAME/*);

idbr*.*onsuccess = new OnsuccessFn() {


/@Override/

public Object onInvoke(elemental2.dom.Event p0) {

                                         //error is next

idb = (IDBDatabase)idbr.result;


DOMStringList dsl = idb.objectStoreNames;


dsl.asList().forEach(s -> {

Log./error/("FOUND DB " + s);

});

return idbr.result;

}

};


On Chrome desktop, I find the indexeddb I created in handwritten js code.  
I don't get why there is a ClassCastException in some browsers.  Is 
elemental2-indexeddb or gxt 2.9 (HEAD) not supported everywhere?

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/cbc724a1-5b8b-4478-8119-02af3d279c2b%40googlegroups.com
 
.

--
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 
google-web-toolkit+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAEQ-_W11k9ze2bQnnB9K_fiGhna1f8AkmO25pLKYqmbA9vy1OQ%40mail.gmail.com
 
.


--
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/f9e0cdc4-c280-5443-747b-2353363d4663%40gmail.com.


Jsinterop: java arrays, native arrays, JsArray and strings

2019-09-18 Thread Vassilis Virvilis
Hi,

I want to know if a java array is the same underlying object with a js
native array.

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
> public static class MyObject {
> int x;
>
> @JsOverlay
> public static MyObject create(int x) {
> final MyObject o = new MyObject();
> o.x = x;
> return o;
> }
> }
>
>
@Override
> public void onModuleLoad() {
> // check if java arrays are implemented by the same underlying
> native array
> final MyObject[] java_array = new MyObject[] { MyObject.create(1),
> MyObject.create(4), MyObject.create(16) };
> DomGlobal.console.log((Object) java_array);
> // cast to nativeJsArray
> final JsArray js_array = Js.uncheckedCast(java_array);
> DomGlobal.console.log(js_array);
> // delete second object
> // DomGlobal.window.alert("Check this out");
> js_array.splice(1, 1);
> DomGlobal.console.log((Object) java_array);
> DomGlobal.console.log(js_array);
>
return;
>}
>

*Results*:

Array(3) [ {…}, {…}, {…} ]
> Array(3) [ {…}, {…}, {…} ]
> Array [ {…}, {…} ]
> Array [ {…}, {…} ]
>

So the splice call succeeds and I can remove elements from the java array.
Cool. So this is evidence that java arrays are backed by js arrays,

So

   - Arrays, double are mapped to native types.
   - We have @JsFunction and Function
   - int is mapped to js number --> double

Is it possible to also map java.lang.String to native JsString

final JsString x1 = new JsString("x1");
> DomGlobal.console.log(x1);
> final String x2 = Js.uncheckedCast(x1);
> DomGlobal.console.log((Object) new String[] {x2});
> final String x3 = x2.replaceAll("1", "3");
> DomGlobal.console.log((Object) new String[] {x3});
> return;
>

*Results*:

> String { "x1" } <- native js string
> Array [ String ] <-- java clas String with value "x1"
> Array [ "x3" ] <- native js string  Why?
>
> I don't really understand the results. Any comment?



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEyLT3BTSoCDM-2SkmGz1BD93ynCDw9GvgG5B4p8ovUp0g%40mail.gmail.com.


Re: elemental2: Native maps with primitive types?

2019-08-16 Thread Vassilis Virvilis
thanks that worked too.

It is Js.asAny(@DonotAutobox Object o) which performs an unchecked cast below.

Thanks for tips.

On Thu, Aug 15, 2019 at 9:53 AM Peter Donald  wrote:
>
>
>
> On Thu, Aug 15, 2019 at 4:28 PM Vassilis Virvilis  wrote:
>>
>> I have seen the @DoNotAutoBox and I tried with Integer, Number, JsNumber.
>>
>> Note: I can put int in the JsPropertyMap but I cannot read it back. So
>> I cast it to (double) and the then to (int). I believe that is because
>> JavaScript does not have int type.
>
>
> That is certainly an option but in some circumstances can lead to type issues 
> when casting. I tend to prefer using Any to do these sorts of conversions. It 
> is a little more verbose but it avoids any unexpected casting problems. I 
> don't have the code in front of me but I believe there is a method like 
> getAsAny("myprop") that works in this scenario
>
>>
>>
>> --
>> Vassilis Virvilis
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzHuG5ZC7igRyvzrkLt26qBWkxNUeuWL%2BZNbKCo%2BcShgA%40mail.gmail.com.
>
>
>
> --
> Cheers,
>
> Peter Donald
>
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc6CpmL2naFFydC%2BYS%3Dmtj3yQFsQ2KojGQCRAXXSRCYhLg%40mail.gmail.com.



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzCi0CnTpDkQZJU%3D1HN9sMnCR2S2NzsoJ2Skf6gzPB9FA%40mail.gmail.com.


Re: elemental2: Native maps with primitive types?

2019-08-15 Thread Vassilis Virvilis
yep

that worked. thanks a bunch.

I have seen the @DoNotAutoBox and I tried with Integer, Number, JsNumber.

Note: I can put int in the JsPropertyMap but I cannot read it back. So
I cast it to (double) and the then to (int). I believe that is because
JavaScript does not have int type.

thanks again.


On Wed, Aug 14, 2019 at 5:38 PM Jens  wrote:
>
> JsPropertyMap.set(key, value) is marked with @DoNotAutoBox, so I guess you 
> should be able to use JsPropertyMap and set int, float, double into 
> it without them being auto boxed.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/dd759896-4174-411d-b870-593054e1c660%40googlegroups.com.



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzHuG5ZC7igRyvzrkLt26qBWkxNUeuWL%2BZNbKCo%2BcShgA%40mail.gmail.com.


elemental2: Native maps with primitive types?

2019-08-14 Thread Vassilis Virvilis
Hi,

Is it possible to define and use in java a javascript map (JsObject,
JsPropertyMap) that can accept plain numbers as the values of the map?

I didn't find a way. JsPropertyMap expect objects.

Thanks

-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzqV4j8RerONqFTrhq3YSTvPST1V4L8kHdaX5iX8%2BU5fQ%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-14 Thread Vassilis Virvilis
Jens,

Thanks for reminding me. I have totally forgot this section.

I believe that the document was written before Js.cast and Js.unchecked cast.

Maybe some use cases and some examples would be helpful.

Thanks again.

On Wed, Aug 14, 2019 at 9:58 AM Jens  wrote:
>
>
>> It would be great if there was some documentation that could compare
>> and spell the differences between
>> standard cast (), Js.cast(), Js.uncheckedCast() in various use cases
>> so we could have a list of dos and donts.
>
>
> There is a whole section about instanceof/cast in 
> https://docs.google.com/document/d/10fmlEYIHcyead_4R1S5wKGs1t2I7Fnp_PaNaa7XTEk0/edit#heading=h.kog1ji9nzq7y
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/e89fdeec-6bfd-48d3-973a-a98f4287d83b%40googlegroups.com.



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEw9BXbT4qZH60aBeder4NbbFeShdwSyhQEtE9tu%3DKpuxg%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-13 Thread Vassilis Virvilis
It would be great if there was some documentation that could compare
and spell the differences between
standard cast (), Js.cast(), Js.uncheckedCast() in various use cases
so we could have a list of dos and donts.

   Vassilis

On Mon, Aug 12, 2019 at 4:27 PM Jens  wrote:
>
>
>> final MyHTMLDocument doc = Js.cast(DomGlobal.document);  <-- this crashes
>> final MyHTMLDocument doc = Js.uncheckedCast(DomGlobal.document);  <-- this 
>> works
>
>
> Because the native browser document isn't a MyHTMLDocument? You can only 
> treat it like a MyHTMLDocument by doing a nasty unchecked cast so you can 
> call that method you need.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/de0c434d-6ed6-4205-b674-0aaf697110a0%40googlegroups.com.



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwMz8Fre-FGZP%2BiJTqFdAcrAuDtbF9kzwuG2VsaKBa%2B6w%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-12 Thread Vassilis Virvilis
Hi again,

I did create a class MyHTMLDocument that extends HTMLDocument.

However

final MyHTMLDocument doc = Js.cast(DomGlobal.document);  <-- this crashes
final MyHTMLDocument doc = Js.uncheckedCast(DomGlobal.document);  <-- this works

any idea why uncheckedCast is required?

  Thanks

Vassilis Virvilis




On Sun, Aug 11, 2019 at 10:25 AM Vassilis Virvilis  wrote:
>
> Hi Peter,
>
> Thanks for replying and for pointing me to the github issue.
>
> I am thinking the following strategy.
>
> Create a MyHTMLDocument that extends HTMLDocument and it has the
> execCommand but without the @Override annotations.
>
> That way when HTMLDocument gets execDocument implemented I will get a
> warning and at that point I will be able to remove the MyHTMLDocument
> class and use the official one. Aargh now I see that is already
> mentioned in the comments of the original execCommand issue at
> https://github.com/google/elemental2/issues/43 by vegegoku.
>
> Thanks again.
>
>Vassilis
>
> On Sun, Aug 11, 2019 at 8:31 AM Peter Donald  wrote:
> >
> > execCommand is not yet part of elemental2. There is no reason why it should 
> > not be other than the externs need cleaning up. It is on my list of things 
> > to do some time but we don't use it so I haven't got off my kaboose to do 
> > the work. The issue that is tracking this (among other things) is 
> > https://github.com/google/elemental2/issues/86
> >
> > Until that is completed you will have to use jsinterop to do it yourself.
> >
> > On Sat, Aug 10, 2019 at 12:54 AM Vassilis Virvilis  
> > wrote:
> >>
> >> What about Document.execCommand() ?
> >>
> >>
> >> On Fri, Aug 9, 2019 at 5:20 PM Vassilis Virvilis  wrote:
> >> >
> >> > Hi,
> >> >
> >> > I am looking for  Document.createEvent and I can see that createEvent
> >> > is defined in DocumentEvent which is an interface but Document itself
> >> > does not inherit/implement this interface.
> >> >
> >> > I suppose I can cast Document it to DocumentEvent with Js.cast() but
> >> > that's ugly.
> >> >
> >> > So what's going on?
> >> >
> >> > I am using elemental2 2.25 as published by Peter Donald.
> >> >
> >> > --
> >> > Vassilis Virvilis
> >>
> >>
> >>
> >> --
> >> Vassilis Virvilis
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "GWT Users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an 
> >> email to google-web-toolkit+unsubscr...@googlegroups.com.
> >> To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEx4%2B3TZuMJf2%3DBiCW6d57o-OLoMiBjqjSi%3DMjPny%2B%2B_ug%40mail.gmail.com.
> >
> >
> >
> > --
> > Cheers,
> >
> > Peter Donald
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "GWT Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to google-web-toolkit+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4frwwFenqaAGPN3nBxgsYHJ_gO_86QbOPQpBT02eySsg%40mail.gmail.com.
>
>
>
> --
> Vassilis Virvilis



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwQ-JWEk94wTrrvC52FewYqdt_bmOA2EauxkKhF0sEWpw%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-11 Thread Vassilis Virvilis
Hi Peter,

Thanks for replying and for pointing me to the github issue.

I am thinking the following strategy.

Create a MyHTMLDocument that extends HTMLDocument and it has the
execCommand but without the @Override annotations.

That way when HTMLDocument gets execDocument implemented I will get a
warning and at that point I will be able to remove the MyHTMLDocument
class and use the official one. Aargh now I see that is already
mentioned in the comments of the original execCommand issue at
https://github.com/google/elemental2/issues/43 by vegegoku.

Thanks again.

   Vassilis

On Sun, Aug 11, 2019 at 8:31 AM Peter Donald  wrote:
>
> execCommand is not yet part of elemental2. There is no reason why it should 
> not be other than the externs need cleaning up. It is on my list of things to 
> do some time but we don't use it so I haven't got off my kaboose to do the 
> work. The issue that is tracking this (among other things) is 
> https://github.com/google/elemental2/issues/86
>
> Until that is completed you will have to use jsinterop to do it yourself.
>
> On Sat, Aug 10, 2019 at 12:54 AM Vassilis Virvilis  wrote:
>>
>> What about Document.execCommand() ?
>>
>>
>> On Fri, Aug 9, 2019 at 5:20 PM Vassilis Virvilis  wrote:
>> >
>> > Hi,
>> >
>> > I am looking for  Document.createEvent and I can see that createEvent
>> > is defined in DocumentEvent which is an interface but Document itself
>> > does not inherit/implement this interface.
>> >
>> > I suppose I can cast Document it to DocumentEvent with Js.cast() but
>> > that's ugly.
>> >
>> > So what's going on?
>> >
>> > I am using elemental2 2.25 as published by Peter Donald.
>> >
>> > --
>> > Vassilis Virvilis
>>
>>
>>
>> --
>> Vassilis Virvilis
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEx4%2B3TZuMJf2%3DBiCW6d57o-OLoMiBjqjSi%3DMjPny%2B%2B_ug%40mail.gmail.com.
>
>
>
> --
> Cheers,
>
> Peter Donald
>
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4frwwFenqaAGPN3nBxgsYHJ_gO_86QbOPQpBT02eySsg%40mail.gmail.com.



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwSH1dTm4UP7zOEGMBs7YtHwo_cOV8i65cS8Mq8G9xxWQ%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-09 Thread Vassilis Virvilis
What about Document.execCommand() ?


On Fri, Aug 9, 2019 at 5:20 PM Vassilis Virvilis  wrote:
>
> Hi,
>
> I am looking for  Document.createEvent and I can see that createEvent
> is defined in DocumentEvent which is an interface but Document itself
> does not inherit/implement this interface.
>
> I suppose I can cast Document it to DocumentEvent with Js.cast() but
> that's ugly.
>
> So what's going on?
>
> I am using elemental2 2.25 as published by Peter Donald.
>
> --
> Vassilis Virvilis



--
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEx4%2B3TZuMJf2%3DBiCW6d57o-OLoMiBjqjSi%3DMjPny%2B%2B_ug%40mail.gmail.com.


elemental2: Document.createEvent ?

2019-08-09 Thread Vassilis Virvilis
Hi,

I am looking for  Document.createEvent and I can see that createEvent
is defined in DocumentEvent which is an interface but Document itself
does not inherit/implement this interface.

I suppose I can cast Document it to DocumentEvent with Js.cast() but
that's ugly.

So what's going on?

I am using elemental2 2.25 as published by Peter Donald.

-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExNRyhiL67mb8JKan8DEW0xcUupHpQuq6PnchwCSHYxTA%40mail.gmail.com.


Re: Is it possible to mark a class as @JsType native without explicit annotation?

2019-02-15 Thread Vassilis Virvilis
Ok,
just for posterity...

I managed to add jsinterop jars as dependencies. Then I had to change my
simple POJO to be jsinterop compatible.
I didn't want to update all call sites but I had to do it anyway (due to
constructor changes). If there is a better way let me know.

I thought about @JsProperty but this is also a server side class and it
wouldn't work server side. Am I right on this?

Here are the changes:
- Constructor with arguments --> @JsOverlay static factory method
- getters/setter --> @JsOverlay, final

Before:
---
public class MyClass {
private String id;

   public MyClass(String id) {
this.id = id;
   }

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}
}

After:
-
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class MyClass {
private String id;

  @JsOverlay
   public static create(String id) {
final MyClass myClass = new MyClass();
myClass.setId(id);
  }

   @JsOverlay
public final String getId() {
return id;
}

   @JsOverlay
public final void setId(String id) {
this.id = id;
}
}



On Fri, Feb 8, 2019 at 5:09 PM Vassilis Virvilis  wrote:

> I thought so...
>
> Nevertheless thanks for answering so swiftly.
>
>Vassilis
>
> On Fri, Feb 8, 2019 at 5:07 PM Jens  wrote:
>
>>
>> Does that capability exists somehow?
>>>
>>
>> No. You have to create your own class, mark it as JsType and delegate to
>> the class you don't own.
>>
>> -- J.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-web-toolkit@googlegroups.com.
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Vassilis Virvilis
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to mark a class as @JsType native without explicit annotation?

2019-02-08 Thread Vassilis Virvilis
I thought so...

Nevertheless thanks for answering so swiftly.

   Vassilis

On Fri, Feb 8, 2019 at 5:07 PM Jens  wrote:

>
> Does that capability exists somehow?
>>
>
> No. You have to create your own class, mark it as JsType and delegate to
> the class you don't own.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Is it possible to mark a class as @JsType native without explicit annotation?

2019-02-08 Thread Vassilis Virvilis
Hi,

I have a class that I want to use in jsinterop but I don't want to mark it
explicitly because I don't own the source and I want to minimize the diff.

So I would like the ability to do it outside the class. Let's say with a
command line option during compile or even better with a config file.

Does that capability exists somehow?

Thanks

-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT 2.9 Questions

2018-09-05 Thread Vassilis Virvilis
Another datapoint is that debian unstable switched to openjdk10 for tomcat
so staying back to openjdk8 is also painful for me.

   Vassilis

On Wed, Sep 5, 2018 at 12:57 PM Thomas Broyer  wrote:

> Replying to everyone in one go.
>
> On Wednesday, September 5, 2018 at 9:12:38 AM UTC+2, Josselin B. wrote:
>>
>> Hi Jens,
>>
>> Any idea for a release date of GWT 2.x ?
>>
>
> No. You can follow advancement at
> https://github.com/gwtproject/gwt/milestone/19 (it doesn't move much
> though…)
> For now, it didn't seem urgent to release a 2.9, as 2.8.2 works great for
> 99.9% of people.
>
>
>> Will it add better support for java interface default functions ?
>>
>
> What do you mean?
> I can't remember issues related to interface default methods (lambdas and
> method references, sure, but not interface default methods)
>
>
>> Le mer. 5 sept. 2018 à 09:07, Jens  a écrit :
>>
>>> GWT 2.x will not drop JSNI anytime soon, only GWT 3 will as it uses a
>>> different Java -> JavaScript compiler internally. And yes there is really
>>> no timeline for GWT 3 as most work is done by contributors in free time.
>>> Currently we are trying to migrate GWT 2.x SDK code so it will become GWT 3
>>> compatible with mostly no breaking changes. This process happens on Github
>>> and you can see a list of projects being converted here:
>>> ci.vertispan.com . Also some people are working on build plugins to
>>> provide a better experience out of the box.
>>>
>>> GWT 2.x SNAPSHOT already supports Java 10 syntax, however no Java 9 + 10
>>> API additions have been emulated yet in GWT SDK, so you can not use new
>>> Optional methods and such things. Also some Java 8 APIs are still missing.
>>>
>>> The only syntax addition of Java 11 is using 'var' for lambda
>>> parameters. GWT depends on Eclipse JDT stable release in order to support
>>> new syntax features. If you don't use that feature then you should probably
>>> be able to run current GWT with Java 11, haven't tried it though. Never
>>> used OpenJDK with GWT but I can't think of a reason why it should not work.
>>>
>>
> I (almost) exclusively use OpenJDK, and never had any problem.
> Also, OpenJDK 11 and Oracle JDK 11 will (finally) be functionally the
> same, so if GWT works with Oracle JDK 11, it *will* work with OpenJDK 11.
>
> GWT 2.8.2 works with OpenJDK 10 and Oracle JDK 10 already, and while I
> haven't tested I see no reason it wouldn't work with JDK 11 (the big change
> was Jigsaw/JPMS in JDK 9).
>
> Fwiw, my plan (personal and at work, not for GWT proper) is staying on
> OpenJDK 8 for a little while (switching from Oracle JDK 8 to OpenJDK 8 if
> needed). It looks like there will be many OpenJDK packages with LTS support
> (most Linux distros, AdoptOpenJDK, Zulu) so I may switch to OpenJDK 11 at
> some point, but I bet it won't be before a year… (first and foremost, our
> customers clearly aren't ready; some are only just switching off of Java 7
> …up to Java 8)
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Testing native @JsType in GWT tests

2018-03-11 Thread Vassilis Virvilis
I would guess that script injector injects by default inside gwt frame.

You need to specify TOP_WINDOW because jsinterop are mapped to $wnd by
default.

Something like that (can't test right now)

ScriptInjector.fromString(js).setWindow(ScriptInjector.TOP_WINDOW).inject();

If you do this then you need to change your jsni test to

  var p = new $wnd.ns.Person();

 Hope that helps.

Vassilis


On Sun, Mar 11, 2018 at 3:44 PM, Mincong Huang <mincon...@gmail.com> wrote:

> Hi,
>
> I've a simple JavaScript:
>
> var ns = {
>   Person: function() {
> this.sayHello = function() {
>   return 'Hi';
> };
>   }
> }
>
> And I used it to test JsInterop annotation `@JsType` in my GWT test. I
> injected JS code to
> GWTTestCase and tried to retrieve the definition via `@JsType`. However,
> it doesn't
> work, it seems that GWT cannot find the method (see Travis CI [1]):
>
> > [INFO] [ERROR] function @io.mincongh.client.interop.
> GwtTestJsInterop$Person::sayHello() NOT FOUND, thisObj:
> com.google.gwt.dev.shell.JavaObject@43182ce3, methodName:
> @io.mincongh.client.interop.GwtTestJsInterop$Person::sayHello()
> > [INFO] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
> 11.342 sec <<< FAILURE!
>
> Actually, my code is pretty simple:
>
> public class GwtTestJsInterop extends GWTTestCase {
>   @Override
>   public void gwtSetUp() {
> String js = "var ns = { Person: function() { this.sayHello =
> function() { return 'Hi'; }; } }";
> ScriptInjector.fromString(js).inject();
>   }
>
>   @Override
>   public String getModuleName() {
> return R.JUNIT_MODULE;
>   }
>
>   public void testJsni() {
> assertEquals("Hi", sayHello());
>   }
>
>   private native String sayHello() /*-{
> var p = new ns.Person();
> return p.sayHello();
>   }-*/;
>
>   public void testJsType() {
> Person p = new Person();
> String words = p.sayHello();
> assertEquals("Hi", words);
>   }
>
>   @JsType(namespace = "ns", isNative = true)
>   private static class Person {
> public native String sayHello();
>   }
> }
>
>
> Note: The 2nd test method, `testJsni()`, runs successfully, so the JS
> should be
> injected correctly. I also have the flag `generateJsInteropExports`
> enabled in the
> Maven GWT plugin in the POM [2]. So what am I missing?
>
> I'm using GWT 2.8.2 and Maven GWT plugin 2.8.2. Any help will be
> appreciated!
>
> Thank you,
> Mincong HUANG
>
> [1]: https://travis-ci.org/mincong-h/learning-gwt/builds/351967694#L754
> [2]: https://github.com/mincong-h/learning-gwt/blob/
> ccb8fee02fcae78b1a5db62d5722cd29ace53286/pom.xml#L106
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: How to debug a crash that occurs only when draftCompile=false?

2018-03-05 Thread Vassilis Virvilis
I would try to compile with -style DETAILED

The generated js maps pretty well to the java code.

Vassilis

On Mon, Mar 5, 2018 at 5:52 PM, Bruno Salmon <dev.salm...@gmail.com> wrote:

> hi,
>
> I have a GWT application that runs ok when draftCompile=false but crashes
> when turning draftCompile to true (which is the case in production).
>
> How can I fix that? Can it be related to something wrong in my java code
> source?
>
> The browser reports an exception (a classical property access problem on
> an undefined object) and I have the exact JS line where this happens, but
> it's not helpful if I can't match this line with my java code.
> The problem is that when I run the app in super dev mode to get the source
> maps, the crash doesn't occur anymore... Is it because the code server
> automatically make a draft compile ? Can we avoid that to get the same
> result as the production environment?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Understanding JsInterop

2018-02-15 Thread Vassilis Virvilis
Amazing trick!

Obvious if you think about it - but very difficult to think it initially
(for us mere mortals).

   Vassilis

On Thu, Feb 15, 2018 at 11:53 AM, Thomas Broyer <t.bro...@gmail.com> wrote:

>
>
> On Thursday, February 15, 2018 at 10:21:59 AM UTC+1, Scott Shumway wrote:
>>
>> Greetings
>>
>> I am trying to get a DOMRect from an Element. I can do this with JSNI,
>> but have been unable to make a JsInterop version. Here's what I have:
>>
>> public final class DOMRect extends JavaScriptObject
>> {
>>  // returns DOMRect or null
>>  public static native DOMRect getBoundingClientRect(Element element)
>>  /*-{
>>  return element.getBoundingClientRect && element.getBoundingClientRect();
>>  }-*/;
>>
>>  protected DOMRect()
>>  {
>>  }
>>
>>  public final native double getX()
>>  /*-{
>>  return this.x;
>>  }-*/;
>>
>>  // etc.
>> }
>>
>> I can make a JsType for DOMRect, no problem. The issue I'm having is with
>> getBoundingClientRect(). This function may not exist which is why there is
>> a null check.
>>
>
> You'll want a @JsProperty for the method so you can check whether it's
> null or not; and then either declare it also as a @JsMethod in parallel to
> call it, or have the @JsProperty return a @JsFunction (or then cast to an
> elemental2.dom.Element).
> And you can hide the details the same way you did with JSNI, with a
> @JsOverlay:
>
> @JsType(isNative=true, namespace=JsPackage.GLOBAL, name="Element")
> class Element {
>   @JsProperty(name="getBoundingClientRect") private native Object
> getGetBoundingClientRect();
>   @JsMethod(name="getBoundingClientRect") private native DOMRect
> callGetBoundingClientRect();
>
>
>   @JsOverlay
>   public DOMRect getBoundingClientRect() {
> return getGetBoundingClientRect() == null ? null :
> callGetBoundingClientRect();
>   }
> }
>
> or
>
> @JsType(isNative=true, namespace=JsPackage.GLOBAL, name="Element")
> class Element {
>   @JsProperty(name="getBoundingClientRect") public native
> GetBoundingClientRect getBoundingClientRect();
>
>
>   @JsFunction
>   interface GetBoundingClientRect {
> public DOMRect invoke();
>   }
> }
>
>
> If I make an interface for getBoundingClientRect, I'm not allowed to cast
>> Element to implement it.
>>
>
> How so‽
> You cannot use JavaScriptObject#cast(), but you should be able to use a
> standard Java cast.
> You might have to first cast to Object to please javac:
>
> ((HasGetBoundingClientRect) (Object) elt).getBoundingClientRect()
>
>
>
>> I can't extend Element, either. With JSNI, I am allowed to compile
>> Javascript into Javascript, but I can't with JsInterop. It seems like a lot
>> of trouble for 1 line of Javascript.
>>
>> How can I do this? Thanks in advance...
>>
>
> getBoundingClientRect is supported in (literally) all browsers, so don't
> bother and just call the method: https://caniuse.com/#
> feat=getboundingclientrect, https://developer.mozilla.org/
> en-US/docs/Web/API/Element/getBoundingClientRect#Browser_compatibility
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Elemental2 RC1: RegExp disappeared?

2018-02-06 Thread Vassilis Virvilis
Thomas thanks.

Makes sense.


On Tue, Feb 6, 2018 at 4:15 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

> Fwiw, change was https://github.com/google/jsinterop-generator/commit/
> bef23d3b0b365a56624767d4a9734d05ffa96264?w=1#diff-
> 16404aeb1089b0449b32db86df85d7e8R61
> Initially, only java.lang classes were included (rationale is
> http://errorprone.info/bugpattern/JavaLangClash) and it got changed to
> include all/most native JS types that have an equivalent in the JDK (with
> IteratorIterable and IIterableResult probably included for consistency with
> JsInterable et al.)
>
>
> On Tuesday, February 6, 2018 at 10:22:59 AM UTC+1, Vassilis Virvilis wrote:
>>
>> ok
>>
>> I took I better look and looks like it is only for classes that clashing
>> with Java types, such as RegExp, Set, Math, JsBoolean, JsArray etc
>>
>> Sorry for the noise...
>>
>> On Tue, Feb 6, 2018 at 11:15 AM, Vassilis Virvilis <vasv...@gmail.com>
>> wrote:
>>
>>> Hi Thomas,
>>>
>>> Do you happen to have any link with the rationale for this?
>>>
>>> I can understand that having elemental2.dom.Document and
>>> com.google.gwt.dom.client.Document in the same java file may be
>>> somewhat confusing.
>>>
>>> However I believe to be able to map directly js code to java without the
>>> need to put (mentally) everywhere Js is a good thing.
>>>
>>>
>>> On Tue, Feb 6, 2018 at 12:31 AM, Thomas Broyer <t.bro...@gmail.com>
>>> wrote:
>>>
>>>> Native types have been renamed with a Js prefix:
>>>> https://static.javadoc.io/com.google.elemental2/elemental2-c
>>>> ore/1.0.0-RC1/elemental2/core/JsRegExp.html
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "GWT Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to google-web-toolkit+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to google-web-toolkit@googlegroup
>>>> s.com.
>>>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Vassilis Virvilis
>>>
>>
>>
>>
>> --
>> Vassilis Virvilis
>>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Elemental2 RC1: RegExp disappeared?

2018-02-06 Thread Vassilis Virvilis
ok

I took I better look and looks like it is only for classes that clashing
with Java types, such as RegExp, Set, Math, JsBoolean, JsArray etc

Sorry for the noise...

On Tue, Feb 6, 2018 at 11:15 AM, Vassilis Virvilis <vasv...@gmail.com>
wrote:

> Hi Thomas,
>
> Do you happen to have any link with the rationale for this?
>
> I can understand that having elemental2.dom.Document and
> com.google.gwt.dom.client.Document in the same java file may be somewhat
> confusing.
>
> However I believe to be able to map directly js code to java without the
> need to put (mentally) everywhere Js is a good thing.
>
>
> On Tue, Feb 6, 2018 at 12:31 AM, Thomas Broyer <t.bro...@gmail.com> wrote:
>
>> Native types have been renamed with a Js prefix:
>> https://static.javadoc.io/com.google.elemental2/elemental2-c
>> ore/1.0.0-RC1/elemental2/core/JsRegExp.html
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-web-toolkit@googlegroups.com.
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Vassilis Virvilis
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Elemental2 RC1: RegExp disappeared?

2018-02-06 Thread Vassilis Virvilis
Hi Thomas,

Do you happen to have any link with the rationale for this?

I can understand that having elemental2.dom.Document and
com.google.gwt.dom.client.Document in the same java file may be somewhat
confusing.

However I believe to be able to map directly js code to java without the
need to put (mentally) everywhere Js is a good thing.


On Tue, Feb 6, 2018 at 12:31 AM, Thomas Broyer <t.bro...@gmail.com> wrote:

> Native types have been renamed with a Js prefix:
> https://static.javadoc.io/com.google.elemental2/elemental2-
> core/1.0.0-RC1/elemental2/core/JsRegExp.html
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Specific chart or graph

2018-02-02 Thread Vassilis Virvilis
My personal favorite is D3 https://d3js.org/

There is a gwt wrapper here https://github.com/gwtd3/gwt-d3

Hope that helps


On Fri, Feb 2, 2018 at 10:45 AM, David <leeon2...@gmail.com> wrote:

> I am considering using https://github.com/ahome-it/lienzo-core. But I am
> not pretty sure it fits my requirements. I would appreciate it if some body
> has some examples.
>
> David
>
>
>
> On Friday, February 2, 2018 at 3:27:17 PM UTC+8, Frank wrote:
>>
>> - Write a wrapper for this part of vis.js. Not really that hard.
>> - Check out ChapLinks. This is the old version of vis.js, not longer
>> supported. But it comes with GWT wrappers included.
>> - gflot ?
>>
>> Op vrijdag 2 februari 2018 03:57:56 UTC+1 schreef David:
>>>
>>> I need to create some specific chart or graph on WEB (Please see
>>> attachment). I found http://visjs.org/example
>>> s/graph2d/11_barsSideBySideGroups.html, which seems to be best
>>> solution. But there is no GWT wrapper. Can you recommend some good solution
>>> or tool to me?
>>>
>>>
>>> Thanks,
>>>
>>> David
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: JsInterop Array

2017-12-19 Thread Vassilis Virvilis
I had a similar problem with DataTables requiring a String[] argument. The
one generated from java had some hidden fields that DataTables choke on. I
ended up creating a JsString type that casts from/to String, but at the
time I didn't know or didn't exist the gwt-interop-utils.

In your case however I would suggest the following:

*** NOTE:  int and int[] are not represented in javascript *** and you may
have a problem during casting in/out. I would suggest using double if/when
you hit the problems. Traceback and browser's debugger is invaluable.

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")

public class NodeSet {
  public int id;
  public int x;   <-- conside use of double
  public int y;
  public int[] nodes;

  @JsOverlay
  public static NodeSet create(int id, int x, int y, int[] nodes) {
  final NodeSet ns = new NodeSet();
  ns.id = id;
  ns.x = x;
  ns.y = y;
  ns.nodes = nodes;
  return ns;
  }
}




On Mon, Dec 18, 2017 at 8:18 PM, cesar paulo alves <caesaral...@gmail.com>
wrote:

> Hello guys, so I'm getting crazy with this.
>
> I need to inject a java array inside a javascript library.
>
> The problem is that the Js library will iterate over an integer array, and
> if the element is not an integer it exits the function.
> When I create the integer array and pass it to plain javascript array, for
> some reason it carries garbage inside, I already tried everything with no
> success.
>
> So this is my java nodeset (https://pastebin.com/AdJqj80p)
>
>
> <https://lh3.googleusercontent.com/-AwVwbsEDgEo/WjgDruEwP_I/Ch4/PRODa3vy6Nsb3stgjMkxrhLEmLIOu7tkQCLcBGAs/s1600/Screenshot_20171218_180625.png>
>
> I'm using the gwt-interop-utils
> <https://github.com/GWTReact/gwt-interop-utils> -> https
> ://github.com/GWTReact/gwt-interop-utils/blob/master/src/
> gwt/interop/utils/client/plainobjects/JsPlainObj.java
>
>
> And when I inspect the javascript object in the browser you can see it has
> lots of garbage, and I cant clean it. See the nodes array I have
> (_clazz_0_g$,__elementTypeCategory$,_elementTypeId$"..).
>
>
> <https://lh3.googleusercontent.com/-7LN-93NvDAc/WjgEg4wts7I/CiE/AJ5jJO9hy7If7kS7EGb0e5_AdV170DsWACLcBGAs/s1600/Screenshot_20171218_180917.png>
>
>
> And when I do the same with Js I don't have this garbage (obvious).
>
>
> <https://lh3.googleusercontent.com/-C1POb2aM3EA/WjgFUx4qlSI/CiQ/5t1bqZCIAY4pXAbsakpmxHGowXG1eVBngCLcBGAs/s1600/Screenshot_20171218_181337.png>
>
>
> I already used the JsArray and everything, but no luck =/.
>
>
> Do you have any Idea how to have a plain javascript array with jsInterop?
>
>
> Thanks a lot.
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] jsinterop-base github repository and new beta release

2017-11-11 Thread Vassilis Virvilis
Hi,

is there any documentation available that we can read?

It's not a big library and I can read through the code but I would
appreciate a high level overview when we should employ jsinterop-base, what
is the best casting strategy and all these...

   Vassilis

On Sat, Nov 11, 2017 at 9:59 AM, 'Julien Dramaix' via GWT Contributors <
google-web-toolkit-contributors@googlegroups.com> wrote:

> I'll create a new release of elemental2 next week. Stay tuned.
>
>
> On Friday, November 10, 2017 at 6:13:31 PM UTC-8, Peter Donald wrote:
>>
>> Great work - thanks!
>>
>> Is this compatible with the last release of elemental2? (IIRC it
>> was 1.0.0-beta-1)
>>
>> On Sat, Nov 11, 2017 at 12:22 PM, 'Julien Dramaix' via GWT Contributors <
>> google-web-toolkit-contributors@googlegroups.com> wrote:
>>
>>> Dear contributors,
>>>
>>> We've just created a new github repository containing the source code of
>>> jsinterop-base: https://github.com/google/jsinterop-base
>>>
>>> We've also released a new beta version of the library:
>>> jsinterop-base:1.0.0-beta-3
>>> <https://oss.sonatype.org/content/repositories/releases/com/google/jsinterop/base/1.0.0-beta-3/>
>>>
>>> You can try it by downloading the jar file
>>> <https://oss.sonatype.org/content/repositories/releases/com/google/jsinterop/base/1.0.0-beta-3/base-1.0.0-beta-3.jar>
>>> or use the following Maven dependency:
>>>
>>>
>>> 
>>>   com.google.jsinterop
>>>   base
>>>   1.0.0-beta-3
>>> 
>>>
>>>
>>> Don’t hesitate to report any bugs, issues, concerns you have on the github
>>> issue tracker <https://github.com/google/jsinterop-base/issues>.
>>>
>>> -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+unsubscr...@googlegroups.com
>>> .
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/google-web-toolkit-contributors/CABXeq2TrKCNg0i0R%2BUB%2
>>> BPBDGEPL2r--jQFA5ZQOyywdOGvsdsg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABXeq2TrKCNg0i0R%2BUB%2BPBDGEPL2r--jQFA5ZQOyywdOGvsdsg%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Cheers,
>>
>> Peter Donald
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-web-toolkit-contributors/ff40c05b-5f30-
> 418e-9caa-6a53a96dfa84%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/ff40c05b-5f30-418e-9caa-6a53a96dfa84%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEznHEK%2B4vhL0qYBPDZ-ND%3D_Jf01zDm51fpk2s5pVuxJ-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: New project best practice

2017-11-05 Thread Vassilis Virvilis
ice and developers seem active and
>
> We also have our own library that does state management which is a
> reimplementation of principles of Mobx in java with a few other libraries
> blended into it. It is probably one of the best things about our new
> architecture but it is still in flux but will hopefully stabilise by the
> start of December. Unfortunately it is yet to be properly documented but
> you can see the start of it at http://realityforge.org/arez/ and
> https://github.com/realityforge/arez
>
> We are also working on a fork/rewrite of GWTReact (
> https://github.com/GWTReact/gwt-react) - you can see our work at
> http://realityforge.org/react4j/ and https://github.com/
> realityforge/react4j but it is in an early stage and I expect it will
> stabilise Mar next year. I am encouraged to see that react may also be
> moving towards being optimisable by closure compiler which would
> potentially make a lot of different in j2cl world.
>
> You can see what an Arez+React4j applications looks like at
> https://github.com/realityforge/react4j/tree/master/todomvc/src/main/java/
> react4j/todomvc
>
> So it depends on how much runway you have to launch your app and how long
> you want to support it. If you can experiment in the javascript ecosystem
> and bring what you want from there. Our move to Arez+React4j has been
> amazingly successful and I can not see us ever going back to the old way of
> building apps ... ever. What works for us may not work for you (the groups
> is mostly java developers who are not front end specialists). However the
> javascript ecosystems is rich enough that you will find something that
> works in your context. (It should be noted that I have also hear rumours
> that there are people who are looking at bringing significant portions of
> gwt2 framework in j2cl age so staying with what you know and adopting GMD
> or a similar modern widget toolkit may also work)
>
> There are some things that are missing in GWT2.x world that I hope will be
> fixed by j2cl/GWT (optimising native javascript, webpack equivalent, better
> asset pipeline control) but it has not stopped us moving everything else
> forward and development is great again.
>
> --
> Cheers,
>
> Peter Donald
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: cast Element to Elemental2

2017-10-18 Thread Vassilis Virvilis
Thomas advice is of course preferable

But sometimes gwt type checking drives me crazy. Then I use this

JsUtil.java

   public static native <T, V> V cast(T data) /*-{
return data;
}-*/;


This casts anything to anything...

   Vassilis


On Wed, Oct 18, 2017 at 2:39 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

> You should be able to cast a JSO to a JsType (native ones only?)
> And in this case they indeed represent the same kind of objects so this is
> safe.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Typescript annotations to JsInterop java classes automatic generation tool ready

2017-09-28 Thread Vassilis Virvilis
Wow! This is impressive!

I am not familiar with Angular and cannot comment in the quality of the
generated API.

Any chance you could post jquery jsinteropified with your tool? jquery is
the basis for a lot of libraries so if you get that correctly a lot
libaries will be trivial to process.

I skimmed through the README and I like the configuration control. Can it
be per class or is a global configuration per .d.ts file?

Thanks for that contribution.



On Thu, Sep 28, 2017 at 12:54 PM, Ltearno <ltea...@gmail.com> wrote:

> Hi everyone,
>
> I made up and published today a tool which uses Typescript type
> definitions (.d.ts) and generates the corresponding JsInterop classes for
> use inside a GWT application (or JaCL when available).
>
> The tool is here : https://github.com/ltearno/typescript2java
>
> I use it to translate the full Angular 4 API (2000+ classes) into
> JsInterop and get a working code. It can also generate the standard web api
> from 'lib.es6.d.ts' and generate something that ressembles Elemental2 a lot!
>
> I am interested to help if people want to use it or have some other use
> cases (wrapping D3.js or any other library available on 'definitely
> typed'). So don't hesitate to file an issue on github... Or to answer here!
>
> Thanks
> Arnaud
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: elemental.json confusion/error

2017-09-21 Thread Vassilis Virvilis
Hi,

On Wed, Sep 20, 2017 at 5:18 PM, Thomas Broyer  wrote:

>
>  You might also want to have a look at elemental2-core: https://
> javadoc.io/doc/com.google.elemental2/elemental2-core/1.0.0-beta-1 (which
> BTW defines JSONType.parse(…)), but be careful as Elemental2 is entirely
> generated, and might change in the future as the generator evolves (also,
> Elemental 2 might require that you use the HEAD-SNAPSHOT of GWT)
>
>
Any timeframe on this? I mean on freezing the elemental2.

I am asking because without this it is impossible to port other libraries
to jsinterop. jquery, datatables, d3 are the most important for me.

Is the plan to generate everything from typescript files still exists?

   Vassilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Data class in JsInterop

2017-09-15 Thread Vassilis Virvilis
I didn't know you could put @JsIgnore in the constructor...

Aah now I see that your JsClass is not a native type.

What I am usually doing is

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class JsClass {
  public String a,b;

  @JsOverlay
  public static JsClass create(String a, String b) {
 final JsClass c = new JsClass();
 c.a = a;
 c.b = b;
 return c;
  }
}

Don't know if the @JsIgnore/Constructor/native trick would work. So far I
am using @JsOverlay/static creator/native instead.

I will try it out some time.

Hope that helps

Vassilis

On Fri, Sep 15, 2017 at 2:48 PM, Kirill Prazdnikov <pkir...@gmail.com>
wrote:

> Hi, I need the following code needs to be generated:
>
> function f(a,b) { return { a:a, b:b }; }
>
> This is super - easy in JSNI mode. However to be in the modern stream and
> to be portable I trying to do that using JsInterop
>
> @JsType(namespace = JsPackage.GLOBAL)
> public class JsClass {
>   public String a,b;
>
>   @JsIgnore
>   public JsClass(String a, String b) { this.a=a; this.b=b; }
> }
>
> It seems to be working, however in the compiled code I see something super
> strange I can not understand:
>
> function a_g$(){
>   a_g$ = Object;
> }
>
> function Ezf_g$(){
>   Ezf_g$ = Object;
>   a_g$();
> }
>
> function a3i_g$(a_0_g$, b_0_g$){
>   Ezf_g$();
>   i_g$.call(this);
>   this.$init_1758_g$();
>   this.a = a_0_g$;
>   this.b = b_0_g$;
> }
>
> _.$init_1758_g$ = function Fzf_g$(){
>   Ezf_g$();
> }
>
>
> where Ezf_g$ seems to be doing nothing, i_g$.call(this) is doing nothing,
> this.$init_1758_g$() is doing nothing, and a_g$() is doing nothing.
>
> What is this all for ? What am I missing?
> How go get the line I need with JsInterop ?
>
> Thanks
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: ClassCastException in generics

2017-08-23 Thread Vassilis Virvilis
Wow!

Isn't this somewhat serious? It looks that it bypass the browser's security
model, XSS and all that...

That was one fascinating thread to watch.

On Wed, Aug 23, 2017 at 4:33 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

>
>
> On Wednesday, August 23, 2017 at 2:31:20 PM UTC+2, Kirill Prazdnikov wrote:
>>
>> public static native FileReader newFileReader() /*-{
>>> return new *$wnd*.FileReader();
>>> }-*/;
>>>
>>>
>> This will not help, fileReader.resultArrayBuffer()returns not a instance
>> of $wnd.ArrayBuffer anyway.
>>
>
> Ouch! You're unfortunately right: https://jsfiddle.net/wuvbnpz6/1/
> …at least in Chrome; because Firefox works as intended!
> Please report the bug at https://crbug.com (if no-one did already), and
> in the mean time, use name="Object", or possibly use a Java interface
> rather than a class.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: ClassCastException in generics

2017-08-23 Thread Vassilis Virvilis
I think Thomas means how do you get the ArrayBuffer.You said from the
FileReader but

How FileReader is created at the first place? I mean Is the script that
returns the FileReader loaded by

   1. your GWT script? If which option did you use ScriptInjector. If yes -
   did you setWindow?
   2. the host html page where your GWT script is loaded?

Documentation says:

File objects may be obtained from a FileList
<https://developer.mozilla.org/en-US/docs/Web/API/FileList> object returned
as a result of a user selecting files using the 
<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input> element,
from a drag and drop operation's DataTransfer
<https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer> object, or
from the mozGetAsFile() API on an HTMLCanvasElement
<https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement>.

What happens if you put package name as $wnd?
@JsType(isNative = true, namespace = "$wnd")

Vassilis




On Tue, Aug 22, 2017 at 9:28 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

> Is the FileReader "instanceof $wnd.FileReader"? (Walk up the chain)
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: ClassCastException in generics

2017-08-22 Thread Vassilis Virvilis
Kirill,

I am out of suggestions for but my curiosity drives me crazy.

What are you trying to do in java terms? For example:


   - Are you try to return an ArrayBuffer from a function: public  T
   getBuffer();
   - Are you try to pass an ArrayBuffer as a parameter: public  void
   sendBuffer(T buffer);
   - Are you try to put the ArrayBuffer in a List, Array, Set?
   - Something else?

I looked but I didn't find in the thread the description of the java caller
that throws the exception.






On Tue, Aug 22, 2017 at 3:04 PM, Kirill Prazdnikov <pkir...@gmail.com>
wrote:

> Sorry, copypaster error, here is the fixed
>
> getType(buffer) = [object ArrayBuffer]
> typeOf(buffer) = object
>
>
> вторник, 22 августа 2017 г., 15:02:49 UTC+3 пользователь Kirill Prazdnikov
> написал:
>
>> Here it is:
>>
>> getType(buffer) = [object ArrayBuffer]
>> typeOf(buffer) = [object ArrayBuffer]
>>
>> private native String getType(Object x) /*-{
>> return Object.prototype.toString.call(x);
>> }-*/;
>>
>> private native String typeOf(Object x) /*-{
>> return typeof x;
>> }-*/;
>>
>>
>>
>> понедельник, 21 августа 2017 г., 21:47:37 UTC+3 пользователь Tony
>> BenBrahim написал:
>>>
>>> Take the object you get back from the file reader and run it through the
>>> JSNI method below and GWT,log the result. .Let's see if it really is an
>>> ArrayBuffer.(I would note the FileReader result is sometimes a String and
>>> sometimes an ArrayBuffer).
>>>
>>> private native String getType(Object x)/*-{
>>> return Object.prototype.toString.call(x);
>>> }-*/
>>>
>>> ​
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: ClassCastException in generics

2017-08-21 Thread Vassilis Virvilis
Oh I see. I forgot about that.

These ought to work.

> @JsType(isNative = true, namespace = JsPackage.GLOBAL)
> public abstract class ArrayBuffer { ... }




> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name =
> "ArrayBuffer")


I don't know what else may be the problem.

What else is it going on java side?
Maybe the instance you are trying to cast is null?
What else can it be if not ArrayBuffer (hence the need of generic)? An
ArrayBuffer extension?
If you print the variable you are trying to cast in the console? Does it
says that's an ArrayBuffer?

I jave been fighting with jsinterop exceptions for some time and I know
that it can be very frustrating.

 Vassilis



On Mon, Aug 21, 2017 at 4:52 PM, Kirill Prazdnikov <pkir...@gmail.com>
wrote:

> Im talking about standard ArrayBuffer
>
> https://developer.mozilla.org/en/docs/Web/JavaScript/
> Reference/Global_Objects/ArrayBuffer
>
> From the console of the web browser: What is it required to create a new
>> ArrayBuffer?
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: ClassCastException in generics

2017-08-21 Thread Vassilis Virvilis
>From the console of the web browser: What is it required to create a new
ArrayBuffer?

For example is this enough?
> new $wnd.ArrayBuffer();

or something else is required - such as
> new $wnd.package1.package2.ArrayBuffer();

or maybe it is
> new $wnd.package1.package2.array_buffer();

The answers to these questions will show what you need to put in
'namespace' argument and what in 'name'.

Hope that helps





On Mon, Aug 21, 2017 at 3:39 PM, Kirill Prazdnikov <pkir...@gmail.com>
wrote:

> Ok, according to the doc, the name:
>
>>  Customizes the name of the type in generated JavaScript. If not
>> provided, the simple Java name will be used.
>
>
> That means that for my case
>
> @JsType(isNative = true, namespace = JsPackage.GLOBAL)
>> public abstract class ArrayBuffer { ... }
>
>
> This is equvavlent to (name = "ArrayBuffer"). Which was suggested above.
> Right ?
>
> I tried the following without any success:
>
>> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name =
>> "ArrayBuffer")
>
>
> JavaScriptObject jsType is stil null and checkcast failed.
>
> But this works:
>
> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
>
>
> In that case GWT calls castToJsObject, which does not do type checking,
> instead of castToNative. castToNative does type checks.
>
> However I still don`t think that name="Object" is correct for native
> ArrayBuffer.
> If I understand JsInterop correctly, when want to call a @JsConstructor
> form java I must assign a proper name, right ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: has anyone tried building a gwt application using buck ?

2017-08-21 Thread Vassilis Virvilis
Oh my God.

Every time I turn my head the other way there are more of them (build
tools).

:-)


On Sun, Aug 20, 2017 at 9:10 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

>
> On Sunday, August 20, 2017 at 2:37:51 PM UTC+2, Debasish Padhy wrote:
>>
>> Many thanks for such a detailed explanation but I am perplexed at your
>> understanding of the subject although you have never used it.
>>
>
> I have a (not so) secret interest in build tools ;-)
> (see most recent –though already years-old– posts on my blog:
> http://blog.ltgt.net/ ; I do not need the scalability or versatility of
> Bazel, Buck or Pants, so my go-to build tool is Gradle these days, if only
> for its better/easier IDE integration)
>
>
>> Is bazel ready for gwt building ?
>>
>
> I'm told it is: https://github.com/bazelbuild/rules_gwt (with dev mode
> support ;-) )
> (written by a former Googler, who btw also created, and still maintains,
> gwtmockito)
>
> BTW, J2Cl (which will power GWT 3) is designed for use with Bazel (along
> with https://github.com/bazelbuild/rules_closure)
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Accessing "basic" JS Object in JsInterop callback

2017-08-20 Thread Vassilis Virvilis
Great thought.

It could save me some hours/days of modeling the Config Object in java.

On the other hand my Config Object is strictly typed with all the usual
benefits.

On the other hand (apparently the discussion requires 3 hands :) my java
Config Object is not complete. I have defined only the fields I needed. I
would say around 25%. So it needs even more work to be complete while your
solution could be extended easily at request.

!


On Sun, Aug 20, 2017 at 5:47 PM, Tony BenBrahim <tony.benbra...@gmail.com>
wrote:

>
> regarding 1) It would be nice to initialize Objects from json. What would
> happen if the json text specifies members not in class though?
>
> You could always do this, if you just need to pass something to JavaScript
> and do not need to read it...
>
> @JsType(isNative=true, name="JSON", namespace=@JsPackage.GLOBAL)
> public class JSON {
>Object parse(String json);
> }
> 
> Object config=JSON.parse("{foo:1, bar: ["a","b","c"], baz: {a: true, b: 
> false}}");
>
> You c​
> You could even do this if Config is a JsType with name Object and
> namespace GLOBAL:
>
> Config config=(Config) JSON.parse("{foo:1, bar: ["a","b","c"], baz: {a:
> true, b: false}}");
>
> In that case, any properties that do not exist in Config would simply not
> be readable or writable from your Java code, without using JSNI...
>
>
>
>
> On Sunday, August 13, 2017 at 10:46:59 AM UTC-5, Vassilis Virvilis wrote:
>>
>>
>> I had this problem with DataTables Config. DataTables is a nice
>> javascript library for tables https://datatables.net/ and Config is the
>> initialization object like yours. So here is what I did:
>>
>> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name =
>> "Object")
>> public static class Config {
>> String name;
>> TimeStamp timestamp;   // TimeStamp needs to be jsinteropified
>> too or elementat2 needs to be used.
>> String msg;
>>
>> @JsOverlay
>> public static Config create(String name, TimeStamp timestamp,
>> String msg) {
>>final Config config = new Config()
>>config.name = name;
>>config.timestamp = timestamp;
>>config.msg = msg;
>> }
>>  }
>>
>> Hope that helps.
>>
>> 1) It would be nice to initialize Objects from json. What would happen if
>> the json text specifies members not in class though?
>>
>> 2) It would be interesting if JavaScriptObject was below Object in the
>> GWT inheritance and expose .__set() for all java objects. I don't know if
>> that is is possible but I find the thought intriguing. It would be break
>> javac compilation though...
>>
>> Vassilis
>>
>>
>>
>>
>> On Sat, Aug 12, 2017 at 11:59 AM, Andrea Martino <cia...@gmail.com>
>> wrote:
>>
>>> Hi all,
>>> I have recently started testing JsInterop for our GWT 2.8.1 application
>>> and I have encountered a situation I could not solve without using the old
>>> style JSNI approach.
>>>
>>> Consider the following minimal JS library I would like to use in
>>> Java/GWT:
>>>
>>> (function (window, document, undefined) {
>>>
>>> function WatchDog(name) {
>>> this._name = name;
>>> };
>>>
>>> WatchDog.prototype.register = function(callback) {
>>> this._callback = callback;
>>> };
>>>
>>> WatchDog.prototype.broadcast = function(msg) {
>>> if (this._callback) {
>>> this._callback({
>>> 'name' : this._name,
>>> 'timestamp' : new Date().getTime(),
>>> 'msg' : msg
>>> });
>>> }
>>> };
>>>
>>> window.Dummy = {
>>> watchDog : function(name) {
>>> return new WatchDog(name);
>>> }
>>> };
>>>
>>> }(window, document));
>>>
>>> Please note that the broadcast function passes a "basic" JS Object {}
>>> (i.e. without a specific prototype) to the callback function.
>>>
>>> Here below my JsInterop mappings:
>>>
>>> package xxx;
>>>
>>> import jsinterop.annotations.JsPackage;
>>> import jsinterop.annotations.JsType;
>>>
>>> @JsType(isNative = true, namespace = JsPackage.GLOBAL)
>>> public class Dummy {
>>> private Dummy() {}
>>>

Re: ClassCastException in generics

2017-08-18 Thread Vassilis Virvilis
Look, it may not help.

In case if it works I don't understand well enough to explain the
specifics. Maybe it checks javascript castability. Which reminds me... if
your Object can be instantiated from javascript use that info i.e.

@JsType(isNative = true, namespace = "jslib.namespace.whatever" name =
"ArrayBuffer")

If your javascript object is not ArrayBuffer but array_buffer make sure
package name and name matches.

This is what I remember. I may be wrong. I have been before.

 Vassilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: ClassCastException in generics

2017-08-18 Thread Vassilis Virvilis
if it's an array (like a javascript array) use name = "Array".

If it is an Object that encapsulates array functionality use "Object".



On Fri, Aug 18, 2017 at 5:05 PM, Vassilis Virvilis <vasv...@gmail.com>
wrote:

> Try to annotate it with
>
> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
>
> Hope that helps
>
>
>
> On Fri, Aug 18, 2017 at 5:01 PM, Kirill Prazdnikov <pkir...@gmail.com>
> wrote:
>
>> Hi, I`m always getting ClassCastException if I use @JsType(isNative =
>> true) object as a generic template argument.
>>
>> Is it possbile to do something with that ?
>> Is it possbile to avoid check-cast generation if the generic is used with
>> @JsType type ?
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-web-toolkit@googlegroups.com.
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Vassilis Virvilis
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: ClassCastException in generics

2017-08-18 Thread Vassilis Virvilis
Try to annotate it with

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")

Hope that helps



On Fri, Aug 18, 2017 at 5:01 PM, Kirill Prazdnikov <pkir...@gmail.com>
wrote:

> Hi, I`m always getting ClassCastException if I use @JsType(isNative =
> true) object as a generic template argument.
>
> Is it possbile to do something with that ?
> Is it possbile to avoid check-cast generation if the generic is used with
> @JsType type ?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Dealing with javascript functions as parameters and properties

2017-08-16 Thread Vassilis Virvilis
Thanks Jens,

I didn't know about that document. Do you happen to have links in any other
documents like that?

   Thanks


On Wed, Aug 16, 2017 at 1:17 PM, Jens <jens.nehlme...@gmail.com> wrote:

>
>
> Am Mittwoch, 16. August 2017 09:24:49 UTC+2 schrieb Bill Tang:
>>
>> I am working on a Jsinterop wrapper for the GSAP javascript library, and
>> I am quite new to GWT, so I have come across a few problems I am not sure
>> how to solve.
>>
>> My main issue revolves around trying to wrap javascript functions into
>> Java objects.
>>
>> For example, if I have a native javascript function that has a function
>> as one of its parameters, how can I go about wrapping this function
>> in java?
>>
>
> The parameter that is a JS Function should be modeled using a Java
> functional interface, e.g. JsFunction<In, Out> { Out exec(In input); }.
> Then you can use Java method references or lambdas.
>
>
>
>> And if a javascript class has a function has one of its properties, how
>> can I go about wrapping this property?
>>
>
> Similar as above. In Java the property type would be a @JsFunction
> annotated interface.
>
>
> I've had some success using the @JsFunction annotation along with
>> functional interfaces, but I am faced with the problem
>> where I have to declare return types, parameters, and paramater types in
>> the java interface, when I want to be able to supply
>> any arbitrary function, just like I would in native javascript. Is there
>> any way to mimic this functionality?
>>
>
> Java is strongly typed, so some JS things are not possible in Java. Do you
> have a concrete example? Usually JS libs have some rules to functions and
> which parameters they expect. If you have trouble with so called "union
> types" you can take a look at https://docs.google.com/
> document/d/14mQeAGQ9M_5uTTUbzRQzCYETA887dTO-xFLtQhgUXXk/edit to see how
> the jsinterop generator handles it.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Accessing "basic" JS Object in JsInterop callback

2017-08-15 Thread Vassilis Virvilis
I don't think his problem was the callback. This is easily jsinteropified
with @JsFunction.

I think his problem was initializing Object with json

Vassilis

On Tue, Aug 15, 2017 at 1:41 PM, Kirill Prazdnikov <pkir...@gmail.com>
wrote:

> What prevents you using a proper JsType for callback arg ?
>
> public interface Callback {
> void call(ArgT event);
> }
>
> @JsType
> inerface ArgT {
>  @JsProperty A getA();
>  @JsProperty B getB();
>  // e.t.c
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Accessing "basic" JS Object in JsInterop callback

2017-08-13 Thread Vassilis Virvilis
I had this problem with DataTables Config. DataTables is a nice javascript
library for tables https://datatables.net/ and Config is the initialization
object like yours. So here is what I did:

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public static class Config {
String name;
TimeStamp timestamp;   // TimeStamp needs to be jsinteropified too
or elementat2 needs to be used.
String msg;

@JsOverlay
public static Config create(String name, TimeStamp timestamp,
String msg) {
   final Config config = new Config()
   config.name = name;
   config.timestamp = timestamp;
   config.msg = msg;
}
 }

Hope that helps.

1) It would be nice to initialize Objects from json. What would happen if
the json text specifies members not in class though?

2) It would be interesting if JavaScriptObject was below Object in the GWT
inheritance and expose .__set() for all java objects. I don't know if that
is is possible but I find the thought intriguing. It would be break javac
compilation though...

Vassilis




On Sat, Aug 12, 2017 at 11:59 AM, Andrea Martino <ciac...@gmail.com> wrote:

> Hi all,
> I have recently started testing JsInterop for our GWT 2.8.1 application
> and I have encountered a situation I could not solve without using the old
> style JSNI approach.
>
> Consider the following minimal JS library I would like to use in Java/GWT:
>
> (function (window, document, undefined) {
>
> function WatchDog(name) {
> this._name = name;
> };
>
> WatchDog.prototype.register = function(callback) {
> this._callback = callback;
> };
>
> WatchDog.prototype.broadcast = function(msg) {
> if (this._callback) {
> this._callback({
> 'name' : this._name,
> 'timestamp' : new Date().getTime(),
> 'msg' : msg
> });
> }
> };
>
> window.Dummy = {
> watchDog : function(name) {
> return new WatchDog(name);
> }
> };
>
> }(window, document));
>
> Please note that the broadcast function passes a "basic" JS Object {}
> (i.e. without a specific prototype) to the callback function.
>
> Here below my JsInterop mappings:
>
> package xxx;
>
> import jsinterop.annotations.JsPackage;
> import jsinterop.annotations.JsType;
>
> @JsType(isNative = true, namespace = JsPackage.GLOBAL)
> public class Dummy {
> private Dummy() {}
> public static native WatchDog watchDog(String name);
> }
>
> package xxx;
>
> import jsinterop.annotations.JsMethod;
> import jsinterop.annotations.JsType;
>
> @JsType(isNative = true)
> public class WatchDog {
> private WatchDog() {}
> @JsMethod
> public native void register(Callback callback);
> @JsMethod
> public native void broadcast(String msg);
> }
>
> package xxx;
>
> import jsinterop.annotations.JsFunction;
>
> @JsFunction
> public interface Callback {
> void call(Object event);
> }
>
>
> In my Java code, when the callback function is invoked, the event
> parameter is an instance of com.google.gwt.core.client.JavaScriptObject.
>
> Without using JSNI I am not able to access/read the object's properties.
> Does JsInterop addresses this scenario without falling-back to old style
> JSNI?
>
> Thanks a lot in andvance
> Andrea
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] NodeList and JsArrayList.asArray

2017-08-02 Thread Vassilis Virvilis
Can you expand a little bit on this? Are there any consequences we need to
look for?

Is there a commit to look at?

On Mon, Jul 31, 2017 at 8:44 PM, 'Goktug Gokdogan' via GWT Contributors <
google-web-toolkit-contributors@googlegroups.com> wrote:

> It is fixed internally. asArray API replaced with asList API
>
> On Mon, Jul 24, 2017 at 3:11 PM, Goktug Gokdogan <gok...@google.com>
> wrote:
>
>> For following code:
>>
>> class A {
>>   T[] asArray {}..
>> }
>>
>> A st;
>> String[] arr = st.asArray();
>>
>> I wasn't expecting an erasure cast at the call site for this but seems
>> like I was wrong and erasure cast seems right here otherwise you cannot
>> guarantee that arr[0] which won't have a cast to return String.
>>
>> We should be able to repro this in jsinterop.base; will take a look.
>>
>>
>> On Sun, Jul 23, 2017 at 8:18 PM, Colin Alworth <niloc...@gmail.com>
>> wrote:
>>
>>> Using GWT 2.8.1, I'm trying to iterate through items found via a query
>>> selector:
>>>
>>> Arrays.asList(document.querySelectorAll("button.with-some-class").
>>> asArray()).forEach(
>>> item -> doSomething(item)
>>> );
>>>
>>> Unfortunately, this seems to always fail - querySelectorAll returns a
>>> NodeList, and while asArray() seems to specify Js.uncheckedCast,
>>> the resulting generated code is
>>>
>>> $forEach_1(new Arrays$ArrayList(*castToJsArray*(($clinit_DomGlobal() ,
>>> document_0).querySelectorAll('button.with-some-class'))), new
>>> SampleClass$lambda$0$Type);
>>>
>>> Predictable, the bolded castToJsArray causes an exception at runtime,
>>> since a NodeList isn't actually a JS Array at all.
>>>
>>> Is there a correct way to do this, or perhaps a nicer way to iterate
>>> through NodeLists?
>>>
>>> I assume this should be a bug filed against jsinterop-base, but am not
>>> seeing a repo for it, or is this a bug in GWT itself?
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com
>>> .
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/google-web-toolkit-contributors/4764126b-ed92-409a-bb4b-
>>> d1d1fead2e3c%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/4764126b-ed92-409a-bb4b-d1d1fead2e3c%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-web-toolkit-contributors/CAN%3DyUA3o45d%
> 3DO9nDyVX0z_gb%2BTzkgAh_EVwOdfmO2qhxNQ5p3Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA3o45d%3DO9nDyVX0z_gb%2BTzkgAh_EVwOdfmO2qhxNQ5p3Q%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEycK-P-vSSa1TcwzcdaLWrCiFg0z3QTqKbH9JPtVYPMjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SerializationException when application is modified

2017-07-19 Thread Vassilis Virvilis
Hi,

Here is what we do.

1. We don't use gwt-rpc. We use resty-gwt instead.
2. resty-gwt has the option to register a global request callback handler
in order to intercept all http requests. See resty-gwt
Defaults.setDispatcher() for details
3. On every new build of the gwt script I autogenerate (via ant build file)
a timestamp file named version.txt
4. On every service call/request the server side reads the version.txt that
resides at gwt war directory and adds a http header e.g myapp-version:
20170719-123841
5. The gwt client side global request callback handler reads the header and
if it differs from the previous one it forces a hard reload.

Actually in my case step 5 is more like:
5a) Inform the user that a newer version is available and the application
will reload (only on ok button) but his current work/state is saved in
localstorage
5b) on ok click reload(true)
5c) on reload check localstorage and if state exists load it from there

I don't know if in gwt-rpc it is possible to intercept all request calls as
in rest-gwt. If it is possible a similar strategy could also be employed in
that case.

With this scheme and with additional headers you can create custom
notifiers for other events i.e. configuration changed, database changed etc.

Hope that helps.


On Wed, Jul 19, 2017 at 12:02 AM, Jens <jens.nehlme...@gmail.com> wrote:

>
> We think that this is due to browsers caching the previous (old) code
>> which is no longer aligned with the server code.  We have reviewed all HTTP
>> headers related to caching and all of the are, we think, correctly
>> configured.
>>
>
> The issue is that your users have downloaded your GWT app and are actively
> using it while you make an update of that app. Because the app is already
> downloaded it will make requests with different, outdated serialization
> information. No caching header can help here.
>
> You are correct that you need to detect the server upgrade and then notify
> the user that a new version of your app is available and finally reload the
> browser. At work we do the same and it works pretty well. Basically two
> things can go wrong:
>
> 1.) Downloading a split points (GWT.runAsync)
> 2.) GWT-RPC requests
>
> So in the first case if GWT.runAsync() fails we simply assume the app has
> been updated and act accordingly. IMHO downloading a split point should
> never ever fail unless you do not have internet access and get a
> StatusCodeException with status code 0. So I think the assumption is
> relatively safe to make.
>
> For the second case (and any other server requests outside of GWT-RPC,
> e.g. manually requesting a different servlet) we use a HTTP header
> containing the app version the user has downloaded. That version will be
> send with every server request, in case of GWT-RPC we use a custom
> RpcRequestBuilder to add the header. To set a custom RpcRequestBuilder for
> your GWT-RPC service you need to hard cast the async service to
> ServiceDefTarget and then call a setter. The app version itself is embedded
> into the host page, e.g. index.html, which we generate dynamically on the
> server. We deploy index.template and app.nocache.js and inline
> app.nocache.js on the server into the template. The template also has some
> replacement strings for other information, like the app version. The app
> version itself can be as easy as the hash of the context root on your
> server, e.g. hash(/app_20170718). A servlet filter can then check the
> version and send back a HTTP status code to indicate that the app has been
> updated.
>
> Sadly you can not really use a custom RpcRequestBuilder to catch GWT-RPC
> exceptions because the response hasn't been deserialized yet. So if you can
> not use the version approach described above, maybe you can search for "EX"
> and "com.google.gwt.user.client.rpc.SerializationException" in the
> response text but that seems like a poor workaround. Ideally you would do
> some clever refactoring and introduce a base class for all your
> AsyncCallback, so you have a central place to handle this exception.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Fwd: jsinterop: @JsFunction .length always 0

2017-06-28 Thread Vassilis Virvilis
Yep I have done it like this exactly but this creates a JSNI dependency. My
reports were assuming that JSNI is a soon to be deprecated thing or at
least further investment on it is should be avoided.

However, thanks for the development insight.


On Wed, Jun 28, 2017 at 7:56 PM, 'Roberto Lublinerman' via GWT Contributors
<google-web-toolkit-contributors@googlegroups.com> wrote:

> Not likely to be implemented in the foreseeable future; your best solution
> is to create two JavaScript methods (or JSNI)
>
> function asAccessor(f) {
>   return function (a) { return f(a); };
> }
>
> function asComparator(f) {
>   return function (a, b) { return f(a, b); };
> }
>
> It would be possible to implement @JsFunction lambdas without a backing
> class and that would result in the function having the same number of
> parameters as the lambda. But as I said this is unlikely to be implemented
> in the foreseeable future as it would require a new Java AST node and thus
> changes throughout the code base.
>
> On Tue, Jun 27, 2017 at 2:28 PM, Vassilis Virvilis <vasv...@gmail.com>
> wrote:
>
>> Do you want me to report it as issue? If so where?
>>
>> Is it possible for @JsFunction magic to implement it some day? or it is
>> impossible to be implemented with the current design?
>>
>> Thanks again for all the answers so far.
>>
>> Vassilis
>>
>> On Tue, Jun 27, 2017 at 7:40 PM, 'Roberto Lublinerman' via GWT
>> Contributors <google-web-toolkit-contributors@googlegroups.com> wrote:
>>
>>> You can call it a missing feature. Clearly not a bug, not everything
>>> that can be done in JS is available from Java with interop. For these
>>> situations you probably want to have some JS stubs.
>>>
>>> On Tue, Jun 27, 2017 at 1:09 AM, Vassilis Virvilis <vasv...@gmail.com>
>>> wrote:
>>>
>>>> Ok guys this is the last one - I promise.
>>>>
>>>> Originally posted in gwt-users.
>>>>
>>>> Does this count as a bug or at least as a missing feature?
>>>>
>>>> Thanks
>>>>
>>>> -- Forwarded message --
>>>> From: Vassilis Virvilis <vasv...@gmail.com>
>>>> Date: Mon, Mar 6, 2017 at 4:08 PM
>>>> Subject: jsinterop: @JsFunction .length always 0
>>>> To: google-web-tool...@googlegroups.com
>>>>
>>>>
>>>> Hi,
>>>>
>>>> in D3 the bisect function takes a function that can be a comparator or
>>>> an accessor.
>>>>
>>>> D3 internall figures it out by counting provided function arguments
>>>> length via f.length https://developer.mozilla.org/
>>>> en/docs/Web/JavaScript/Reference/Global_Objects/Function/length
>>>>
>>>> Trying to pass a java @JsFunction fails because @JsFunction objects are
>>>> lambda with zero arguments that wrap samMethod.apply() call
>>>>
>>>> Any ideas? Should I file this as a bug?
>>>>
>>>>
>>>> --
>>>> Vassilis Virvilis
>>>>
>>>>
>>>>
>>>> --
>>>> Vassilis Virvilis
>>>>
>>>> --
>>>> 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-contributor
>>>> s+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>>> gid/google-web-toolkit-contributors/CAKbOjEx1_jOohikJ7nBAfps
>>>> E%3DJHtnD6M31PibMzjvcjLn7G1fw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEx1_jOohikJ7nBAfpsE%3DJHtnD6M31PibMzjvcjLn7G1fw%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com
>>> .
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/google-web-toolkit-contributors/CAC7T7g%3D_JcBzZaNnjBosA
>>> mcQ_Bm8Bn9r-_7LfFi%3DDu5r%2BO1h1A%40mail.gmail.com
>>> <https://groups.goog

Re: [gwt-contrib] Fwd: jsinterop: @JsFunction .length always 0

2017-06-28 Thread Vassilis Virvilis
@thomas

all valid points and interesting links. Thanks for the insight.

To my defense however I want to state again that I have not devised this
API.

It's the official API of D3

   - v3
   https://github.com/d3/d3-3.x-api-reference/blob/master/Arrays.md#d3_bisector
   - v4 https://github.com/d3/d3-array/blob/master/README.md#bisector


so it is not possible to change the API. If I take a step back (not
realistic) and say that I won't use D3 at all because it has such a bad API
(not true. Generally I enjoy the D3 very much.) I am sure I will hit
similar snags in other js libraries.

So... better the devil you know

 Vassilis


On Wed, Jun 28, 2017 at 4:12 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

>
>
> On Wednesday, June 28, 2017 at 2:21:16 PM UTC+2, Vassilis Virvilis wrote:
>>
>> I am not following the implementation details and I cannot judge on the
>> compromises front.
>>
>> But from a user standpoint this should be implemented because a
>> @JsFunction should generate a js function()  and a js function() happens to
>> have a length member by specification (see https://developer.mozilla.org/
>> en/docs/Web/JavaScript/Reference/Global_Objects/Function/length )
>>
>> Otherwise @JsFunction is not a js function() but something callable
>> instead.
>>
>
> GWT generates a function, but a function with an empty formal parameter
> list (and as a result a length of 0), because it simply uses 'arguments':
> https://github.com/gwtproject/gwt/blob/2.8.1/
> dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/
> gwt/lang/Runtime.java#L158-L169
>
>
>> Given the dynamic number of javascript I expect that these kind of checks
>> to be common enough to warrant the effort.
>>
>
> One could argue the reverse: due to the dynamic nature of JS, 'length' of
> a function isn't reliable, and you'd be better off using distinct APIs
> rather than driving behavior by inferring things from inputs, or more
> precisely be explicit with your intent.
> It easily fails you, as soon as you wrap a function to bind, curry,
> memoize it, whatever, using a generic factory (one that uses 'arguments'
> along with Function.prototype.apply or Function.prototype.call; one that
> specifically doesn't use Function.prototype.bind).
> Have a look at the Function.prototype.bind polyfill from the MDN for
> example: https://developer.mozilla.org/en-US/docs/Web/
> JavaScript/Reference/Global_Objects/Function/bind#Polyfill
> Any code targeting IE8 or older (that doesn't necessarily mean new code)
> would need this polyfill, and the returned function (fBound) has a length
> of 0, irrespective of the length of the function to bind.
> There's a polyfill for Function.prototype.bind that returns a function
> with the correct 'length', but it uses new Function() with a string body:
> https://github.com/Raynos/function-bind/blob/
> 83e639ff74e6cd6921285bccec22c1bcf72311bd/implementation.js#L38 so it'd
> break most CSP. While IE8 doesn't support CSP (so it's OK for this
> particular polyfill), that however means you cannot use such a trick for
> other things you'd like to do with a function (such as memoizing it: for
> example, https://github.com/caiogondim/fast-memoize.js returns a function
> with length 0 too).
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-web-toolkit-contributors/e12e8c02-c6f0-
> 4818-aaee-fb564935e8ec%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/e12e8c02-c6f0-4818-aaee-fb564935e8ec%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEwwD-hDNBt8QEE2h0k74yxpFWdCsX5J5Lh3%3DsHeGptDcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Fwd: jsinterop: @JsFunction .length always 0

2017-06-28 Thread Vassilis Virvilis
I am not following the implementation details and I cannot judge on the
compromises front.

But from a user standpoint this should be implemented because a @JsFunction
should generate a js function()  and a js function() happens to have a
length member by specification (see
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Function/length
)

Otherwise @JsFunction is not a js function() but something callable instead.

Given the dynamic number of javascript I expect that these kind of checks
to be common enough to warrant the effort.

Now if GWT generated script becomes 2x heavier and 4x slower you may forget
the feature. It still needs to be posted as an issue to host the discussion
though.

Vassilis



On Wed, Jun 28, 2017 at 10:51 AM, Thomas Broyer <t.bro...@gmail.com> wrote:

> I suppose makeLambdaFunction could be "inlined" (possibly into a static
> factory, one per class), with the 'lambda' then generated with the proper
> number of formal arguments to "initialize" its 'length' property? Would
> that hurt "optimizability" a lot?
> Or is that not worth it (too much of an edge case) and the static factory
> (of a wrapper function then) should rather be implemented with JSNI? (or
> the equivalent for j2cl)
>
>
> On Tuesday, June 27, 2017 at 6:41:03 PM UTC+2, Roberto Lublinerman wrote:
>>
>> You can call it a missing feature. Clearly not a bug, not everything that
>> can be done in JS is available from Java with interop. For these situations
>> you probably want to have some JS stubs.
>>
>> On Tue, Jun 27, 2017 at 1:09 AM, Vassilis Virvilis <vasv...@gmail.com>
>> wrote:
>>
>>> Ok guys this is the last one - I promise.
>>>
>>> Originally posted in gwt-users.
>>>
>>> Does this count as a bug or at least as a missing feature?
>>>
>>> Thanks
>>>
>>> -- Forwarded message --
>>> From: Vassilis Virvilis <vasv...@gmail.com>
>>> Date: Mon, Mar 6, 2017 at 4:08 PM
>>> Subject: jsinterop: @JsFunction .length always 0
>>> To: google-web-tool...@googlegroups.com
>>>
>>>
>>> Hi,
>>>
>>> in D3 the bisect function takes a function that can be a comparator or
>>> an accessor.
>>>
>>> D3 internall figures it out by counting provided function arguments
>>> length via f.length https://developer.mozilla.org/
>>> en/docs/Web/JavaScript/Reference/Global_Objects/Function/length
>>>
>>> Trying to pass a java @JsFunction fails because @JsFunction objects are
>>> lambda with zero arguments that wrap samMethod.apply() call
>>>
>>> Any ideas? Should I file this as a bug?
>>>
>>>
>>> --
>>> Vassilis Virvilis
>>>
>>>
>>>
>>> --
>>> Vassilis Virvilis
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com
>>> .
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/google-web-toolkit-contributors/CAKbOjEx1_jOohikJ7nBAfps
>>> E%3DJHtnD6M31PibMzjvcjLn7G1fw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEx1_jOohikJ7nBAfpsE%3DJHtnD6M31PibMzjvcjLn7G1fw%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-web-toolkit-contributors/a07991bc-7767-
> 46cb-80fd-655e1809f15b%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/a07991bc-7767-46cb-80fd-655e1809f15b%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEzdoAN2MadkgMQv%3DSk22nfJ8%2BHHKdDUwQGuRgf%3D4a%3DWUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Fwd: jsinterop: @JsFunction .length always 0

2017-06-27 Thread Vassilis Virvilis
Do you want me to report it as issue? If so where?

Is it possible for @JsFunction magic to implement it some day? or it is
impossible to be implemented with the current design?

Thanks again for all the answers so far.

Vassilis

On Tue, Jun 27, 2017 at 7:40 PM, 'Roberto Lublinerman' via GWT Contributors
<google-web-toolkit-contributors@googlegroups.com> wrote:

> You can call it a missing feature. Clearly not a bug, not everything that
> can be done in JS is available from Java with interop. For these situations
> you probably want to have some JS stubs.
>
> On Tue, Jun 27, 2017 at 1:09 AM, Vassilis Virvilis <vasv...@gmail.com>
> wrote:
>
>> Ok guys this is the last one - I promise.
>>
>> Originally posted in gwt-users.
>>
>> Does this count as a bug or at least as a missing feature?
>>
>> Thanks
>>
>> -- Forwarded message --
>> From: Vassilis Virvilis <vasv...@gmail.com>
>> Date: Mon, Mar 6, 2017 at 4:08 PM
>> Subject: jsinterop: @JsFunction .length always 0
>> To: google-web-tool...@googlegroups.com
>>
>>
>> Hi,
>>
>> in D3 the bisect function takes a function that can be a comparator or an
>> accessor.
>>
>> D3 internall figures it out by counting provided function arguments
>> length via f.length https://developer.mozilla.org/
>> en/docs/Web/JavaScript/Reference/Global_Objects/Function/length
>>
>> Trying to pass a java @JsFunction fails because @JsFunction objects are
>> lambda with zero arguments that wrap samMethod.apply() call
>>
>> Any ideas? Should I file this as a bug?
>>
>>
>> --
>> Vassilis Virvilis
>>
>>
>>
>> --
>> Vassilis Virvilis
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-web-toolkit-contributors/CAKbOjEx1_jOohikJ7nBAfps
>> E%3DJHtnD6M31PibMzjvcjLn7G1fw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEx1_jOohikJ7nBAfpsE%3DJHtnD6M31PibMzjvcjLn7G1fw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-web-toolkit-contributors/CAC7T7g%3D_
> JcBzZaNnjBosAmcQ_Bm8Bn9r-_7LfFi%3DDu5r%2BO1h1A%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAC7T7g%3D_JcBzZaNnjBosAmcQ_Bm8Bn9r-_7LfFi%3DDu5r%2BO1h1A%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEzKqjBGngrz%3DNES1bEe24ejg48mHzBw3L9fLP3JC11_%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Fwd: jsinterop: @JsFunction .length always 0

2017-06-27 Thread Vassilis Virvilis
Ok guys this is the last one - I promise.

Originally posted in gwt-users.

Does this count as a bug or at least as a missing feature?

Thanks

-- Forwarded message --
From: Vassilis Virvilis <vasv...@gmail.com>
Date: Mon, Mar 6, 2017 at 4:08 PM
Subject: jsinterop: @JsFunction .length always 0
To: google-web-tool...@googlegroups.com


Hi,

in D3 the bisect function takes a function that can be a comparator or an
accessor.

D3 internall figures it out by counting provided function arguments length
via f.length https://developer.mozilla.org/en/docs/Web/JavaScript/
Reference/Global_Objects/Function/length

Trying to pass a java @JsFunction fails because @JsFunction objects are
lambda with zero arguments that wrap samMethod.apply() call

Any ideas? Should I file this as a bug?


-- 
Vassilis Virvilis



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEx1_jOohikJ7nBAfpsE%3DJHtnD6M31PibMzjvcjLn7G1fw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-27 Thread Vassilis Virvilis
@Roberto,

Agreed in all points. double[] and Double[] is not the same thing in java
although it may be possible to be the same in js.

So until java supports autoboxing and unboxing in arrays I can see your
point.

Vassilis

On Tue, Jun 27, 2017 at 1:41 AM, 'Roberto Lublinerman' via GWT Contributors
<google-web-toolkit-contributors@googlegroups.com> wrote:

>
>> @Roberto
>> Please note that I am not mixing stuff (java and js objects in the same
>> array, or different kind of objects in the same array).
>>
>> D3 is doing the correct thing here. If you pass an array of something,
>> let's say T[] you can expect that you will be getting T and T[] out of D3
>> functions (can't really remember the specifics). What I am passing are pure
>> js objects modeled with jsinterop, and they still count as js, not java. So
>> I am expecting to get back what I feed in / declared at the start.
>>
>>
> D3 is a JS api, even if some function says it will return an array of T,
> it is a JavaScript array, so there is no (type) guarantee that the array is
> of T. So it is an array of things, all of them of type T.
>
> A java T[] has even stronger semantics, if you set an element it will
> check that it is the correct type. So the D3 array is like an Object[] that
> happens to be filled all with Ts.
>
>
>> So what do I want: Double[] to be castable to double[] in the GWT js
>> context (not in the java context). I don't know if this is possible but it
>> is definitely desirable. (The same for String[] and Boolean[]) and a pony
>> of course :-)
>>
>>
> Again here Double[] and double[] have very different semantics in Java.
>
> - you can cast Double[] to Object[] but not double[] to Object[]
> - you can store nulls in Double[] but not in double[].
>
> They are semantically different. I agree that in some circumstances it
> seems convenient to ignore those. But in general GWT follows Java semantics
> (with a few exceptions)
>
>
>> Thanks again.
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-web-toolkit-contributors/CAKbOjExku8sLUm3Ky7B6OF-
>> gx%3DvgvdP_v8nd-Pi0WNeqzyv06g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjExku8sLUm3Ky7B6OF-gx%3DvgvdP_v8nd-Pi0WNeqzyv06g%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-web-toolkit-contributors/CAC7T7gkupiRhKbO9CAmnKO9LUSh26
> veVjnQ0LqAGemeJvFWm9A%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAC7T7gkupiRhKbO9CAmnKO9LUSh26veVjnQ0LqAGemeJvFWm9A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEz55x2WgHoWt88fScf%2BkCrAfR7%2BUb5Zhx_Qu5x45VcUpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread Vassilis Virvilis
Hi and thanks for answering.

I also tend to believe this is not a bug - but - it is definitely in my
wish list.

@Colin jsinterop is certainly kind of fragile but if you bang your head
against it at the end you start understanding the errors. In most cases you
can fix the error by making the java code or the jsinterop declaration
__better__. This is a case that I had to uglify my bindings. So I don't
believe that is fails in new, unique and interesting ways. It is rather
consistent. It may be somewhat fragile and cryptic but it is consistent and
I don't believe that you will have a problem with element[] (assuming
element is a jsinterop native, and com.google.dom.dontremember.element),
double[] or boolean[]. But you will be in world of hurt if you try to
communicate Double[], Boolean[], String[].

@Roberto
Please note that I am not mixing stuff (java and js objects in the same
array, or different kind of objects in the same array).

D3 is doing the correct thing here. If you pass an array of something,
let's say T[] you can expect that you will be getting T and T[] out of D3
functions (can't really remember the specifics). What I am passing are pure
js objects modeled with jsinterop, and they still count as js, not java. So
I am expecting to get back what I feed in / declared at the start.

That part works.

I am putting Date[] --> I am getting back Date[] . Correct
I am putting double[] --> I am getting back double[] . Correct
I am putting Double[] --> I am getting back exception. Not so nice.

That basically means that I can't have a generic function that will work
with all kind of GenericTypes because double is not an object in java. That
means I have to special case the interface like this

  V get(T t); --> works great for JsObects as it should
  double getDouble(T t) --> ugly huh?

So what do I want: Double[] to be castable to double[] in the GWT js
context (not in the java context). I don't know if this is possible but it
is definitely desirable. (The same for String[] and Boolean[]) and a pony
of course :-)

Thanks again.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjExku8sLUm3Ky7B6OF-gx%3DvgvdP_v8nd-Pi0WNeqzyv06g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread Vassilis Virvilis
Originally posted in gwt-users.

The question here is the same with the previous one.

Is this considered a bug? Should I report it as an issue? and if so where?

 Thanks.


-- Forwarded message --
From: Vassilis Virvilis <vasv...@gmail.com>
Date: Fri, Feb 24, 2017 at 2:44 PM
Subject: jsinterop woes: Part 2: return Double[]
To: google-web-tool...@googlegroups.com


Hi,

I am not sure if it is a bug but it kills my beautiful jsinterop mappings.

Let's say that I have a native js function (d3.extent) that returns an
array of something. It may be dates it may be doubles..

This is mapped nicely with

public static native <T, V> V[] extent(T[] data,
> AccessorFunction<T, V> accessor);
>

Where AccessorFunction is

@JsFunction
> public static interface AccessorFunction<T, V> {
> public V get(T d);
> }
>

The above scheme works for Date and other objects but it fails with Double.
If I specify another variant of d3.extent that returns double[] it works

Here is the javascript exception

Uncaught Error: java.lang.ClassCastException
> at java_lang_ClassCastException_ClassCastException__V.java_
> lang_Throwable_createError__Ljava_lang_String_2Ljava_lang_Object_2 [as
> package_private$java_lang$createError__Ljava_lang_String_2Ljava_lang_Object_2]
> (dashboard-0.js:7245)
> at java_lang_ClassCastException_ClassCastException__V.java_
> lang_Throwable_initializeBackingError__V [as 
> private$java_lang_Throwable$initializeBackingError__V]
> (dashboard-0.js:7300)
> at 
> java_lang_ClassCastException_ClassCastException__V.java_lang_Throwable_Throwable__V
> (dashboard-0.js:7133)
> at 
> java_lang_ClassCastException_ClassCastException__V.java_lang_Exception_Exception__V
> (dashboard-0.js:7381)
> at java_lang_ClassCastException_ClassCastException__V.java_
> lang_RuntimeException_RuntimeException__V (dashboard-0.js:29760)
> at java_lang_ClassCastException_ClassCastException__V
> (dashboard-0.js:57310)
> at javaemul_internal_InternalPreconditions_checkCriticalType__ZV
> (dashboard-0.js:72171)
> at javaemul_internal_InternalPreconditions_checkType__ZV
> (dashboard-0.js:72378)
> at com_google_gwt_lang_Cast_castTo__Ljava_lang_Object_
> 2Lcom_google_gwt_core_client_JavaScriptObject_2Ljava_lang_Object_2
> (dashboard-0.js:647)
>

It goes here

> function com_google_gwt_lang_Cast_castTo__Ljava_lang_Object_
> 2Lcom_google_gwt_core_client_JavaScriptObject_2Ljava_lang_Object_2(src_0,
> dstId){
>   com_google_gwt_lang_Cast_$clinit__V();
>   javaemul_internal_InternalPreconditions_checkType__ZV(com_google_gwt_
> lang_Cast_jsEquals__Ljava_lang_Object_2Ljava_lang_Object_2Z(src_0, null)
> || com_google_gwt_lang_Cast_canCast__Ljava_lang_Object_
> 2Lcom_google_gwt_core_client_JavaScriptObject_2Z(src_0, dstId));
>   return src_0;
> }
>

Arguments:

   - src_0:
  - evaluated: js array of numbers as it should be
  - dstId:
  - evaluated: 2396

and then it goes to

function com_google_gwt_lang_Cast_canCast__Ljava_lang_Object_
> 2Lcom_google_gwt_core_client_JavaScriptObject_2Z(src_0, dstId){
>   com_google_gwt_lang_Cast_$clinit__V();
>   if (com_google_gwt_lang_Cast_instanceOfString__Ljava_lang_Object_2Z(src_0))
> {
> return !!com_google_gwt_lang_Cast_stringCastMap[dstId];
>   }
>else if (src_0.java_lang_Object_castableTypeMap) {
> return !!src_0.java_lang_Object_castableTypeMap[dstId];
>   }
>else if 
> (com_google_gwt_lang_Cast_instanceOfDouble__Ljava_lang_Object_2Z(src_0))
> {
> return !!com_google_gwt_lang_Cast_doubleCastMap[dstId];
>   }
>else if 
> (com_google_gwt_lang_Cast_instanceOfBoolean__Ljava_lang_Object_2Z(src_0))
> {
> return !!com_google_gwt_lang_Cast_booleanCastMap[dstId];
>   }
>   return false;
> }
>

where it fails.

Would it be possible to handle transparently also Double[] (and possibly
String[])? as double[]?

   Thank you for reading that far...

Vassilis







-- 
Vassilis Virvilis



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEzUf3LAK90Gnq%2B8B5Yzq7akyZPC%3DJ9ch1DFieqoOCJJVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Fwd: jsinterop woes: Part 1: instanceof function in generics casting

2017-06-25 Thread Vassilis Virvilis
 I was not remembering correctly and my last comment was off. I am not
using a create() method. So the editorial correction is

 s/and have a create() method instead of ordinal() that generates the
object//g



On Sun, Jun 25, 2017 at 6:23 PM, Vassilis Virvilis <vasv...@gmail.com>
wrote:

> Hm...
>
> For me this d3 ordinal thing like implementing the () operator in c++. Is
> it a function with members and methods or is it an object with the ability
> to be called as a function?
>
> Anyway if you and Roberto say it is not a bug then it's not a bug.
>
> When I revisit my D3 bindings I will explore your proposals - but AFAIK
> there is no easy solution that resembles the original javascript API.
> Currently I prefer to copy paste among the inheritance pyramid (there are 2
> or 3 subtypes) and have a create() method instead of ordinal() that
> generates the object.
>
> If there is no objection I will post another stumbling block I encountered
> in my jsinterop journey.
>
>
> On Sun, Jun 25, 2017 at 5:35 PM, Thomas Broyer <t.bro...@gmail.com> wrote:
>
>>
>>
>> On Sunday, June 25, 2017 at 1:24:40 PM UTC+2, Vassilis Virvilis wrote:
>>>
>>> Ηι,
>>>
>>> thanks for answering
>>>
>>> d3.ordinal does not exist as you said. However d3.scale.ordinal exists
>>> and that part works great.
>>>
>>
>> But it is not a type, so you cannot use 'instanceof' on it.
>>
>>
>>> in d3 ordinal is both a function ordinal() which returns an ordinal
>>> instance and an object with more methods such as range() which is the crux
>>> of my issue.
>>>
>>> The problem there is that
>>>
>>>- public native <I, O> O range(I[] values);   *// this doesn't
>>>work*
>>>- // public native  Ordinal range(I[] values); *// this works*
>>>
>>> I would like to use the first definition because it allows reusing some
>>> code between different scales. Otherwise I have to copy-paste the range()
>>> method multiple times instead of put it in a base class.
>>>
>>
>> In Java, generics are more or less syntactic sugar for using the erased
>> type and casting values. So when using the first one, GWT will, when used
>> with O==Ordinal, generate a cast from Object to Ordinal, which IIUC is
>> what's causing the error, because your JsType is not a type that can be
>> checked (a cast is translated in JS to a type-check using 'instanceof').
>>
>>
>>> The problem is on the exceptions generated by the attempting casting.
>>>
>>> As you said this may not be a bug but not for the reason you mentioned.
>>>
>>> So the question remains: Should I report it as an issue?
>>>
>>
>> I would say no. Your @JsType is wrong. You should either use an interface
>> with @JsType(isNative=true, name="?", namespace=JsPackage.GLOBAL), or if
>> you want to use fields use a class with @JsType(isNative=true,
>> name="Object", namespace=JsPackage.GLOBAL)
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-web-toolkit-contributors/6206fb29-d3c1-48de-ab04-
>> 0610cbb3c2bd%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/6206fb29-d3c1-48de-ab04-0610cbb3c2bd%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Vassilis Virvilis
>



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjEz_uocutZGGp%3DsvDbUSf1eW9gnziGsCtVOkvd1iGRT%2Bjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Fwd: jsinterop woes: Part 1: instanceof function in generics casting

2017-06-25 Thread Vassilis Virvilis
Hm...

For me this d3 ordinal thing like implementing the () operator in c++. Is
it a function with members and methods or is it an object with the ability
to be called as a function?

Anyway if you and Roberto say it is not a bug then it's not a bug.

When I revisit my D3 bindings I will explore your proposals - but AFAIK
there is no easy solution that resembles the original javascript API.
Currently I prefer to copy paste among the inheritance pyramid (there are 2
or 3 subtypes) and have a create() method instead of ordinal() that
generates the object.

If there is no objection I will post another stumbling block I encountered
in my jsinterop journey.


On Sun, Jun 25, 2017 at 5:35 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

>
>
> On Sunday, June 25, 2017 at 1:24:40 PM UTC+2, Vassilis Virvilis wrote:
>>
>> Ηι,
>>
>> thanks for answering
>>
>> d3.ordinal does not exist as you said. However d3.scale.ordinal exists
>> and that part works great.
>>
>
> But it is not a type, so you cannot use 'instanceof' on it.
>
>
>> in d3 ordinal is both a function ordinal() which returns an ordinal
>> instance and an object with more methods such as range() which is the crux
>> of my issue.
>>
>> The problem there is that
>>
>>- public native <I, O> O range(I[] values);   *// this doesn't
>>work*
>>- // public native  Ordinal range(I[] values); *// this works*
>>
>> I would like to use the first definition because it allows reusing some
>> code between different scales. Otherwise I have to copy-paste the range()
>> method multiple times instead of put it in a base class.
>>
>
> In Java, generics are more or less syntactic sugar for using the erased
> type and casting values. So when using the first one, GWT will, when used
> with O==Ordinal, generate a cast from Object to Ordinal, which IIUC is
> what's causing the error, because your JsType is not a type that can be
> checked (a cast is translated in JS to a type-check using 'instanceof').
>
>
>> The problem is on the exceptions generated by the attempting casting.
>>
>> As you said this may not be a bug but not for the reason you mentioned.
>>
>> So the question remains: Should I report it as an issue?
>>
>
> I would say no. Your @JsType is wrong. You should either use an interface
> with @JsType(isNative=true, name="?", namespace=JsPackage.GLOBAL), or if
> you want to use fields use a class with @JsType(isNative=true,
> name="Object", namespace=JsPackage.GLOBAL)
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-web-toolkit-contributors/6206fb29-d3c1-
> 48de-ab04-0610cbb3c2bd%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/6206fb29-d3c1-48de-ab04-0610cbb3c2bd%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjExtFzAEo2fL66Z3gDrfzNA%3DnF90moVCvGg2BUjjDVqJfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Fwd: jsinterop woes: Part 1: instanceof function in generics casting

2017-06-25 Thread Vassilis Virvilis
Ηι,

thanks for answering

d3.ordinal does not exist as you said. However d3.scale.ordinal exists and
that part works great.

in d3 ordinal is both a function ordinal() which returns an ordinal
instance and an object with more methods such as range() which is the crux
of my issue.

The problem there is that

   - public native <I, O> O range(I[] values);   *// this doesn't work*
   - // public native  Ordinal range(I[] values); *// this works*

I would like to use the first definition because it allows reusing some
code between different scales. Otherwise I have to copy-paste the range()
method multiple times instead of put it in a base class.

The problem is on the exceptions generated by the attempting casting.

As you said this may not be a bug but not for the reason you mentioned.

So the question remains: Should I report it as an issue?

   Vassilis


On Sun, Jun 25, 2017 at 3:24 AM, 'Roberto Lublinerman' via GWT Contributors
<google-web-toolkit-contributors@googlegroups.com> wrote:

> The declaration
>
>   package somepackage;
>
>   @JsNative(isTrue, name = "ordinal")
>   class Ordinal {
>   
>   }
>
> effectively says that there is a native type "somepackage.ordinal", which
> d3.ordinal is not.
>
> You can model it as a native interface for example where there is not such
> expectation.
>
> So as I understand your report this is not a bug but just an error in
> modellin
>
> On Sat, Jun 24, 2017 at 7:58 AM, Vassilis Virvilis <vasv...@gmail.com>
> wrote:
>
>> Originally posted in gwt-users.
>>
>> Two questions:
>>
>>1. Do you want me to report it as a bug somewhere? and where that
>>would be?
>>2. I have two more. Do you want me to post them here or this is not
>>the right place to post at all?
>>
>>
>>
>> -- Forwarded message --
>> From: Vassilis Virvilis <vasv...@gmail.com>
>> Date: Fri, Feb 24, 2017 at 2:26 PM
>> Subject: jsinterop woes: Part 1: instanceof function in generics casting
>> To: google-web-tool...@googlegroups.com
>>
>>
>> Hi,
>>
>> again I don't know if this is a bug but it hurts my style
>>
>> D3 defines d3.scale.ordinal as both a function and an object.
>> $wnd.d3.scale.ordinal returns function() in the browser's console though
>>
>>
>>@JsType(isNative = true, name = "ordinal")
>>>   public static class Ordinal {
>>>/** @todo TODO: this crashes. Why? */
>>>public native <I, O> O range(I[] values);   // this
>>> doesn't work
>>>//public native  Ordinal range(I[] values); // this works
>>>   }
>>>
>>
>> I want the generic type because then I can put it in a base class and
>> share some code.
>>
>> I am using it like this
>>
>>> D3.Scale.Ordinal color = D3.Scale.ordinal().range(new String[]
>>> {"#98abc5", "#8a89a6"});
>>>
>>
>> Here is the javascript exception:
>>
>> Error: java.lang.ClassCastException
>>> at java_lang_ClassCastException_ClassCastException__V.java_lang
>>> _Throwable_createError__Ljava_lang_String_2Ljava_lang_Object_2 [as
>>> package_private$java_lang$createError__Ljava_lang_String_2Ljava_lang_Object_2]
>>> (dashboard-0.js:7245)
>>> at java_lang_ClassCastException_ClassCastException__V.java_lang
>>> _Throwable_initializeBackingError__V [as 
>>> private$java_lang_Throwable$initializeBackingError__V]
>>> (dashboard-0.js:7300)
>>> at 
>>> java_lang_ClassCastException_ClassCastException__V.java_lang_Throwable_Throwable__V
>>> (dashboard-0.js:7133)
>>> at 
>>> java_lang_ClassCastException_ClassCastException__V.java_lang_Exception_Exception__V
>>> (dashboard-0.js:7381)
>>> at java_lang_ClassCastException_ClassCastException__V.java_lang
>>> _RuntimeException_RuntimeException__V (dashboard-0.js:29724)
>>> at java_lang_ClassCastException_ClassCastException__V
>>> (dashboard-0.js:57274)
>>> at javaemul_internal_InternalPreconditions_checkCriticalType__ZV
>>> (dashboard-0.js:72135)
>>> at javaemul_internal_InternalPreconditions_checkType__ZV
>>> (dashboard-0.js:72342)
>>> at com_google_gwt_lang_Cast_castToNative__Ljava_lang_Object_2Lc
>>> om_google_gwt_core_client_JavaScriptObject_2Ljava_lang_Object_2
>>> (dashboard-0.js:707)
>>>
>>
>> In
>>
>>> function com_google_gwt_lang_Cast_castToNative__Ljava_lang_Object_2Lc
>>> om_google_gwt_core_clie

  1   2   3   4   >