SlideShare a Scribd company logo
GWT 2.8.x - 3.0.x
The Java alternative to Javascript
Manolo Carrasco
+ManuelCarrascoMonino
@dodotis
About me
Agenda
● A little bit of context of Vaadin
● Spooky JS
● History of GWT
● Present of GWT
○ LTM projects
○ Modern web
● Is GWT dead
○ State of the Frontend
○ J2CL the future
FIGHT FOR SIMPLICITYthinking of U and I
- Vaadin is a development platform for web
applications that prioritizes ease of development
and uncompromised end user experience.
- The Vaadin platform consists of a comprehensive
set of web components, a Java web framework,
configurable themes, tools and a set of app
templates.
Vaadin
Architecture
Developer Space
Provided by Vaadin
JVM
Browser
Java Lang JVM
ecosystem
libs, IDEs ...
Developer space GWT vs Vaadin
Java Lang JVM
ecosystem
libs, IDEs ...
Scala, Groovy...
MillStone 3.0
IT Mill 4.0
IT Mill 5.0
2002
2007
2008
2018
2013
2009
Vaadin 6.0
Vaadin 7.0
2017
Vaadin 8.0
Vaadin 10
Vaadin: a 18y whisky
Next Generation Architecture
Spooky JavaScript
JS: What is the issue here?
idx might be a String
"0" == 0
"0" === 0
[] == []
[] == ![]
![]
+[]
2 == [2]
+[2]
[2] + ''
+([2] + '')
+[2,3]
+[2,3] + ''
'2' + 1
'2' - 1
'2' - - 1
+true
+false
true + true
parseInt(2)
parseInt('2')
parseInt('aaa')
parseInt(9999999999999999)
typeof NaN
0.1 + 0.2 == 0.3
'I am String' instanceof String
String('I am String') instanceof String
3 > 2
2 > 1
3 > 2 > 1
3 > 2 >= 1
1 < Number.MAX_VALUE
-1 < Number.MAX_VALUE
-1 < Number.MIN_VALUE
Number.MAX_VALUE
Number.MIN_VALUE
Math.max(1,2,3)
Math.min(1,2,3)
Math.max() > Math.min()
Math.max()
Math.min()
String instanceof String
Math instanceof Math
typeof null
null instanceof Object
JS: Crazy type conversion
The Java alternative to Javascript
GWT's mission is to radically improve the web experience
for users by enabling developers to use existing Java tools
to build no-compromise AJAX for any modern browser.
GWT Mision
A high-level language allows the Developer not to miss out
on low-level details and reuse existing ecosystem
GWT Productivity 2006
2006 Context
- Browsers
- No Debug tools
- IE6, FF 1.5, Safari 2, Opera 9, No Chrome
- Incipient CSS (No animations, No rounded …)
- No RIA, No SPI
- No Smartphones
- Low performance PCs (256Mb, Single Core ...)
- JavaScript
- ES-3, No Standard XHR, No DOM traversing
- No IDE. No Refactoring, No Tests, No Libraries, No packaging ...
- No Runtime (V8)
- Java 1.4, no generics, no annotations
2006 Context
- Compiling to JavaScript was not a thing
- GWT pioneered the idea.
- Then came: CoffeeScript, Dart, TypeScript, …
Advantages of a Compiler
Separate the maintainability of the code from the
effectiveness of the executable.
- The handwritten JS was verbose and slow
- The solution is not to look for conventions in the javascript code
written by hand, it is to create a level of separation so that both are
not compromised (maintainability, effectiveness).
Remove the bad parts while keeping the good stuff
Advantages in Compile Time
- Common errors are correctable at compile time and
not in execution time.
- Functionalities can be injected.
- Peculiarities / Hacks for each browser
- Assets bundling and compression
- Code Splitting and async loading
- Conversion and obfuscation server objects ↔ client
- Versioning, Minimisation
The basis of GWT
- The heart of GWT is the compiler, Java -> JavaScript
- Only supports a subset of the Java language
- The resulting code is JavaScript, single-threaded code.
- Creates a separated, obfuscated and optimised
JavaScript implementation for each supported browser.
- Takes into account browser specific features, bugs, issues and
performance optimizations
- But the toolkit has plenty of tools (dev, build, test, libs)
Innuvo
1.0.21
1.3.3 O.S
2005
2006
2007
2018
2010
2009
2.0 UIB OOPHM
2.1 MVP RF
2011
2.2 Designer
3.0 J2CL
GWT a 12y whisky
2012
Grid 2.4
2013
2.5 SDM
2017
2.8 J8 JSi E22014
2.6 J7
The present of GWT
GWT is Popular in the Java Web
2016
2012
Stable Platform
Reliable
Good Tools & Ecosystem
High Quality and Mature
Fast development cycles
For Big Teams & Big Projects
But
High Learning Curve
Outdated docs
Obsolete Stuff
↝ Generators
↝ Widgets, Elements, JSO
↝ RPC
↝ RF
↝ AutoBeans
↝ UiBinder
↝ JSNI
↝ Classic DevMode
↝ Ant
↝ Designer
Project Activity Deceleration
A project with few Contributors
Unmaintained libs
GWT spring react
Hard to Interact with JS
- Not Anymore
- JsInterop
- Elemental2
@JsType(isNative = true)
public abstract class JQuery {
@JsMethod(namespace=GLOBAL)
public native static JQuery $(String selector);
public native JQuery css(String prop, String val);
public native JQuery attr(String name, String val);
}
import static jquery.JQuery.$;
// ...
$("ul > li").css("color", "red").attr("data-level", "first");
Java
Java
Use native JsType to use any
existing JavaScript library.
Use it like JavaScript
JsInterop Consume
package foo;
@JsType
public class Bar {
public boolean bool = true;
public Bar() {}
public String foo() { return "Hello GWTCon!";}
}
var bar = new foo.Bar();
if (bar.bool) {
alert(bar.foo());
}
JavaScript
Expose your Object to
JavaScript world.
JavaScript can use your public
API of exposed Java objects.
Java
JsInterop Export
Elemental2 - new Browser API
public class SimpleApp {
public static void main(String[] args) {
window.addEventListener("load", evt -> install());
}
private static void install() {
final HTMLButtonElement button = (HTMLButtonElement) document.createElement("button");
button.textContent = "Click me";
button.addEventListener("click", evt1 -> {
button.parentNode.removeChild(button);
console.log("Button has been removed.");
});
document.body.appendChild(button);
}
}
Status of the current GWT
GWT 2.8.x
- Big Java artifacts (no split in modules)
- Stable & Long Term API Support
- No new Features planned
- Prepared for JS
- JsInterop
- Elemental2
- Large ecosystem
- 2.8 is stable and available for foreseeable future
Long Term Support Applications
LTS Apps
2.8.x is perfect for Long Term Apps
- Avoid legacy modules
- Most Widgets, RPC, RF, etc
- Design with UIBinder and CSS3
- Use J8 syntax, collapse browser permutations.
- Select good 3rd party libs
- Gwt-material, Gwt-bootstrap, Gwt-query
- Use JsInterop for json data or Resty-GWT
Good Practices for LTS apps in 2.8.x
GWT is PWA
Decorate the host page with CSS3
App Shell
GWT nature is SPI and RIA
App Like Iterations
GWT History Tokens
Linkable
HTTPS: simply works
GWT linkers: unique random names
Secure & Fresh Updates
Responsive UI
- Permutation per device
- Responsive UI libs
- GWT already have
- Code splitting
- Code removal
- Permutations
Fast Loading
Offline
GWT is client side -> Works Offline
- Use Responsive Widgets
Gwt-bootstrap
Gwt-material
Gwt-polymer-elements
Recipe 1 - Responsiveness
- Re-use UI Componens: JsInterop
- Easier development and sharing
- Lazy load components when needed
- Cache components for ever
- Use the platform: Elemental 2.0
- Thanks to JsInterop, to interact with platform is easy
- Use Elements instead of Widgets
- Not need of gwt wrap libraries
Recipe 2 - Fast loading
- Add a static Web App manifest
- Generate service-worker
- Disable old browsers:
<set-property name="user.agent" value="safari,gecko1_8" />
- Don’t use permutations:
<collapse-all-properties value="true" />
- Avoid random JS names
<add-linker name="sso" />
- Use the sw-precache CLI
Recipe 3 - Offline first
- Use out-of-the-box solutions
- PouchDB + CouchDB
- Gwt-pouchdb
- Vaadin-pouchdb (via gwt polymer)
- Firebase
- Gwt-firebase (xplatform)
- Polymerfire (via gwt polymer)
Recipe 4 - Data Offline
- Inbox
- G Suite
- Google Docs
- Google Flights
- Closure
- Vaadin Flow internals
How uses modern GWT
GWT Transition path for the
Future
The Near future of GWT
GWT 2.9.x
- Modular (split in small artifacts)
- Parts might be transferred to, or taken by the community
- Expect changes and new Features in API
- Removing browsers, jsni, moving namespaces, etc
- Replacing generators with Annotation Processors
- But maintaining backwards compatibility
- Prepared for the JavaScript wild
- Expect tools for sharing with GWT 3.0
2.9.x might be your Transition Path
- Use min set of modules, start with Core.gwt.xml
- Forget Classic Widgets and Element
- Replace classic DOM with Elemental2
- #useThePlatform as much as possible
- Check 3rd party modules not to import User.gwt.xml
- Design the UI using Js reusable widgets
- Web components (gwt-polymer)
- Html templates (elemento or polymer)
- Decouple business logic from UI
Best practices for the Transition
The Future of GWT
Frontend: State of the art
We are in the JavaScript Era
Popularity of Web Platforms
Huge ecosystem
Good dev tools in JS
JS also runs everywhere
How is GWT in this jungle
Lot of reactions, Is GWT Dead?
GWT reasons, not valid anymore
- For the Browser (2006)
- Huge diffs between vendors (IE6)
- memory limitations (256Kb RAM PCs)
- Related with JavaScript (2006)
- No way to debug JS
- No tooling for JS optimisation and obfuscation
- No way of modularising / managing dependencies
- No IDE. No Testing tools. Slow runtime.
- Java Specific (2006)
- Same language client/server
- More developers than JavaScript
- The Java Language is the strong Key of using GWT
GWT reasons nowadays
Embrace the JavaScript world
GWT 3.0 is for the frontend chaos
- New compiler and tooling
- J2CL
- Runtime JVM, Node or both?
- Build system bazel, maven, npm ?
- Big changes in API and emulated JRE
- Prepared for the platform
- JsInterop
- Elemental2
- Comes with a different DX paradigm
J2CL
Pronounced “Jackal”
Shares features with the GWT compiler
● JsInterop
● Java8
● Java standard library (JRE)
● Elemental2
J2CL
Source to source transpiler
- Takes Java 8 code as input and outputs readable ES6 with JsDoc
Closure style annotations
Transpiles one Java class at a time
Optimizations happen in Closure compiler
Code generation happen in Java annotation processors
Targeting modern Js features, blazing fast
Transpiler
@JsType
public class Hello {
public String message() {
return "GWTCon!";
}
public static String getMessage() {
return "Hello " + new Hello().message();
}
}
class Hello extends java_lang_Object {
/**
* @public
*/
constructor() {
super();
}
/**
* @return {?string}
* @public
*/
message() {
return "GWTCon!";
}
/**
* @return {?string}
* @public
*/
static getMessage() {
return "Hello " + new Hello().message();
}
};
J2CL - Sharing Code
Java JavaScriptJ2CL JavaScriptClosure
Optimized
JavaScript
J2CL + Closure → Optimisation
Two possible paths for J2CL
➔ Classic Java Development flow
◆ Java IDE
◆ Java dependency artifacts (.jar)
◆ Java Build tools mvn, gradle, j2cl, closure, linker
◆ JVM for server side and testing tools
➔ Just a transpiler to JavaScript
◆ Java IDE
◆ JS dependencies (.js)
◆ JS Build tools npm, closure-compiler-js
◆ node-js for server side
◆ JS testing tools
A java transpiler in the JS world
NODE
ECOSYSTE
M
npm,gulp,*.js
,
Java IDE
mvn, jar,
Java IDE
JVMJAVA NODE
npm, gulp,
*.js,
Java IDE
JAVA
Thanks
manolo@vaadin.com
+ManuelCarrascoMonino
@dodotis

More Related Content

PDF
CRUD with Polymer 2.0
PDF
Web Components and PWA
PDF
PDF
GWT Contributor Workshop
PDF
Present and Future of GWT from a developer perspective
PDF
The future of GWT 2.x - By Colin Alworth
PDF
In defense of GWT-RPC By Colin Alworth
PDF
GWT- Google Web Toolkit
CRUD with Polymer 2.0
Web Components and PWA
GWT Contributor Workshop
Present and Future of GWT from a developer perspective
The future of GWT 2.x - By Colin Alworth
In defense of GWT-RPC By Colin Alworth
GWT- Google Web Toolkit

What's hot (20)

PDF
Building Rich Internet Applications Using Google Web Toolkit
PDF
Gwt Presentation
PDF
Best Practices - By Lofi Dewanto
PDF
Gwt.Create Keynote San Francisco
PDF
Javascript as a target language - GWT KickOff - Part 2/2
PDF
XWiki Aquarium Paris
PDF
Turducken - Divide and Conquer large GWT apps with multiple teams
PDF
Net Beans61 Ide
PPTX
Web Components the best marriage for a PWA
PDF
GWT Reloaded
PDF
Java EE 6 Aquarium Paris
PDF
MySQL Aquarium Paris
PDF
JBoss EAP 7 & JDG 7 최신 기술 소개
PDF
GlassFish v3 : En Route Java EE 6
PPTX
GWT – The Java Advantage
PDF
Nuxeo WebEngine and GlassFish v3
PDF
The WebKit project
PPT
GWT + Gears : The browser is the platform
PDF
Java 9 and Project Jigsaw
PDF
GlassFish v3 Prelude Aquarium Paris
Building Rich Internet Applications Using Google Web Toolkit
Gwt Presentation
Best Practices - By Lofi Dewanto
Gwt.Create Keynote San Francisco
Javascript as a target language - GWT KickOff - Part 2/2
XWiki Aquarium Paris
Turducken - Divide and Conquer large GWT apps with multiple teams
Net Beans61 Ide
Web Components the best marriage for a PWA
GWT Reloaded
Java EE 6 Aquarium Paris
MySQL Aquarium Paris
JBoss EAP 7 & JDG 7 최신 기술 소개
GlassFish v3 : En Route Java EE 6
GWT – The Java Advantage
Nuxeo WebEngine and GlassFish v3
The WebKit project
GWT + Gears : The browser is the platform
Java 9 and Project Jigsaw
GlassFish v3 Prelude Aquarium Paris
Ad

Similar to The Java alternative to Javascript (20)

PPTX
Google web toolkit ( Gwt )
PPT
PPT
Gwtcreatekeynote
PDF
Gwt kickoff - Alberto Mancini & Francesca Tosi
PPT
Google Web Toolkit Introduction - eXo Platform SEA
PDF
GWT - Building Rich Internet Applications Using OO Tools
PDF
GWT - AppDays - (25 aprile 2014, pordenone)
PDF
First steps with GWT @ Google IO Extended - Pordenone
PPT
GWT is Smarter Than You
PDF
Rapid and Reliable Developing with HTML5 & GWT
PPTX
Gwt session
PPTX
Gwt overview & getting started
PPTX
Gwt session
PPT
GWT Introduction for Eclipse Day
PDF
T 0230 Google Wave Powered By Gwt
PPT
Introduction to Google Web Toolkit
PPTX
GWT HJUG Presentation
PPTX
GWT = easy AJAX
PDF
GWT-Basics
PDF
GWT-Basics
Google web toolkit ( Gwt )
Gwtcreatekeynote
Gwt kickoff - Alberto Mancini & Francesca Tosi
Google Web Toolkit Introduction - eXo Platform SEA
GWT - Building Rich Internet Applications Using OO Tools
GWT - AppDays - (25 aprile 2014, pordenone)
First steps with GWT @ Google IO Extended - Pordenone
GWT is Smarter Than You
Rapid and Reliable Developing with HTML5 & GWT
Gwt session
Gwt overview & getting started
Gwt session
GWT Introduction for Eclipse Day
T 0230 Google Wave Powered By Gwt
Introduction to Google Web Toolkit
GWT HJUG Presentation
GWT = easy AJAX
GWT-Basics
GWT-Basics
Ad

More from Manuel Carrasco Moñino (18)

PPTX
Building Components for Business Apps
PDF
Intro to Web Components, Polymer & Vaadin Elements
PDF
Rock GWT UI's with Polymer Elements
PDF
Introducing GWT Polymer (vaadin)
PDF
Speed up your GWT coding with gQuery
PDF
Vaadin codemotion 2014
PDF
GwtQuery the perfect companion for GWT, GWT.create 2013
PDF
Aprendiendo GWT
PDF
GQuery a jQuery clone for Gwt, RivieraDev 2011
PDF
Apache James/Hupa & GWT
PDF
GWT: Why GWT, GQuery, and RequestFactory
PDF
PDF
PDF
Gwt III - Avanzado
PDF
Gwt II - trabajando con gwt
PDF
Gwt I - entendiendo gwt
PDF
Seguridad en redes de computadores
PDF
Gwt seminario java_hispano_manolocarrasco
Building Components for Business Apps
Intro to Web Components, Polymer & Vaadin Elements
Rock GWT UI's with Polymer Elements
Introducing GWT Polymer (vaadin)
Speed up your GWT coding with gQuery
Vaadin codemotion 2014
GwtQuery the perfect companion for GWT, GWT.create 2013
Aprendiendo GWT
GQuery a jQuery clone for Gwt, RivieraDev 2011
Apache James/Hupa & GWT
GWT: Why GWT, GQuery, and RequestFactory
Gwt III - Avanzado
Gwt II - trabajando con gwt
Gwt I - entendiendo gwt
Seguridad en redes de computadores
Gwt seminario java_hispano_manolocarrasco

Recently uploaded (20)

PPTX
Understanding-Communication-Berlos-S-M-C-R-Model.pptx
PPTX
The spiral of silence is a theory in communication and political science that...
PPTX
An Unlikely Response 08 10 2025.pptx
PDF
Why Top Brands Trust Enuncia Global for Language Solutions.pdf
PPTX
Effective_Handling_Information_Presentation.pptx
PDF
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
PPTX
Relationship Management Presentation In Banking.pptx
PDF
Swiggy’s Playbook: UX, Logistics & Monetization
PPTX
fundraisepro pitch deck elegant and modern
PPTX
Intro to ISO 9001 2015.pptx wareness raising
DOCX
"Project Management: Ultimate Guide to Tools, Techniques, and Strategies (2025)"
PPTX
Presentation for DGJV QMS (PQP)_12.03.2025.pptx
PPTX
Tour Presentation Educational Activity.pptx
DOC
学位双硕士UTAS毕业证,墨尔本理工学院毕业证留学硕士毕业证
PPTX
Primary and secondary sources, and history
PPTX
_ISO_Presentation_ISO 9001 and 45001.pptx
PPTX
2025-08-10 Joseph 02 (shared slides).pptx
PPTX
Project and change Managment: short video sequences for IBA
PDF
oil_refinery_presentation_v1 sllfmfls.pdf
PDF
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf
Understanding-Communication-Berlos-S-M-C-R-Model.pptx
The spiral of silence is a theory in communication and political science that...
An Unlikely Response 08 10 2025.pptx
Why Top Brands Trust Enuncia Global for Language Solutions.pdf
Effective_Handling_Information_Presentation.pptx
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
Relationship Management Presentation In Banking.pptx
Swiggy’s Playbook: UX, Logistics & Monetization
fundraisepro pitch deck elegant and modern
Intro to ISO 9001 2015.pptx wareness raising
"Project Management: Ultimate Guide to Tools, Techniques, and Strategies (2025)"
Presentation for DGJV QMS (PQP)_12.03.2025.pptx
Tour Presentation Educational Activity.pptx
学位双硕士UTAS毕业证,墨尔本理工学院毕业证留学硕士毕业证
Primary and secondary sources, and history
_ISO_Presentation_ISO 9001 and 45001.pptx
2025-08-10 Joseph 02 (shared slides).pptx
Project and change Managment: short video sequences for IBA
oil_refinery_presentation_v1 sllfmfls.pdf
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf

The Java alternative to Javascript

  • 1. GWT 2.8.x - 3.0.x The Java alternative to Javascript Manolo Carrasco +ManuelCarrascoMonino @dodotis
  • 3. Agenda ● A little bit of context of Vaadin ● Spooky JS ● History of GWT ● Present of GWT ○ LTM projects ○ Modern web ● Is GWT dead ○ State of the Frontend ○ J2CL the future
  • 5. - Vaadin is a development platform for web applications that prioritizes ease of development and uncompromised end user experience. - The Vaadin platform consists of a comprehensive set of web components, a Java web framework, configurable themes, tools and a set of app templates. Vaadin
  • 7. Java Lang JVM ecosystem libs, IDEs ... Developer space GWT vs Vaadin Java Lang JVM ecosystem libs, IDEs ... Scala, Groovy...
  • 8. MillStone 3.0 IT Mill 4.0 IT Mill 5.0 2002 2007 2008 2018 2013 2009 Vaadin 6.0 Vaadin 7.0 2017 Vaadin 8.0 Vaadin 10 Vaadin: a 18y whisky
  • 11. JS: What is the issue here? idx might be a String
  • 12. "0" == 0 "0" === 0 [] == [] [] == ![] ![] +[] 2 == [2] +[2] [2] + '' +([2] + '') +[2,3] +[2,3] + '' '2' + 1 '2' - 1 '2' - - 1 +true +false true + true parseInt(2) parseInt('2') parseInt('aaa') parseInt(9999999999999999) typeof NaN 0.1 + 0.2 == 0.3 'I am String' instanceof String String('I am String') instanceof String 3 > 2 2 > 1 3 > 2 > 1 3 > 2 >= 1 1 < Number.MAX_VALUE -1 < Number.MAX_VALUE -1 < Number.MIN_VALUE Number.MAX_VALUE Number.MIN_VALUE Math.max(1,2,3) Math.min(1,2,3) Math.max() > Math.min() Math.max() Math.min() String instanceof String Math instanceof Math typeof null null instanceof Object JS: Crazy type conversion
  • 14. GWT's mission is to radically improve the web experience for users by enabling developers to use existing Java tools to build no-compromise AJAX for any modern browser. GWT Mision A high-level language allows the Developer not to miss out on low-level details and reuse existing ecosystem GWT Productivity 2006
  • 15. 2006 Context - Browsers - No Debug tools - IE6, FF 1.5, Safari 2, Opera 9, No Chrome - Incipient CSS (No animations, No rounded …) - No RIA, No SPI - No Smartphones - Low performance PCs (256Mb, Single Core ...) - JavaScript - ES-3, No Standard XHR, No DOM traversing - No IDE. No Refactoring, No Tests, No Libraries, No packaging ... - No Runtime (V8) - Java 1.4, no generics, no annotations
  • 16. 2006 Context - Compiling to JavaScript was not a thing - GWT pioneered the idea. - Then came: CoffeeScript, Dart, TypeScript, …
  • 17. Advantages of a Compiler Separate the maintainability of the code from the effectiveness of the executable. - The handwritten JS was verbose and slow - The solution is not to look for conventions in the javascript code written by hand, it is to create a level of separation so that both are not compromised (maintainability, effectiveness). Remove the bad parts while keeping the good stuff
  • 18. Advantages in Compile Time - Common errors are correctable at compile time and not in execution time. - Functionalities can be injected. - Peculiarities / Hacks for each browser - Assets bundling and compression - Code Splitting and async loading - Conversion and obfuscation server objects ↔ client - Versioning, Minimisation
  • 19. The basis of GWT - The heart of GWT is the compiler, Java -> JavaScript - Only supports a subset of the Java language - The resulting code is JavaScript, single-threaded code. - Creates a separated, obfuscated and optimised JavaScript implementation for each supported browser. - Takes into account browser specific features, bugs, issues and performance optimizations - But the toolkit has plenty of tools (dev, build, test, libs)
  • 20. Innuvo 1.0.21 1.3.3 O.S 2005 2006 2007 2018 2010 2009 2.0 UIB OOPHM 2.1 MVP RF 2011 2.2 Designer 3.0 J2CL GWT a 12y whisky 2012 Grid 2.4 2013 2.5 SDM 2017 2.8 J8 JSi E22014 2.6 J7
  • 22. GWT is Popular in the Java Web 2016 2012
  • 25. Good Tools & Ecosystem
  • 28. For Big Teams & Big Projects
  • 29. But
  • 32. Obsolete Stuff ↝ Generators ↝ Widgets, Elements, JSO ↝ RPC ↝ RF ↝ AutoBeans ↝ UiBinder ↝ JSNI ↝ Classic DevMode ↝ Ant ↝ Designer
  • 34. A project with few Contributors
  • 36. Hard to Interact with JS - Not Anymore - JsInterop - Elemental2
  • 37. @JsType(isNative = true) public abstract class JQuery { @JsMethod(namespace=GLOBAL) public native static JQuery $(String selector); public native JQuery css(String prop, String val); public native JQuery attr(String name, String val); } import static jquery.JQuery.$; // ... $("ul > li").css("color", "red").attr("data-level", "first"); Java Java Use native JsType to use any existing JavaScript library. Use it like JavaScript JsInterop Consume
  • 38. package foo; @JsType public class Bar { public boolean bool = true; public Bar() {} public String foo() { return "Hello GWTCon!";} } var bar = new foo.Bar(); if (bar.bool) { alert(bar.foo()); } JavaScript Expose your Object to JavaScript world. JavaScript can use your public API of exposed Java objects. Java JsInterop Export
  • 39. Elemental2 - new Browser API public class SimpleApp { public static void main(String[] args) { window.addEventListener("load", evt -> install()); } private static void install() { final HTMLButtonElement button = (HTMLButtonElement) document.createElement("button"); button.textContent = "Click me"; button.addEventListener("click", evt1 -> { button.parentNode.removeChild(button); console.log("Button has been removed."); }); document.body.appendChild(button); } }
  • 40. Status of the current GWT GWT 2.8.x - Big Java artifacts (no split in modules) - Stable & Long Term API Support - No new Features planned - Prepared for JS - JsInterop - Elemental2 - Large ecosystem - 2.8 is stable and available for foreseeable future
  • 41. Long Term Support Applications LTS Apps
  • 42. 2.8.x is perfect for Long Term Apps
  • 43. - Avoid legacy modules - Most Widgets, RPC, RF, etc - Design with UIBinder and CSS3 - Use J8 syntax, collapse browser permutations. - Select good 3rd party libs - Gwt-material, Gwt-bootstrap, Gwt-query - Use JsInterop for json data or Resty-GWT Good Practices for LTS apps in 2.8.x
  • 45. Decorate the host page with CSS3 App Shell
  • 46. GWT nature is SPI and RIA App Like Iterations
  • 48. HTTPS: simply works GWT linkers: unique random names Secure & Fresh Updates
  • 49. Responsive UI - Permutation per device - Responsive UI libs
  • 50. - GWT already have - Code splitting - Code removal - Permutations Fast Loading
  • 51. Offline GWT is client side -> Works Offline
  • 52. - Use Responsive Widgets Gwt-bootstrap Gwt-material Gwt-polymer-elements Recipe 1 - Responsiveness
  • 53. - Re-use UI Componens: JsInterop - Easier development and sharing - Lazy load components when needed - Cache components for ever - Use the platform: Elemental 2.0 - Thanks to JsInterop, to interact with platform is easy - Use Elements instead of Widgets - Not need of gwt wrap libraries Recipe 2 - Fast loading
  • 54. - Add a static Web App manifest - Generate service-worker - Disable old browsers: <set-property name="user.agent" value="safari,gecko1_8" /> - Don’t use permutations: <collapse-all-properties value="true" /> - Avoid random JS names <add-linker name="sso" /> - Use the sw-precache CLI Recipe 3 - Offline first
  • 55. - Use out-of-the-box solutions - PouchDB + CouchDB - Gwt-pouchdb - Vaadin-pouchdb (via gwt polymer) - Firebase - Gwt-firebase (xplatform) - Polymerfire (via gwt polymer) Recipe 4 - Data Offline
  • 56. - Inbox - G Suite - Google Docs - Google Flights - Closure - Vaadin Flow internals How uses modern GWT
  • 57. GWT Transition path for the Future
  • 58. The Near future of GWT GWT 2.9.x - Modular (split in small artifacts) - Parts might be transferred to, or taken by the community - Expect changes and new Features in API - Removing browsers, jsni, moving namespaces, etc - Replacing generators with Annotation Processors - But maintaining backwards compatibility - Prepared for the JavaScript wild - Expect tools for sharing with GWT 3.0
  • 59. 2.9.x might be your Transition Path
  • 60. - Use min set of modules, start with Core.gwt.xml - Forget Classic Widgets and Element - Replace classic DOM with Elemental2 - #useThePlatform as much as possible - Check 3rd party modules not to import User.gwt.xml - Design the UI using Js reusable widgets - Web components (gwt-polymer) - Html templates (elemento or polymer) - Decouple business logic from UI Best practices for the Transition
  • 63. We are in the JavaScript Era
  • 64. Popularity of Web Platforms
  • 66. Good dev tools in JS
  • 67. JS also runs everywhere
  • 68. How is GWT in this jungle
  • 69. Lot of reactions, Is GWT Dead?
  • 70. GWT reasons, not valid anymore - For the Browser (2006) - Huge diffs between vendors (IE6) - memory limitations (256Kb RAM PCs) - Related with JavaScript (2006) - No way to debug JS - No tooling for JS optimisation and obfuscation - No way of modularising / managing dependencies - No IDE. No Testing tools. Slow runtime. - Java Specific (2006) - Same language client/server - More developers than JavaScript
  • 71. - The Java Language is the strong Key of using GWT GWT reasons nowadays
  • 73. GWT 3.0 is for the frontend chaos - New compiler and tooling - J2CL - Runtime JVM, Node or both? - Build system bazel, maven, npm ? - Big changes in API and emulated JRE - Prepared for the platform - JsInterop - Elemental2 - Comes with a different DX paradigm
  • 74. J2CL Pronounced “Jackal” Shares features with the GWT compiler ● JsInterop ● Java8 ● Java standard library (JRE) ● Elemental2
  • 75. J2CL Source to source transpiler - Takes Java 8 code as input and outputs readable ES6 with JsDoc Closure style annotations Transpiles one Java class at a time Optimizations happen in Closure compiler Code generation happen in Java annotation processors Targeting modern Js features, blazing fast
  • 76. Transpiler @JsType public class Hello { public String message() { return "GWTCon!"; } public static String getMessage() { return "Hello " + new Hello().message(); } } class Hello extends java_lang_Object { /** * @public */ constructor() { super(); } /** * @return {?string} * @public */ message() { return "GWTCon!"; } /** * @return {?string} * @public */ static getMessage() { return "Hello " + new Hello().message(); } };
  • 77. J2CL - Sharing Code Java JavaScriptJ2CL JavaScriptClosure Optimized JavaScript
  • 78. J2CL + Closure → Optimisation
  • 79. Two possible paths for J2CL ➔ Classic Java Development flow ◆ Java IDE ◆ Java dependency artifacts (.jar) ◆ Java Build tools mvn, gradle, j2cl, closure, linker ◆ JVM for server side and testing tools ➔ Just a transpiler to JavaScript ◆ Java IDE ◆ JS dependencies (.js) ◆ JS Build tools npm, closure-compiler-js ◆ node-js for server side ◆ JS testing tools
  • 80. A java transpiler in the JS world NODE ECOSYSTE M npm,gulp,*.js , Java IDE mvn, jar, Java IDE JVMJAVA NODE npm, gulp, *.js, Java IDE JAVA