Re: Emulating CompletableFuture with Promise
Thanks, Andrei. That looks great! Is there a reason you've changed the signatures on some of the CompletableFuture methods? E.g. in the JRE, public CompletableFuture thenApply(Function fn) has become public CompletionStage thenApply(Function fn) On Monday, 5 September 2016 09:47:10 UTC+1, Andrei Korzhevskii wrote: > > I guess you need to super-source this class so the gwt compiler could use > it. > > You can take a look at my initial CompletableFuture implementation here: > > https://github.com/nordligulv/gwt/tree/completable-future > > https://github.com/nordligulv/gwt/commit/ea70c5358bac3c939cb0c1628a58ccc462cd7423 > > Feel free to use it but note that I haven't tested it properly yet. > > > > On Monday, September 5, 2016 at 3:28:27 AM UTC+3, Ian Preston wrote: >> >> I'm trying to emulate CompletableFuture by backing directly onto Promise, >> but when compiling it gives this error: >> "No source code is available for type >> java.util.concurrent.CompletableFuture" >> (it finds other JRE classes I've replaced fine) >> >> My source I'm including is below. Am I doing anything illegal? >> >> package java.util.concurrent; >> >> import com.google.gwt.user.client.*; >> import jsinterop.annotations.*; >> >> import java.util.function.*; >> >> @JsType(isNative=true, name = "Promise", namespace = JsPackage.GLOBAL) >> public class CompletableFuture implements CompletionStage { >> >> @JsMethod(name = "then") >> public native CompletableFuture thenApply(Function> extends U> fn); >> >> @JsMethod(name = "then") >> public native CompletableFuture thenAccept(Consumer >> action); >> >> @JsMethod(name = "then") >> public native CompletableFuture thenCompose(Function> T, ? extends CompletionStage> fn); >> >> @JsMethod(name = "reject") >> public native boolean completeExceptionally(Throwable ex); >> >> @JsMethod(name = "resolve") >> public native boolean complete(T value); >> >> @JsMethod(name = "resolve") >> public static native CompletableFuture completedFuture(U >> value); >> >> @JsOverlay >> public T get() throws InterruptedException, ExecutionException { >> Window.alert("Calling synchronous get() on CompletableFuture is >> not possible in Javascript!"); >> throw new IllegalStateException("Unimplemented!"); >> } >> } >> > -- 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-contrib] Missing JsInterop 1.0.0-SNAPSHOT
Looks like somehow the JsInterop jars are missing from the google-snapshots repo now, making it difficult to use the latest nightlies. http://build.gwtproject.org/job/gwt/615/console shows creating, signing, and deploying: Signing and Deploying ./poms/jsinterop/pom.xml to https://oss.sonatype.org/content/repositories/google-snapshots/ Uploading: https://oss.sonatype.org/content/repositories/google-snapshots//com/google/jsinterop/jsinterop/1.0.0-SNAPSHOT/jsinterop-1.0.0-20160905.055744-4.pom 1/1K 1K uploaded (jsinterop-1.0.0-20160905.055744-4.pom) Signing and Deploying /tmp/random-dir-2498515708877027498/gwt-2.8.0-SNAPSHOT/jsinterop-annotations.jar to https://oss.sonatype.org/content/repositories/google-snapshots/ Uploading: https://oss.sonatype.org/content/repositories/google-snapshots//com/google/jsinterop/jsinterop-annotations/1.0.0-SNAPSHOT/jsinterop-annotations-1.0.0-20160905.055746-4.jar 3/3K 3K uploaded (jsinterop-annotations-1.0.0-20160905.055746-4.jar) Uploading: https://oss.sonatype.org/content/repositories/google-snapshots//com/google/jsinterop/jsinterop-annotations/1.0.0-SNAPSHOT/jsinterop-annotations-1.0.0-20160905.055746-4-sources.jar 4/8K 8/8K 8/8K 8K uploaded (jsinterop-annotations-1.0.0-20160905.055746-4-sources.jar) Uploading: https://oss.sonatype.org/content/repositories/google-snapshots//com/google/jsinterop/jsinterop-annotations/1.0.0-SNAPSHOT/jsinterop-annotations-1.0.0-20160905.055746-4-javadoc.jar 607/607b 607b uploaded (jsinterop-annotations-1.0.0-20160905.055746-4-javadoc.jar) But the jars can't be found in maven https://oss.sonatype.org/content/repositories/google-snapshots/com/google/jsinterop/jsinterop/, and the latest bom depends on it https://oss.sonatype.org/content/repositories/google-snapshots/com/google/gwt/gwt/2.8.0-SNAPSHOT/gwt-2.8.0-20160905.055656-339.pom com.google.jsinterop jsinterop 1.0.0-SNAPSHOT pom import Oddly enough, there is a 1.0.0.j7-SNAPSHOT, apparently generated and deployed from http://build.gwtproject.org/job/gwt-java7/, but unless you happen to use GWT 2.8.0.j7-SNAPSHOT, this isn't terribly useful. Any ideas how this might have disappeared (as well as all old versions), despite apparently being deployed fresh about 12 hrs ago? -- 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/a2e03a76-0b7d-444e-84e0-1ab7542f1fa0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[gwt-contrib] Re: ScriptInjector seems to be broken (2.8-SNAPSHOT)
Hm wondering how it ever worked for you as JsInterop usually qualifies JS code with $wnd but your D3.js has been injected into the GWT iframe. So AFAICT with JsInterop you would had to use TOP_WINDOW anyways. You can make it work within the GWT iframe but then you can't use JsPackage.GLOBAL but use a namespace that points to the iframe content window. Also see: https://groups.google.com/d/msg/google-web-toolkit/GcsWUuzexvE/ApUg3sLZCQAJ So it looks like this behavior has changed? But yes you would need to use "window" now to references the iframe's content window if you inject the code into the iframe. -- 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/e8cbcef6-1bd8-43e3-b63b-89a1d659e12f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[gwt-contrib] Re: ScriptInjector seems to be broken (2.8-SNAPSHOT)
It looks like this might be a side-effect of https://github.com/gwtproject/gwt/commit/c511029eaae4ec66ff874d7e69efd9516ccc78db I am using JsInterop to interact with the D3 library, Using namespace=JsPackage.GLOBAL. I guess I will have to use "window" instead ? On Monday, September 5, 2016 at 1:40:38 PM UTC+2, stuckagain wrote: > It looks like the ScriptInjector is no longer working properly in the > snapshot. > > I had code like this: > > ScriptInjector.*fromString*(pBundle.d3JS().getText()).inject(); > > To load D3 using a TextResource. > > > Since today (just came back after 2 weeks of holidays) the D3 object is no > longer available in $wnd. > > > I changed the code to this: > > ScriptInjector.*fromString*(pBundle > .d3JS().getText()).setWindow(ScriptInjector.*TOP_WINDOW*).inject(); > > > and then it works. > > > -- 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/50ebbc42-884b-4c3d-bad9-494d1acc6f3e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[gwt-contrib] ScriptInjector seems to be broken (2.8-SNAPSHOT)
It looks like the ScriptInjector is no longer working properly in the snapshot. I had code like this: ScriptInjector.*fromString*(pBundle.d3JS().getText()).inject(); To load D3 using a TextResource. Since today (just came back after 2 weeks of holidays) the D3 object is no longer available in $wnd. I changed the code to this: ScriptInjector.*fromString*(pBundle .d3JS().getText()).setWindow(ScriptInjector.*TOP_WINDOW*).inject(); and then it works. -- 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/5a1fe785-79ea-4cb3-9fc6-c4f1c4258c2d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: GWT2.8RC : onResize() calls changed
On Monday, September 5, 2016 at 12:27:36 PM UTC+2, Thomas Lacroix wrote: > > > Hello, > I have a class that implements ResizeComposite and overrides onResize(). > A change I see migrating from 2.7 to 2.8RC2 is that the onResize() method > is called much more frequently (i.e. when the widget is shown from a > tabPanel) whereas this method used to be called only (mostly?) when I > resized the window manually with 2.7. > I am not sure if this is a bug (hidden state may be considered to have a > null size ?) but it is a change of behavior to take into account. > This is the side-effect of a bugfix: https://github.com/gwtproject/gwt/issues/7185 (see also linked issues, specifically about the TabLayoutPanel) -- 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: DevMode woe
Thanks. SuperDevMode working debugging with SDBG upgraded to 2.8b2 Selenium testing works better this way! On Mon, Sep 5, 2016 at 1:59 AM Thomas Broyerwrote: > > > On Sunday, September 4, 2016 at 5:27:36 PM UTC+2, Shawn wrote: >> >> >> Is there a way to get it to execute code modification in the debugger? I >> found my source and adding a logging statement but can’t save the file so >> it doesn’t execute. Is there a good book on this … is any chrome debugging >> book ok? >> > > You can either use Chrome workspaces ( > https://developers.google.com/web/tools/setup/setup-workflow) or > remote-debug from your IDE and have it handle the Source Maps (SDBG in > Eclipse for instance: https://sdbg.github.io) > > -- > 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.
GWT2.8RC : onResize() calls changed
Hello, I have a class that implements ResizeComposite and overrides onResize(). A change I see migrating from 2.7 to 2.8RC2 is that the onResize() method is called much more frequently (i.e. when the widget is shown from a tabPanel) whereas this method used to be called only (mostly?) when I resized the window manually with 2.7. I am not sure if this is a bug (hidden state may be considered to have a null size ?) but it is a change of behavior to take into account. Thomas PS : Thx for 2.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.
Re: Emulating CompletableFuture with Promise
I guess you need to super-source this class so the gwt compiler could use it. You can take a look at my initial CompletableFuture implementation here: https://github.com/nordligulv/gwt/tree/completable-future https://github.com/nordligulv/gwt/commit/ea70c5358bac3c939cb0c1628a58ccc462cd7423 Feel free to use it but note that I haven't tested it properly yet. On Monday, September 5, 2016 at 3:28:27 AM UTC+3, Ian Preston wrote: > > I'm trying to emulate CompletableFuture by backing directly onto Promise, > but when compiling it gives this error: > "No source code is available for type > java.util.concurrent.CompletableFuture" > (it finds other JRE classes I've replaced fine) > > My source I'm including is below. Am I doing anything illegal? > > package java.util.concurrent; > > import com.google.gwt.user.client.*; > import jsinterop.annotations.*; > > import java.util.function.*; > > @JsType(isNative=true, name = "Promise", namespace = JsPackage.GLOBAL) > public class CompletableFuture implements CompletionStage { > > @JsMethod(name = "then") > public native CompletableFuture thenApply(Function extends U> fn); > > @JsMethod(name = "then") > public native CompletableFuture thenAccept(Consumer > action); > > @JsMethod(name = "then") > public native CompletableFuture thenCompose(Function ? extends CompletionStage> fn); > > @JsMethod(name = "reject") > public native boolean completeExceptionally(Throwable ex); > > @JsMethod(name = "resolve") > public native boolean complete(T value); > > @JsMethod(name = "resolve") > public static native CompletableFuture completedFuture(U value); > > @JsOverlay > public T get() throws InterruptedException, ExecutionException { > Window.alert("Calling synchronous get() on CompletableFuture is > not possible in Javascript!"); > throw new IllegalStateException("Unimplemented!"); > } > } > -- 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.