JaroslavTulach: /* Real HotSpot VM */ - 2021-10-01 05:37:42

Real HotSpot VM

←Older revision Revision as of 05:37, 1 October 2021
Line 108: Line 108:
=== Real [[HotSpot]] [[VM]] ===
=== Real [[HotSpot]] [[VM]] ===
-
When we have our libraries converted, we can use them in a [[Knockout4Java]] [[Maven]] archetype project and use it inside of [[JavaFX]] WebView. This gives us all the benefits of [[HotSpot]] and real [[Java]] (including features of modern [[JDK]]s).
+
When we have our libraries converted, we can use them in a [[Knockout4Java]] [[Maven]] archetype project and execute them in regular [[JVM]] while rendering the [[HTML]] content via [[JavaFX]] '''WebView'''. This gives us all the benefits of [[HotSpot]] and real [[Java]] (including features of modern [[JDK]]s). We can use regular [[JVM]] [[debugger]] and verify our [[Java]] application behavior the way we are used to.
-
 
+
-
We can use [[debugger]] and verify the behavior of the [[Java]] application logic the way we are used to.
+
=== [[Bck2Brwsr]] & other transpilers ===
=== [[Bck2Brwsr]] & other transpilers ===

JaroslavTulach: /* Real HotSpot VM */ - 2021-10-01 05:35:46

Real HotSpot VM

←Older revision Revision as of 05:35, 1 October 2021
Line 108: Line 108:
=== Real [[HotSpot]] [[VM]] ===
=== Real [[HotSpot]] [[VM]] ===
-
When we have our libraries converted, we can use them in a ''knockout4j'' [[Maven]] archetype project and use it inside of [[JavaFX]] WebView. This gives us all the benefits of [[HotSpot]] and real [[Java]] (including features of modern [[JDK]]s).
+
When we have our libraries converted, we can use them in a [[Knockout4Java]] [[Maven]] archetype project and use it inside of [[JavaFX]] WebView. This gives us all the benefits of [[HotSpot]] and real [[Java]] (including features of modern [[JDK]]s).
We can use [[debugger]] and verify the behavior of the [[Java]] application logic the way we are used to.
We can use [[debugger]] and verify the behavior of the [[Java]] application logic the way we are used to.

JaroslavTulach: /* Bck2Brwsr & other transpilers */ - 2021-10-01 05:15:53

Bck2Brwsr & other transpilers

←Older revision Revision as of 05:15, 1 October 2021
Line 116: Line 116:
Originally we started with a [[GWT]] application. Now we have a real [[Java]] application, which can run on desktop and render its [[HTML]] UI via [[JavaFX]]. [[Good]], however our original application used to run in a browser. Can we do the same?
Originally we started with a [[GWT]] application. Now we have a real [[Java]] application, which can run on desktop and render its [[HTML]] UI via [[JavaFX]]. [[Good]], however our original application used to run in a browser. Can we do the same?
-
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild. Btw. [[TeaVM]] also supports the {{HTML4J|net/java/html/js|JavaScriptBody}} annotation and other transpilers are encouraged to joint this ecosystem and do the same.
+
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild. Btw. [[TeaVM]] also supports the {{HTML4J|net/java/html/js|JavaScriptBody}} annotation and other transpilers are encouraged to join this ecosystem and do the same.
Say farewell to [[GWT]]. Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications! Long live [[Java]] in browsers!
Say farewell to [[GWT]]. Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications! Long live [[Java]] in browsers!

JaroslavTulach: /* Bck2Brwsr */ - 2021-10-01 05:15:37

Bck2Brwsr

←Older revision Revision as of 05:15, 1 October 2021
Line 112: Line 112:
We can use [[debugger]] and verify the behavior of the [[Java]] application logic the way we are used to.
We can use [[debugger]] and verify the behavior of the [[Java]] application logic the way we are used to.
-
=== [[Bck2Brwsr]] ===
+
=== [[Bck2Brwsr]] & other transpilers ===
Originally we started with a [[GWT]] application. Now we have a real [[Java]] application, which can run on desktop and render its [[HTML]] UI via [[JavaFX]]. [[Good]], however our original application used to run in a browser. Can we do the same?
Originally we started with a [[GWT]] application. Now we have a real [[Java]] application, which can run on desktop and render its [[HTML]] UI via [[JavaFX]]. [[Good]], however our original application used to run in a browser. Can we do the same?
-
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild.
+
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild. Btw. [[TeaVM]] also supports the {{HTML4J|net/java/html/js|JavaScriptBody}} annotation and other transpilers are encouraged to joint this ecosystem and do the same.
Say farewell to [[GWT]]. Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications! Long live [[Java]] in browsers!
Say farewell to [[GWT]]. Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications! Long live [[Java]] in browsers!

JaroslavTulach: /* Convert to Annotations */ - 2021-10-01 05:11:46

Convert to Annotations

←Older revision Revision as of 05:11, 1 October 2021
Line 51: Line 51:
=== Convert to Annotations ===
=== Convert to Annotations ===
-
The first step is to convert comments into something that [[JVM]] can consume. Since [[JDK]]5 the proper way of attaching additional information to methods is to use [[annotations]]. Let's us rewrite the code to use ''@JavaScriptBody'' as provided by HTML/Java interop API (see its [https://bits.netbeans.org/html+java/1.7.1/ javadoc]). The goal is to have source like this:
+
The first step is to convert comments into something that [[JVM]] can consume. Since [[JDK]]5 the proper way of attaching additional information to methods is to use [[annotations]]. Let's us rewrite the code to use ''@''{{HTML4J|net/java/html/js|JavaScriptBody}} as provided by [[Html4Java|HTML/Java interop API]] (see the whole [http://bits.netbeans.org/html+java/1.7.1/net/java/html/js/package-summary.html interop documentation]). The goal is to have source like this:
 +
 
<source lang="java">
<source lang="java">

JaroslavTulach: /* Convert to Annotations */ - 2021-10-01 04:12:27

Convert to Annotations

←Older revision Revision as of 04:12, 1 October 2021
Line 51: Line 51:
=== Convert to Annotations ===
=== Convert to Annotations ===
-
The first step is to convert comments into something that [[JVM]] can consume. Since [[JDK]]5 the proper way of attaching additional information to methods is to use [[annotations]]. Let's us rewrite the code to use ''@JavaScriptBody'' as provided by [[netbeans:Html4Java|HTML4J]] library (see its [http://deadlock.netbeans.org/job/html+java/lastSuccessfulBuild/artifact/boot/target/site/apidocs/index.html javadoc]). The goal is to have source like this:
+
The first step is to convert comments into something that [[JVM]] can consume. Since [[JDK]]5 the proper way of attaching additional information to methods is to use [[annotations]]. Let's us rewrite the code to use ''@JavaScriptBody'' as provided by HTML/Java interop API (see its [https://bits.netbeans.org/html+java/1.7.1/ javadoc]). The goal is to have source like this:
<source lang="java">
<source lang="java">

JaroslavTulach: /* Bck2Brwsr */ - 2014-01-29 18:31:29

Bck2Brwsr

←Older revision Revision as of 18:31, 29 January 2014
Line 117: Line 117:
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild.
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild.
-
Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications!
+
Say farewell to [[GWT]]. Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications! Long live [[Java]] in browsers!

JaroslavTulach: /* Bck2Brwsr */ - 2014-01-29 18:30:40

Bck2Brwsr

←Older revision Revision as of 18:30, 29 January 2014
Line 113: Line 113:
=== [[Bck2Brwsr]] ===
=== [[Bck2Brwsr]] ===
-
Originally we started with a [[GWT]] application. Now we have real [[Java]] application, which can run on desktop and render its [[HTML]] UI via [[JavaFX]]. However our original application used to run in a browser? Can we do the same?
+
Originally we started with a [[GWT]] application. Now we have a real [[Java]] application, which can run on desktop and render its [[HTML]] UI via [[JavaFX]]. [[Good]], however our original application used to run in a browser. Can we do the same?
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild.
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild.
Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications!
Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications!

JaroslavTulach: /* Convert to Annotations */ - 2014-01-29 18:29:07

Convert to Annotations

←Older revision Revision as of 18:29, 29 January 2014
Line 99: Line 99:
</source>
</source>
-
To help us with migration there is a [[NetBeans]] module that can do this for us automatically (either one by one or as a batch conversion).
+
To help us with migration there is a [[NetBeans]] module that can do this for us automatically (either one by one or as a batch conversion).
 +
 
 +
The syntax of [[Java]] callbacks from [[JavaScript]] is the same as the one defined
 +
by [[GWT]] (e.g. starts with '''@'''). However, thanks to [[AnnotationProcessor]]s, it is now part of [[Javac]] execution - if there is a typo in the class name (''java.lang.Runnable''), method
 +
name (''run''), or its parameters (empty list in this case) an error is emitted during compilation - preventing errors as soon as possible.
=== Real [[HotSpot]] [[VM]] ===
=== Real [[HotSpot]] [[VM]] ===

JaroslavTulach: /* Convert to Annotations */ - 2014-01-29 18:23:00

Convert to Annotations

←Older revision Revision as of 18:23, 29 January 2014
Line 99: Line 99:
</source>
</source>
-
To help us with migration there is a [[NetBeans]] module that can do this for us automatically.
+
To help us with migration there is a [[NetBeans]] module that can do this for us automatically (either one by one or as a batch conversion).
 +
 
 +
=== Real [[HotSpot]] [[VM]] ===
 +
 
 +
When we have our libraries converted, we can use them in a ''knockout4j'' [[Maven]] archetype project and use it inside of [[JavaFX]] WebView. This gives us all the benefits of [[HotSpot]] and real [[Java]] (including features of modern [[JDK]]s).
 +
 
 +
We can use [[debugger]] and verify the behavior of the [[Java]] application logic the way we are used to.
 +
 
 +
=== [[Bck2Brwsr]] ===
 +
 
 +
Originally we started with a [[GWT]] application. Now we have real [[Java]] application, which can run on desktop and render its [[HTML]] UI via [[JavaFX]]. However our original application used to run in a browser? Can we do the same?
 +
 
 +
Yes, we can. With the help of [[Bck2Brwsr]] [[VM]], we can take the same application and repackage it so it runs in a pluginless browser. Just choose ''bck2brwsr'' [[Maven]] configuration and rebuild.
 +
 
 +
Enjoy your [[GWT]]-less [[HTML]]/[[Java]] applications!