SlideShare a Scribd company logo
Web Components & GWT
Introducing GWT-Polymer
Manuel Carrasco Moñino.
GWT-meetup 2015
Provide a Java API to
consume Vaadin
Components in GWT
Motivation
Web Components:
State of the art
State of the Art
Native browser support
Polymer
Polymer makes it easier and faster to create
anything from a button to a complete
application across desktop, mobile, and
beyond.
● webcomponents.js
● polymer.js
● core-components
○ collapse
○ drawer
○ dropdown
○ field
○ header
○ icon
○ input
○ menu
○ range
○ splitter
○ toolbar
○ tooltip
Polymer Paper components
The Paper elements are a set of UI elements
that implement the material design spec
paper components
○ button
○ checkbox
○ dialog
○ elements
○ fab
○ focusable
○ icon
○ input
○ item
○ progress
○ radio
○ ripple
○ shadow
○ slider
○ tabs
○ toast
○ toggle
Vaadin Components
A collection of the awesome Vaadin widget
set.
vaadin components
○ grid
GWT & Web Components
1. Use JsInterop to wrap Js objects and export Java classes
a. @JsType Wrap JS Objects without writing JSNI
b. @JsExport Expose GWT classes and methods to JS (not used)
c. @JsFunction Use interfaces as JS Functions (some issues)
2. Hand write Java Interfaces for the Web API
a. Window, Document, Element, Style, Events, …
b. Implementation does not extend JSO, needs casting (issues)
c. They might come with Elemental-2.0
3. Code generation
a. There could be ways to create all the java boilerplate code
GWT JsInterop
1. Create reusable methods to import and create new
instances of web components
2. Define a Java Interface per component and event
- Extends HTMLElement or Event
3. Optionally Wrap each Interface in a Widget class for
classic GWT apps.
How to consume WC
Interfaces for native JS objects
@JsType
public interface HTMLElement extends Element {
}
@JsType
public interface Element extends Node {
@JsProperty
String getInnerHTML();
@JsProperty
DOMTokenList getClassList();
void setAttribute(String name, String value);
String getAttribute(String name);
void removeAttribute(String name);
}
@JsType
public interface Node extends EventTarget {
}
@JsType
public interface EventTarget {
void addEventListener(String type, EventListener listener);
}
Reusable methods
public class Polymer {
// Ensures that the tagName has been registered, otherwise injects
// the appropriate <import> tag in the document header
public static void ensureHTMLImport(String tagName) {
if ( !registered(tagName)) {
String href = GWT.getModuleBaseForStaticFiles() +
"bower_components/" + tagName + "/" + tagName + ".html";
Element link = Document.get().createLinkElement();
link.setAttribute("rel", "import");
link.setAttribute("href", href);
Document.get().getHead().appendChild(htmlImport);
}
}
// Returns a new instance of the Element. It loads the webcomponent
// if not loaded yet.
public static <T> T createElement(String tagName) {
ensureHTMLImport(tagName);
return (T)Document.get().createElement(tagName);
}
}
The WC Element interface
@JsType
public interface PaperButton extends HTMLElement {
@JsProperty PaperButton setLabel(String val);
@JsProperty String getLabel();
@JsProperty PaperButton setRaisedButton(boolean val);
@JsProperty boolean getRaisedButton();
@JsProperty PaperButton setIcon(String val);
@JsProperty String getIcon();
}
Consume WC in Java (Element API)
// Create a new instance of PaperButton
PaperButtonElement button = Polymer.create(PaperButtonElement.TAG;
// Set some properties
button.icon("polymer")
.label("Polymer")
.raisedButton(false);
// Add event listeners
button.addEventListener("click", new EventListener() {
public void onBrowserEvent(Event event) {
...
}
});
// Append to the document
myContainerElement.appendChild(button);
The WC Widget Class
public class PaperButton extends PolymerWidget {
//Default Constructor.
public PaperButton() {
this("");
}
//Constructor used by UIBinder
public PaperButton(String html) {
this(PaperButtonElement.TAG, html);
}
// Used when this element is extended by another.
protected PaperButton(String tag, String html) {
super(tag, html);
}
// Gets a handle to the Polymer object's underlying DOM element.
public PaperButtonElement getPolymerElement() {
return (PaperButtonElement) getElement();
}
public boolean isRaised() {
return getPolymerElement().isRaised();
}
}
public class PolymerWidget extends HTMLPanel {
public PolymerWidget(String tag, String html) {
super(tag, html);
Polymer.ensureHTMLImport(tag);
}
}
Consume WC in Java (Widget API)
// Widgets allow consume WC using the GWT classic way.
PaperButton button = new PaperButton();
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
// ...
}
});
RootPanel.get().add(button);
Consume WC in UIBinder
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:p='urn:import:com.vaadin.components.gwt.polymer.client.widget'>
<ui:style>
.container paper-button.colored {
background: #4285f4;
color: #fff;
}
</ui:style>
<g:HTMLPanel>
<p:PaperButton toggle="" raised="" active="" addStyleNames="{style.colored}">active</p:PaperButton>
<paper-button raised="" noink="">Click me</paper-button>
</g:HTMLPanel>
Introducing GWT-
Polymer
GWT-Polymer
1. It’s a code generator to produce GWT wrappers for
polymer elements
a. Scrapes source documentation
2. Uses standard JS libraries to parse components.
a. node.js, npm, bower, gulp
b. context-free parser + lodash.template
3. It’s a Vaadin Labs project
a. Just released a paper gwt API snapshot (using polymer 0.5)
b. Work in progress to support polymer 0.9 (hydrolysis parser)
c. Still under definition, expect package name changes, etc
GWT-Polymer workflow
1. Checkout git clone github.com/vaadin/gwt-polymer
2. Run npm install
3. Edit the bower.json file and add/remove the
components you need for your project.
4. Run bower install to download components
5. Run gulp gwt-api in order to generate all java files
6. Run mvn clean package to produce your package .jar
7. Everything is contained in the artefact (polyfill,
components, java code).
GWT-Polymer goals
1. Very little code to maintain.
a. 950 LOC / 108 KB
2. But it produces a lot of java code
a. 13400 LOC (paper & core elements)
3. It uses native JS parsers for JS code.
a. The same tools that polymer uses
b. No GWT generators nor APT processors.
4. Standard tools for web developers.
a. They can deliver gwt libraries without knowing java
Discussion
1. Should we deliver separated ready-to-use libraries?
a. GWT-Paper 0.5.6.x (matches paper version)
b. Vaadin-Components 0.5.0.x (matches vaadin version)
2. Should we support GWT Widgets or Elements?
3. Makes sense to use JS code generators, or should we
use the Java way?
4. Could we eventually support other JS parsers to wrap
other JS libraries?
a. closure annotations, typescript, etc.
Thanks
Links
- gwt-polymer project
- gwt-polymer-paper .jar artifact
- gwt-polymer-paper demo

More Related Content

What's hot (20)

PDF
Gwt.Create Keynote San Francisco
Ray Cromwell
 
PDF
Why and How to Use Virtual DOM
Daiwei Lu
 
PDF
The Complementarity of React and Web Components
Andrew Rota
 
PDF
Vaadin Components @ Angular U
Joonas Lehtinen
 
PDF
Using ReactJS in AngularJS
Boris Dinkevich
 
PPTX
Web components
Tudor Barbu
 
PDF
React
중운 박
 
ODP
Wicket Next (1.4/1.5)
jcompagner
 
PDF
Vaadin & Web Components
Joonas Lehtinen
 
PDF
How to Build ToDo App with Vue 3 + TypeScript
Katy Slemon
 
PDF
Introduction to VueJS & Vuex
Bernd Alter
 
PDF
Vaadin Components
Joonas Lehtinen
 
PDF
Backbone.js
Omnia Helmi
 
PDF
Building a Startup Stack with AngularJS
FITC
 
PDF
A Closer Look At React Native
Ian Wang
 
PDF
(Js) Export your own WebGL Viewer
JooinK
 
PDF
Angular js vs. Facebook react
Keyup
 
PDF
Polymer, A Web Component Polyfill Library
naohito maeda
 
PPTX
Taking Your GWT App to Tablets with GXT 4.0
David Chandler
 
PPTX
Reactjs workshop
Ahmed rebai
 
Gwt.Create Keynote San Francisco
Ray Cromwell
 
Why and How to Use Virtual DOM
Daiwei Lu
 
The Complementarity of React and Web Components
Andrew Rota
 
Vaadin Components @ Angular U
Joonas Lehtinen
 
Using ReactJS in AngularJS
Boris Dinkevich
 
Web components
Tudor Barbu
 
React
중운 박
 
Wicket Next (1.4/1.5)
jcompagner
 
Vaadin & Web Components
Joonas Lehtinen
 
How to Build ToDo App with Vue 3 + TypeScript
Katy Slemon
 
Introduction to VueJS & Vuex
Bernd Alter
 
Vaadin Components
Joonas Lehtinen
 
Backbone.js
Omnia Helmi
 
Building a Startup Stack with AngularJS
FITC
 
A Closer Look At React Native
Ian Wang
 
(Js) Export your own WebGL Viewer
JooinK
 
Angular js vs. Facebook react
Keyup
 
Polymer, A Web Component Polyfill Library
naohito maeda
 
Taking Your GWT App to Tablets with GXT 4.0
David Chandler
 
Reactjs workshop
Ahmed rebai
 

Similar to Introducing GWT Polymer (vaadin) (20)

PPTX
Open social 2.0 sandbox ee and breaking out of the gadget box
Ryan Baxter
 
PPTX
SoftShake 2013 - Vaadin componentization
Nicolas Fränkel
 
PDF
Angular JS2 Training Session #2
Paras Mendiratta
 
PDF
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
IMC Institute
 
PDF
Modern frontend development with VueJs
Tudor Barbu
 
PDF
Google Web Toolkit
Software Park Thailand
 
PDF
Introduction to Griffon
James Williams
 
PPT
Os Johnson
oscon2007
 
PPTX
Adding a modern twist to legacy web applications
Jeff Durta
 
PDF
Asp.net By Durgesh Singh
imdurgesh
 
PDF
Quasar Framework Introduction for C++ develpoers
sadadkhah
 
PPT
Google Web Toolkits
Yiguang Hu
 
PDF
Architecting your GWT applications with GWT-Platform - Lesson 02
rhemsolutions
 
PPT
GWT Training - Session 2/3
Faiz Bashir
 
PDF
Desbravando Web Components
Mateus Ortiz
 
PPT
OGCE Project Overview
marpierc
 
ODP
HTML5
Hatem Mahmoud
 
PPT
Wicket Introduction
Eyal Golan
 
PDF
Dart Workshop
Dmitry Buzdin
 
PDF
Web Components v1
Mike Wilcox
 
Open social 2.0 sandbox ee and breaking out of the gadget box
Ryan Baxter
 
SoftShake 2013 - Vaadin componentization
Nicolas Fränkel
 
Angular JS2 Training Session #2
Paras Mendiratta
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
IMC Institute
 
Modern frontend development with VueJs
Tudor Barbu
 
Google Web Toolkit
Software Park Thailand
 
Introduction to Griffon
James Williams
 
Os Johnson
oscon2007
 
Adding a modern twist to legacy web applications
Jeff Durta
 
Asp.net By Durgesh Singh
imdurgesh
 
Quasar Framework Introduction for C++ develpoers
sadadkhah
 
Google Web Toolkits
Yiguang Hu
 
Architecting your GWT applications with GWT-Platform - Lesson 02
rhemsolutions
 
GWT Training - Session 2/3
Faiz Bashir
 
Desbravando Web Components
Mateus Ortiz
 
OGCE Project Overview
marpierc
 
Wicket Introduction
Eyal Golan
 
Dart Workshop
Dmitry Buzdin
 
Web Components v1
Mike Wilcox
 
Ad

More from Manuel Carrasco Moñino (20)

PDF
The Java alternative to Javascript
Manuel Carrasco Moñino
 
PDF
GWT and PWA
Manuel Carrasco Moñino
 
PDF
Present and Future of GWT from a developer perspective
Manuel Carrasco Moñino
 
PDF
GWT Contributor Workshop
Manuel Carrasco Moñino
 
PDF
CRUD with Polymer 2.0
Manuel Carrasco Moñino
 
PDF
Web Components and PWA
Manuel Carrasco Moñino
 
PPTX
Building Components for Business Apps
Manuel Carrasco Moñino
 
PDF
Vaadin codemotion 2014
Manuel Carrasco Moñino
 
PDF
GwtQuery the perfect companion for GWT, GWT.create 2013
Manuel Carrasco Moñino
 
PDF
Rapid and Reliable Developing with HTML5 & GWT
Manuel Carrasco Moñino
 
PDF
Aprendiendo GWT
Manuel Carrasco Moñino
 
PDF
Apache James/Hupa & GWT
Manuel Carrasco Moñino
 
PDF
GWT: Why GWT, GQuery, and RequestFactory
Manuel Carrasco Moñino
 
PDF
Mod security
Manuel Carrasco Moñino
 
PDF
Gwt IV -mvp
Manuel Carrasco Moñino
 
PDF
Gwt III - Avanzado
Manuel Carrasco Moñino
 
PDF
Gwt II - trabajando con gwt
Manuel Carrasco Moñino
 
PDF
Gwt I - entendiendo gwt
Manuel Carrasco Moñino
 
PDF
Seguridad en redes de computadores
Manuel Carrasco Moñino
 
PDF
Gwt seminario java_hispano_manolocarrasco
Manuel Carrasco Moñino
 
The Java alternative to Javascript
Manuel Carrasco Moñino
 
Present and Future of GWT from a developer perspective
Manuel Carrasco Moñino
 
GWT Contributor Workshop
Manuel Carrasco Moñino
 
CRUD with Polymer 2.0
Manuel Carrasco Moñino
 
Web Components and PWA
Manuel Carrasco Moñino
 
Building Components for Business Apps
Manuel Carrasco Moñino
 
Vaadin codemotion 2014
Manuel Carrasco Moñino
 
GwtQuery the perfect companion for GWT, GWT.create 2013
Manuel Carrasco Moñino
 
Rapid and Reliable Developing with HTML5 & GWT
Manuel Carrasco Moñino
 
Aprendiendo GWT
Manuel Carrasco Moñino
 
Apache James/Hupa & GWT
Manuel Carrasco Moñino
 
GWT: Why GWT, GQuery, and RequestFactory
Manuel Carrasco Moñino
 
Gwt III - Avanzado
Manuel Carrasco Moñino
 
Gwt II - trabajando con gwt
Manuel Carrasco Moñino
 
Gwt I - entendiendo gwt
Manuel Carrasco Moñino
 
Seguridad en redes de computadores
Manuel Carrasco Moñino
 
Gwt seminario java_hispano_manolocarrasco
Manuel Carrasco Moñino
 
Ad

Recently uploaded (20)

PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 

Introducing GWT Polymer (vaadin)

  • 1. Web Components & GWT Introducing GWT-Polymer Manuel Carrasco Moñino. GWT-meetup 2015
  • 2. Provide a Java API to consume Vaadin Components in GWT Motivation
  • 6. Polymer Polymer makes it easier and faster to create anything from a button to a complete application across desktop, mobile, and beyond. ● webcomponents.js ● polymer.js ● core-components ○ collapse ○ drawer ○ dropdown ○ field ○ header ○ icon ○ input ○ menu ○ range ○ splitter ○ toolbar ○ tooltip
  • 7. Polymer Paper components The Paper elements are a set of UI elements that implement the material design spec paper components ○ button ○ checkbox ○ dialog ○ elements ○ fab ○ focusable ○ icon ○ input ○ item ○ progress ○ radio ○ ripple ○ shadow ○ slider ○ tabs ○ toast ○ toggle
  • 8. Vaadin Components A collection of the awesome Vaadin widget set. vaadin components ○ grid
  • 9. GWT & Web Components
  • 10. 1. Use JsInterop to wrap Js objects and export Java classes a. @JsType Wrap JS Objects without writing JSNI b. @JsExport Expose GWT classes and methods to JS (not used) c. @JsFunction Use interfaces as JS Functions (some issues) 2. Hand write Java Interfaces for the Web API a. Window, Document, Element, Style, Events, … b. Implementation does not extend JSO, needs casting (issues) c. They might come with Elemental-2.0 3. Code generation a. There could be ways to create all the java boilerplate code GWT JsInterop
  • 11. 1. Create reusable methods to import and create new instances of web components 2. Define a Java Interface per component and event - Extends HTMLElement or Event 3. Optionally Wrap each Interface in a Widget class for classic GWT apps. How to consume WC
  • 12. Interfaces for native JS objects @JsType public interface HTMLElement extends Element { } @JsType public interface Element extends Node { @JsProperty String getInnerHTML(); @JsProperty DOMTokenList getClassList(); void setAttribute(String name, String value); String getAttribute(String name); void removeAttribute(String name); } @JsType public interface Node extends EventTarget { } @JsType public interface EventTarget { void addEventListener(String type, EventListener listener); }
  • 13. Reusable methods public class Polymer { // Ensures that the tagName has been registered, otherwise injects // the appropriate <import> tag in the document header public static void ensureHTMLImport(String tagName) { if ( !registered(tagName)) { String href = GWT.getModuleBaseForStaticFiles() + "bower_components/" + tagName + "/" + tagName + ".html"; Element link = Document.get().createLinkElement(); link.setAttribute("rel", "import"); link.setAttribute("href", href); Document.get().getHead().appendChild(htmlImport); } } // Returns a new instance of the Element. It loads the webcomponent // if not loaded yet. public static <T> T createElement(String tagName) { ensureHTMLImport(tagName); return (T)Document.get().createElement(tagName); } }
  • 14. The WC Element interface @JsType public interface PaperButton extends HTMLElement { @JsProperty PaperButton setLabel(String val); @JsProperty String getLabel(); @JsProperty PaperButton setRaisedButton(boolean val); @JsProperty boolean getRaisedButton(); @JsProperty PaperButton setIcon(String val); @JsProperty String getIcon(); }
  • 15. Consume WC in Java (Element API) // Create a new instance of PaperButton PaperButtonElement button = Polymer.create(PaperButtonElement.TAG; // Set some properties button.icon("polymer") .label("Polymer") .raisedButton(false); // Add event listeners button.addEventListener("click", new EventListener() { public void onBrowserEvent(Event event) { ... } }); // Append to the document myContainerElement.appendChild(button);
  • 16. The WC Widget Class public class PaperButton extends PolymerWidget { //Default Constructor. public PaperButton() { this(""); } //Constructor used by UIBinder public PaperButton(String html) { this(PaperButtonElement.TAG, html); } // Used when this element is extended by another. protected PaperButton(String tag, String html) { super(tag, html); } // Gets a handle to the Polymer object's underlying DOM element. public PaperButtonElement getPolymerElement() { return (PaperButtonElement) getElement(); } public boolean isRaised() { return getPolymerElement().isRaised(); } } public class PolymerWidget extends HTMLPanel { public PolymerWidget(String tag, String html) { super(tag, html); Polymer.ensureHTMLImport(tag); } }
  • 17. Consume WC in Java (Widget API) // Widgets allow consume WC using the GWT classic way. PaperButton button = new PaperButton(); button.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { // ... } }); RootPanel.get().add(button);
  • 18. Consume WC in UIBinder <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:p='urn:import:com.vaadin.components.gwt.polymer.client.widget'> <ui:style> .container paper-button.colored { background: #4285f4; color: #fff; } </ui:style> <g:HTMLPanel> <p:PaperButton toggle="" raised="" active="" addStyleNames="{style.colored}">active</p:PaperButton> <paper-button raised="" noink="">Click me</paper-button> </g:HTMLPanel>
  • 20. GWT-Polymer 1. It’s a code generator to produce GWT wrappers for polymer elements a. Scrapes source documentation 2. Uses standard JS libraries to parse components. a. node.js, npm, bower, gulp b. context-free parser + lodash.template 3. It’s a Vaadin Labs project a. Just released a paper gwt API snapshot (using polymer 0.5) b. Work in progress to support polymer 0.9 (hydrolysis parser) c. Still under definition, expect package name changes, etc
  • 21. GWT-Polymer workflow 1. Checkout git clone github.com/vaadin/gwt-polymer 2. Run npm install 3. Edit the bower.json file and add/remove the components you need for your project. 4. Run bower install to download components 5. Run gulp gwt-api in order to generate all java files 6. Run mvn clean package to produce your package .jar 7. Everything is contained in the artefact (polyfill, components, java code).
  • 22. GWT-Polymer goals 1. Very little code to maintain. a. 950 LOC / 108 KB 2. But it produces a lot of java code a. 13400 LOC (paper & core elements) 3. It uses native JS parsers for JS code. a. The same tools that polymer uses b. No GWT generators nor APT processors. 4. Standard tools for web developers. a. They can deliver gwt libraries without knowing java
  • 23. Discussion 1. Should we deliver separated ready-to-use libraries? a. GWT-Paper 0.5.6.x (matches paper version) b. Vaadin-Components 0.5.0.x (matches vaadin version) 2. Should we support GWT Widgets or Elements? 3. Makes sense to use JS code generators, or should we use the Java way? 4. Could we eventually support other JS parsers to wrap other JS libraries? a. closure annotations, typescript, etc.
  • 24. Thanks Links - gwt-polymer project - gwt-polymer-paper .jar artifact - gwt-polymer-paper demo