Re: visibilitychange event

2017-08-07 Thread Craig Mitchell
Thanks Thomas.  Final code for reference:

import com.google.gwt.user.client.Command;

private static native final String getVisibilityState() /*-{
  return $doc.visibilityState;
}-*/;

private static native final void listenForVisibilityChange(Command onChange) 
/*-{
  $doc.addEventListener("visibilitychange", function() {
$entry(onchan...@com.google.gwt.user.client.Command::execute(*)());
  }, false);
}-*/;


-- 
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: visibilitychange event

2017-08-07 Thread Craig Mitchell
Thanks Thomas.  Final code for reference:

import com.google.gwt.user.client.Command;

private static native final String getVisibilityState() /*-{
  return $doc.visibilityState;
}-*/;

private static native final void listenForVisibilityChange(Command onChange) 
/*-{
  $doc.addEventListener("visibilitychange", $entry(function() {
onchan...@com.google.gwt.user.client.Command::execute(*)();
  }), false);
}-*/;



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


GWT 2.8.1 Super Dev Mode Out Of Memory

2017-08-07 Thread Anand Deshmukh
Hello All,

We have recently upgraded large enterprise product from GWT 2.7 to 2.8.1 
but we are facing huge challenge with Super Dev Mode with getting frequent 
chrome crash with Out Of Memory errors which were not present in GWT 2.7 
compilation. Any typical memory and browser requirements?

Any pointers for this is highly appreciated.

Regards,
Anand

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


How to use GWT war file as welcome page in Apache Tomcat (TomEE)/8.5.6 (7.0.2).

2017-08-07 Thread Ananchai Srirochanakul
Hi,

As you can see from the images below, I have a GWT war file, that is 
working in Apache Tomcat (TomEE)/8.5.6 (7.0.2). 
However, I want to be able to use it as a welcome page in TomEE. For 
example, by typing the URL "www.mygwt.com", I should see this GWT war file 
as the very first page.
















*The content of web.xml is pasted below.*


http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 version="2.5"
 xmlns="http://java.sun.com/xml/ns/javaee;>

  
  
greetServlet

com.google.gwt.sample.stockwatcher.server.GreetingServiceImpl
  
  
  
greetServlet
/stockwatcher/greet
  
  
  
  
StockWatcher.html
  



*Some of content of /tomcat/conf/web.xml is pasted below.*

 
  
  
  
  
  
  
  
  
  
  
  
  


*stockwatcher*
index.html
index.htm
index.jsp




However, I cannot get it to work.
I hope someone can help.

Thank you so much.

-- 
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: Progressive Web App with Caching and Code Splitting

2017-08-07 Thread Juan Pablo Gardella
+1

On Mon, 7 Aug 2017 at 15:05 Slava Pankov  wrote:

> It would be really nice if you share details or even code of your
> implementation.
>
>
> On Monday, August 7, 2017 at 7:21:19 AM UTC-7, Gernot Pansy wrote:
>>
>> I got it myself working, with a extended Linker and the using of
>> XhrFragementLoader.
>>
>> On Friday, August 4, 2017 at 12:00:55 AM UTC+2, Gernot Pansy wrote:
>>>
>>> Hi,
>>>
>>> I wan't to convert my GWT (2.8.1) application to an progressive web app
>>> and add code splitting. I already build a custom Linker which creates a
>>> service worker file automatically and the caching is working except of the
>>> deferred fragemnts.
>>> My service worker is not called if the are loaded, it seems they are
>>> loaded outside of the scope.
>>>
>>> The same happens in this demo:
>>> http://www.g-widgets.com/2016/08/11/progressive-web-apps-recipes-for-gwt/
>>>
>>> If you look in the chrome console, all request are loaded trough the
>>> service worker but not the fragments (only once in install phase, because
>>> the are all files cached).
>>>
>>> Seems that this is the relevant code:
>>> https://github.com/gwtproject/gwt/blob/master/dev/core/src/com/google/gwt/core/ext/linker/impl/runAsync.js
>>> Here is still the old language property used on the script tag.
>>>
>>> Has anyone an idea how to fix that?
>>>
>>> cheers,
>>> gernot
>>>
>> --
> 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.
>

-- 
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: Progressive Web App with Caching and Code Splitting

2017-08-07 Thread Slava Pankov
It would be really nice if you share details or even code of your 
implementation.

On Monday, August 7, 2017 at 7:21:19 AM UTC-7, Gernot Pansy wrote:
>
> I got it myself working, with a extended Linker and the using of 
> XhrFragementLoader.
>
> On Friday, August 4, 2017 at 12:00:55 AM UTC+2, Gernot Pansy wrote:
>>
>> Hi,
>>
>> I wan't to convert my GWT (2.8.1) application to an progressive web app 
>> and add code splitting. I already build a custom Linker which creates a 
>> service worker file automatically and the caching is working except of the 
>> deferred fragemnts.
>> My service worker is not called if the are loaded, it seems they are 
>> loaded outside of the scope.
>>
>> The same happens in this demo: 
>> http://www.g-widgets.com/2016/08/11/progressive-web-apps-recipes-for-gwt/
>>
>> If you look in the chrome console, all request are loaded trough the 
>> service worker but not the fragments (only once in install phase, because 
>> the are all files cached).
>>
>> Seems that this is the relevant code: 
>> https://github.com/gwtproject/gwt/blob/master/dev/core/src/com/google/gwt/core/ext/linker/impl/runAsync.js
>> Here is still the old language property used on the script tag.
>>
>> Has anyone an idea how to fix that?
>>
>> cheers,
>> gernot
>>
>

-- 
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: Can I remove compile permutations for the default language

2017-08-07 Thread Kirill Prazdnikov

>
> I recommend you dropping permutations at all. Leaving the one.
> We did this few years ago and it`s good.


And how do you did that ?
>
 

The following in .gwt.xml



-- 
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: Progressive Web App with Caching and Code Splitting

2017-08-07 Thread Gernot Pansy
I got it myself working, with a extended Linker and the using of 
XhrFragementLoader.

On Friday, August 4, 2017 at 12:00:55 AM UTC+2, Gernot Pansy wrote:
>
> Hi,
>
> I wan't to convert my GWT (2.8.1) application to an progressive web app 
> and add code splitting. I already build a custom Linker which creates a 
> service worker file automatically and the caching is working except of the 
> deferred fragemnts.
> My service worker is not called if the are loaded, it seems they are 
> loaded outside of the scope.
>
> The same happens in this demo: 
> http://www.g-widgets.com/2016/08/11/progressive-web-apps-recipes-for-gwt/
>
> If you look in the chrome console, all request are loaded trough the 
> service worker but not the fragments (only once in install phase, because 
> the are all files cached).
>
> Seems that this is the relevant code: 
> https://github.com/gwtproject/gwt/blob/master/dev/core/src/com/google/gwt/core/ext/linker/impl/runAsync.js
> Here is still the old language property used on the script tag.
>
> Has anyone an idea how to fix that?
>
> cheers,
> gernot
>

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


visibilitychange event

2017-08-07 Thread Thomas Broyer
In addition to $doc vs document, you should wrap your callback with $entry()

-- 
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: visibilitychange event

2017-08-07 Thread Craig Mitchell
Thanks Jens.  Now switched it to use *$doc*.  And, yes, I just register 
once, and fire a custom event on the event bus.  Although, I just did it 
using my own event bus like this:

final EventBus EVENT_BUS = GWT.create(SimpleEventBus.class);

listenForVisibilityChange(new Command() {
  @Override
  public void execute() {
boolean visible = "visible".equals(getVisibilityState());
EVENT_BUS.fireEvent(new WindowVisibilityChangedEvent(visible));
  }
});


I suspect your way is better, although, I don't really understand what 
sinking events onto the DOM is doing.

elemental2 looks cool!  Will check it out.

My custom event if anyone wants to reuse it:

public class WindowVisibilityChangedEvent extends GwtEvent<
WindowVisibilityChangedEventHandler> {
  public static Type TYPE = new Type<
WindowVisibilityChangedEventHandler>();
  private boolean visibile;
 
  public WindowVisibilityChangedEvent(boolean visible) {
this.visibile = visible;
  }
 
  @Override
  public Type getAssociatedType() {
return TYPE;
  }

  @Override
  protected void dispatch(WindowVisibilityChangedEventHandler handler) {
handler.visibilityChanged(this);
  }
 
  public boolean isVisibile() {
return visibile;
  }
}


And the handler:
public interface WindowVisibilityChangedEventHandler extends EventHandler {
  void visibilityChanged(WindowVisibilityChangedEvent 
windowVisibilityChangedEvent);
}


Cheers.


On Monday, August 7, 2017 at 7:21:33 PM UTC+10, Jens wrote:
>
> Generally ok, given it is a global listener and you probably just install 
> it once on app initialization. However you should use *$doc* instead of 
> *document* to make sure you listen on the global document. Depending on 
> your browser support you might want a utility method to check if visibility 
> change events are actually supported by the browser.
>
> static native boolean isSupported() /*-{
>   return $doc.hidden !== 'undefined' && $doc.visibilityState !== 
> 'undefined';
> }-*/;
>
> In our app we created a PageVisibilityChangedEvent which extends GwtEvent 
> and then fire it on the app wide EventBus so everyone can easily listen 
> for it. To register the DOM handler we used 
>
> Element doc = Document.get().cast();
> DOM.sinkBitlessEvent(doc, VISIBILITY_CHANGE_EVENT);
> DOM.setEventListener(doc, new EventListener() {
>   @Override
>   public void onBrowserEvent(final Event event) {
> if (VISIBILITY_CHANGE_EVENT.equals(event.getType())) {
>  firePageVisibilityChangedEvent();
>}
>  }
> });
>
> You could of course also use elemental2 (requires newest GWT) or JsInterop 
> to reduce the amount of JSNI if that is important for you.
>
> -- 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.


Re: Can I remove compile permutations for the default language

2017-08-07 Thread Ignacio Baca Moreno-Torres
We just merge some of them... depending on the final app size. We think a
200k to 400k after compression is acceptable, so just try out various
permutation combinations. If your app is small enough you can just collapse
all with ''. Or merge some permutation like...

















On Mon, Aug 7, 2017 at 10:10 AM Frank  wrote:

> And how do you did that ?
>
> --
> 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.
>

-- 
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: visibilitychange event

2017-08-07 Thread Jens
Generally ok, given it is a global listener and you probably just install 
it once on app initialization. However you should use *$doc* instead of 
*document* to make sure you listen on the global document. Depending on 
your browser support you might want a utility method to check if visibility 
change events are actually supported by the browser.

static native boolean isSupported() /*-{
  return $doc.hidden !== 'undefined' && $doc.visibilityState !== 
'undefined';
}-*/;

In our app we created a PageVisibilityChangedEvent which extends GwtEvent 
and then fire it on the app wide EventBus so everyone can easily listen for 
it. To register the DOM handler we used 

Element doc = Document.get().cast();
DOM.sinkBitlessEvent(doc, VISIBILITY_CHANGE_EVENT);
DOM.setEventListener(doc, new EventListener() {
  @Override
  public void onBrowserEvent(final Event event) {
if (VISIBILITY_CHANGE_EVENT.equals(event.getType())) {
 firePageVisibilityChangedEvent();
   }
 }
});

You could of course also use elemental2 (requires newest GWT) or JsInterop 
to reduce the amount of JSNI if that is important for you.

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


Re: Can I remove compile permutations for the default language

2017-08-07 Thread Frank
And how do you did that ?

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