SlideShare a Scribd company logo
Intro to Web Components,
Polymer & Vaadin Elements
Manuel Carrasco Moñino
Senior GWT Expert at Vaadin
1. Motivations
2. What are web components.
3. What’s polymer.
4. Introducing Polymer-Elements & Vaadin-Elements
5. Demo: full-stack app using Polymer
6. Progresive apps
Agenda
Demo
220 LOC
http://manolo.github.io/polymer-robots
Motivations
Former Ui Development
- Verbose code
- Difficult to share
- No mobile in mind
Web Components
- Standard specs.
- Prod. ready collections
- Active Development
- Google
- Vaadin
What are Web Components?
1. It’s a new TAG for your browser ‘<my-ui-
component>’
2. Based on standard specifications.
3. Advantages:
a. Goodbye to browser plugins (WC +
HTML5)
b. Isolated from other elemens in DOM
c. Easy to share (bower)
d. Easy to integrate
Problem -> DOM unique tree
body { background-color: white; }
Solution -> Shadow/Shady DOM
body { background-color: white; }
Encapsulation
Composition
Community
Web Components
State of the art
Browser support
Polyfill
Activity
What’s Polymer
Polymer
- Polymer is a library that allows us to use Web
Components, even though some APIs for are missing
in some browsers.
- Polymer makes easier and faster create anything from
a button to a complete application across desktop,
mobile, and beyond.
- Polymer platform enables sharing UI components
between developers.
- JS: estable API
- polyfills: lightweight shim for Web Components.
- Documentation system
- Production ready components
Polymer Elements
A catalog of ready to use elements built
with polymer:
- Iron Elements (layout, ajax, icons …)
- Paper Elements (Material Design)
- Neon Elements (Animations)
- Gold Elements (Ecomerce)
- Platinum Elements (offline, push …)
- Google Elements (google apis)
- Vaadin Core Elements (enterprise
components)
- Vaadin Chart Elements (charts)
- And much more ...
1. It’s NOT a framework but a small library
a. polymer-micro.html (16K - 7K)
b. polymer-mini.html (54K - 11K)
c. polymer.html (122K - 29K)
2. Polymer Elements are not part of the library, but
developed by the team and contributions.
3. Neither the optional Polyfill is part of it.
a. webcomponents-lite.min.js (40K - 12K)
b. webcomponents.min.js (118K - 33K)
Polymer is the library
1. HTML is the Component Model
2. … and a powerful Declarative Language
3. Data flow is handled with
a. attributes <input value=”foo”>
b. properties myInput.value = “foo”
c. events myInput.addEventListener(‘foo’, bar)
4. Web Components is for missing HTML pieces.
5. Polymer facilitates creating and manipulating them.
DOM is the framework
1. Composition
2. Encapsulation
3. Mediator pattern
An object that
encapsulates how a set of
objects interact
Build Apps with elements
Using Polymer
Polymer: data-binding
<!-- Create an element by composition -->
<dom-module id="input-echo">
<template>
<!-- Bidirectional data binding -->
<paper-input label="Type your name" value="{{name}}"></paper-input>
<!-- One way data binding with function execution -->
<div>Your name is: [[_format(name)]]</div>
<!-- Native elements do not have two-way binding support built in,
use Polymer's event-observer syntax instead -->
<label>Type your name: </label>
<input type="text" value="{{name::keyup}}">
</template>
</dom-module>
<!-- Register the element -->
<script>
Polymer({
is: "input-echo",
_format: function(name) {
return name.toUpperCase();
}
});
</script>
<input-echo value="Manolo">
Polymer: bound directions
<input-echo value="{{name}}">
<div>Your name is: [[_format
(name)]]</div>
<paper-input value="{{name}}">
<input value="{{name::keyup}}">
Polymer: events, observers, notifiers<dom-module id="input-echo">
<template>
...
<div on-tap="_onTap">Your name is: [[_format(name)]]</div>
...
</template>
</dom-module>
<script>
Polymer({
is: "input-echo",
...
properties: {
foo: {
type: Object,
notify: true,
reflectToAttribute: true,
value: {}
}
},
observers: [
'_onChange(foo.*)'
],
_onTap: function(e) {
this.set('foo.bar', this.name);
},
_onChange: function(path, object) {
this.fire('foo-changed-event', this.foo);
}
});
</script>
let’s build a
Progressive Full-stack Application
Architecture
Elements
Polymer
PouchDB CouchDB
- Responsive
- Material Design
- Online/Offline
- Real Time
Components
- PolymerElements & VaadinCoreElements
- Polymer platform
- CouchDB is a database that completely embraces
the web.
- Store your data with JSON documents
- Access your data via HTTP
- Serve pages directly
- PouchDB is database inspired by Apache CouchDB
that is designed to run well within the browser.
- atom: just another text editor. It’s built on top of
Chrome by github.
- node.js: a JS runtime based on V8 the Chrome JS
engine
- npm: the node package manager
- gulp: a make like for javascript projects
- bower: a dependency manager for web projects
- git: npm and bower packages and stored in git
repos.
Usual Tools for Polymer
Demo
Checkout the Code (each commit is one step)
http://manolo.github.io/polymer-robots
Run the live App
https://github.com/manolo/polymer-robots
Tip: open it in Chrome-Android and from the menu select ‘Add to the home Screen’
Install tools video
What else?
- A web application that has a responsive layout,
works offline and can be installed on the home
screen of a device.
- It is different from a ‘classic hybrid app’, which is an
HTML5 application contained in a native wrapper
installed from an app store.
- Polymer is perfect for modularize and hidde stuff
inside web components (web-workers, localstorage,
database access, offline cache …)
- Try to
Progressive Apps
Progressive Apps
1. Responsive: to fit any form factor
2. Connectivity independent: Progressively-enhanced
to let them work offline
3. Fresh: Transparently always up-to-date
4. Discoverable: Are identifiable as “applications”
thanks to W3C Manifests
5. Installable: to the home screen through browser-
provided prompts
6. Linkable: zero-install, and easy to share.
Additional tools
api-generator: It’s a code generator to produce GWT
wrappers & Vaadin Connectors, for JS components.
a. Scrapes source documentation
b. Right now polymer, but considering other sources.
c. Uses standard JS libraries to parse components.
- node.js, npm, bower, gulp
- hydrolysis parser + lodash.template
JsInterop: GWT Export java code and use JS without
boiler-plate.
Thanks
Manuel Carrasco Moñino
+ManuelCarrascoMonino
manolo@vaadin.com
@dodotis

More Related Content

What's hot

Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
JooinK
 
Building Rich Internet Applications Using Google Web Toolkit
Building Rich Internet Applications Using  Google Web ToolkitBuilding Rich Internet Applications Using  Google Web Toolkit
Building Rich Internet Applications Using Google Web Toolkitrajivmordani
 
Gwt.Create Keynote San Francisco
Gwt.Create Keynote San FranciscoGwt.Create Keynote San Francisco
Gwt.Create Keynote San Francisco
Ray Cromwell
 
GWT Introduction and Overview - SV Code Camp 09
GWT Introduction and Overview - SV Code Camp 09GWT Introduction and Overview - SV Code Camp 09
GWT Introduction and Overview - SV Code Camp 09
Fred Sauer
 
Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm package
Andrii Lundiak
 
Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)
Hyungwook Lee
 
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklum Ukraine
 
WebKitGtk+ Project
WebKitGtk+ ProjectWebKitGtk+ Project
WebKitGtk+ ProjectJoone Hur
 
Turducken - Divide and Conquer large GWT apps with multiple teams
Turducken - Divide and Conquer large GWT apps with multiple teamsTurducken - Divide and Conquer large GWT apps with multiple teams
Turducken - Divide and Conquer large GWT apps with multiple teams
Robert Keane
 
Dgeni documentation generator
Dgeni   documentation generatorDgeni   documentation generator
Dgeni documentation generator
Peter Darwin
 
WPE WebKit for Android
WPE WebKit for AndroidWPE WebKit for Android
WPE WebKit for Android
Igalia
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
JooinK
 
Javascript Module Patterns
Javascript Module PatternsJavascript Module Patterns
Javascript Module Patterns
Nicholas Jansma
 
Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)
jcompagner
 
Groovy for Java Devs
Groovy for Java DevsGroovy for Java Devs
Groovy for Java Devs
Zachary Klein
 
Polymer, A Web Component Polyfill Library
Polymer, A Web Component Polyfill LibraryPolymer, A Web Component Polyfill Library
Polymer, A Web Component Polyfill Library
naohito maeda
 
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 RevolutionWebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
juanjosanchezpenas
 
The Many Ways to Build Modular JavaScript
The Many Ways to Build Modular JavaScriptThe Many Ways to Build Modular JavaScript
The Many Ways to Build Modular JavaScriptTim Perry
 
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Igalia
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
Bhagwat Kumar
 

What's hot (20)

Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
 
Building Rich Internet Applications Using Google Web Toolkit
Building Rich Internet Applications Using  Google Web ToolkitBuilding Rich Internet Applications Using  Google Web Toolkit
Building Rich Internet Applications Using Google Web Toolkit
 
Gwt.Create Keynote San Francisco
Gwt.Create Keynote San FranciscoGwt.Create Keynote San Francisco
Gwt.Create Keynote San Francisco
 
GWT Introduction and Overview - SV Code Camp 09
GWT Introduction and Overview - SV Code Camp 09GWT Introduction and Overview - SV Code Camp 09
GWT Introduction and Overview - SV Code Camp 09
 
Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm package
 
Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)
 
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
 
WebKitGtk+ Project
WebKitGtk+ ProjectWebKitGtk+ Project
WebKitGtk+ Project
 
Turducken - Divide and Conquer large GWT apps with multiple teams
Turducken - Divide and Conquer large GWT apps with multiple teamsTurducken - Divide and Conquer large GWT apps with multiple teams
Turducken - Divide and Conquer large GWT apps with multiple teams
 
Dgeni documentation generator
Dgeni   documentation generatorDgeni   documentation generator
Dgeni documentation generator
 
WPE WebKit for Android
WPE WebKit for AndroidWPE WebKit for Android
WPE WebKit for Android
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
Javascript Module Patterns
Javascript Module PatternsJavascript Module Patterns
Javascript Module Patterns
 
Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)
 
Groovy for Java Devs
Groovy for Java DevsGroovy for Java Devs
Groovy for Java Devs
 
Polymer, A Web Component Polyfill Library
Polymer, A Web Component Polyfill LibraryPolymer, A Web Component Polyfill Library
Polymer, A Web Component Polyfill Library
 
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 RevolutionWebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
 
The Many Ways to Build Modular JavaScript
The Many Ways to Build Modular JavaScriptThe Many Ways to Build Modular JavaScript
The Many Ways to Build Modular JavaScript
 
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 

Viewers also liked

GWTcon 2015 - brad, Brand and Brands
GWTcon 2015 - brad, Brand and BrandsGWTcon 2015 - brad, Brand and Brands
GWTcon 2015 - brad, Brand and Brands
Arcbees
 
Web Components: Rethinking Web App Development
Web Components: Rethinking Web App DevelopmentWeb Components: Rethinking Web App Development
Web Components: Rethinking Web App Development
Lukáš Fryč
 
GWTcon 2015 - Best development practices for GWT web applications
GWTcon 2015 - Best development practices for GWT web applications GWTcon 2015 - Best development practices for GWT web applications
GWTcon 2015 - Best development practices for GWT web applications
Arcbees
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
Marcus Hellberg
 
MAppMechanic CodeLabs - PolymerJS Introduction
MAppMechanic CodeLabs - PolymerJS IntroductionMAppMechanic CodeLabs - PolymerJS Introduction
MAppMechanic CodeLabs - PolymerJS Introduction
Rahat Khanna a.k.a mAppMechanic
 
MAppMechanic CodeLabs - PolymerJS Advanced Topics for Custom Elements
MAppMechanic CodeLabs - PolymerJS Advanced Topics for Custom ElementsMAppMechanic CodeLabs - PolymerJS Advanced Topics for Custom Elements
MAppMechanic CodeLabs - PolymerJS Advanced Topics for Custom Elements
Rahat Khanna a.k.a mAppMechanic
 
Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...
Marios Fakiolas
 
GWTcon 2015 - Beyond GWT 3.0 Panic
GWTcon 2015 - Beyond GWT 3.0 PanicGWTcon 2015 - Beyond GWT 3.0 Panic
GWTcon 2015 - Beyond GWT 3.0 Panic
Cristiano Costantini
 
New World of Angular (v2+)
New World of Angular (v2+)New World of Angular (v2+)
New World of Angular (v2+)
Rahat Khanna a.k.a mAppMechanic
 
PolymerJS 開發實戰
PolymerJS 開發實戰PolymerJS 開發實戰
PolymerJS 開發實戰
益祥 許
 
MAppMechanic CodeLabs - PolymerJS Custom Elements
MAppMechanic CodeLabs - PolymerJS Custom ElementsMAppMechanic CodeLabs - PolymerJS Custom Elements
MAppMechanic CodeLabs - PolymerJS Custom Elements
Rahat Khanna a.k.a mAppMechanic
 

Viewers also liked (11)

GWTcon 2015 - brad, Brand and Brands
GWTcon 2015 - brad, Brand and BrandsGWTcon 2015 - brad, Brand and Brands
GWTcon 2015 - brad, Brand and Brands
 
Web Components: Rethinking Web App Development
Web Components: Rethinking Web App DevelopmentWeb Components: Rethinking Web App Development
Web Components: Rethinking Web App Development
 
GWTcon 2015 - Best development practices for GWT web applications
GWTcon 2015 - Best development practices for GWT web applications GWTcon 2015 - Best development practices for GWT web applications
GWTcon 2015 - Best development practices for GWT web applications
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 
MAppMechanic CodeLabs - PolymerJS Introduction
MAppMechanic CodeLabs - PolymerJS IntroductionMAppMechanic CodeLabs - PolymerJS Introduction
MAppMechanic CodeLabs - PolymerJS Introduction
 
MAppMechanic CodeLabs - PolymerJS Advanced Topics for Custom Elements
MAppMechanic CodeLabs - PolymerJS Advanced Topics for Custom ElementsMAppMechanic CodeLabs - PolymerJS Advanced Topics for Custom Elements
MAppMechanic CodeLabs - PolymerJS Advanced Topics for Custom Elements
 
Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...
 
GWTcon 2015 - Beyond GWT 3.0 Panic
GWTcon 2015 - Beyond GWT 3.0 PanicGWTcon 2015 - Beyond GWT 3.0 Panic
GWTcon 2015 - Beyond GWT 3.0 Panic
 
New World of Angular (v2+)
New World of Angular (v2+)New World of Angular (v2+)
New World of Angular (v2+)
 
PolymerJS 開發實戰
PolymerJS 開發實戰PolymerJS 開發實戰
PolymerJS 開發實戰
 
MAppMechanic CodeLabs - PolymerJS Custom Elements
MAppMechanic CodeLabs - PolymerJS Custom ElementsMAppMechanic CodeLabs - PolymerJS Custom Elements
MAppMechanic CodeLabs - PolymerJS Custom Elements
 

Similar to Intro to Web Components, Polymer & Vaadin Elements

Web Components and PWA
Web Components and PWAWeb Components and PWA
Web Components and PWA
Manuel Carrasco Moñino
 
Meteor - Codemotion Rome 2015
Meteor - Codemotion Rome 2015Meteor - Codemotion Rome 2015
Meteor - Codemotion Rome 2015Codemotion
 
Meteor + Polymer
Meteor + PolymerMeteor + Polymer
Meteor + Polymer
wolf4ood
 
Workshop: Introduction to Web Components & Polymer
Workshop: Introduction to Web Components & Polymer Workshop: Introduction to Web Components & Polymer
Workshop: Introduction to Web Components & Polymer
John Riviello
 
IRJET- Polymer Javascript
IRJET- Polymer JavascriptIRJET- Polymer Javascript
IRJET- Polymer Javascript
IRJET Journal
 
Polymer 101
Polymer 101Polymer 101
Custom Elements with Polymer Web Components #econfpsu16
Custom Elements with Polymer Web Components #econfpsu16Custom Elements with Polymer Web Components #econfpsu16
Custom Elements with Polymer Web Components #econfpsu16
John Riviello
 
Web components Introduction
Web components IntroductionWeb components Introduction
Web components Introduction
Eugenio Romano
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
Jonas Bandi
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!
_Dewy_
 
Web Components
Web ComponentsWeb Components
Web Components
FITC
 
Introduction to Web Components & Polymer Workshop - JS Interactive
Introduction to Web Components & Polymer Workshop - JS InteractiveIntroduction to Web Components & Polymer Workshop - JS Interactive
Introduction to Web Components & Polymer Workshop - JS Interactive
John Riviello
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
Mathew Beane
 
Introduction to Web Components & Polymer Workshop - U of I WebCon
Introduction to Web Components & Polymer Workshop - U of I WebConIntroduction to Web Components & Polymer Workshop - U of I WebCon
Introduction to Web Components & Polymer Workshop - U of I WebCon
John Riviello
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
Jonas Bandi
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
Lennart Schoors
 
Lecture 11 - Web components
Lecture 11 - Web componentsLecture 11 - Web components
Lecture 11 - Web components
Bryan Ollendyke
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
Marcus Hellberg
 
Angular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHEREAngular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHERE
Nadav Mary
 

Similar to Intro to Web Components, Polymer & Vaadin Elements (20)

Web Components and PWA
Web Components and PWAWeb Components and PWA
Web Components and PWA
 
Meteor - Codemotion Rome 2015
Meteor - Codemotion Rome 2015Meteor - Codemotion Rome 2015
Meteor - Codemotion Rome 2015
 
Meteor + Polymer
Meteor + PolymerMeteor + Polymer
Meteor + Polymer
 
Workshop: Introduction to Web Components & Polymer
Workshop: Introduction to Web Components & Polymer Workshop: Introduction to Web Components & Polymer
Workshop: Introduction to Web Components & Polymer
 
IRJET- Polymer Javascript
IRJET- Polymer JavascriptIRJET- Polymer Javascript
IRJET- Polymer Javascript
 
Polymer 101
Polymer 101Polymer 101
Polymer 101
 
Custom Elements with Polymer Web Components #econfpsu16
Custom Elements with Polymer Web Components #econfpsu16Custom Elements with Polymer Web Components #econfpsu16
Custom Elements with Polymer Web Components #econfpsu16
 
Web components Introduction
Web components IntroductionWeb components Introduction
Web components Introduction
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!
 
Web Components
Web ComponentsWeb Components
Web Components
 
Introduction to Web Components & Polymer Workshop - JS Interactive
Introduction to Web Components & Polymer Workshop - JS InteractiveIntroduction to Web Components & Polymer Workshop - JS Interactive
Introduction to Web Components & Polymer Workshop - JS Interactive
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
 
Introduction to Web Components & Polymer Workshop - U of I WebCon
Introduction to Web Components & Polymer Workshop - U of I WebConIntroduction to Web Components & Polymer Workshop - U of I WebCon
Introduction to Web Components & Polymer Workshop - U of I WebCon
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
 
Polymer Web Framework - Swecha Boot Camp
Polymer Web Framework - Swecha Boot CampPolymer Web Framework - Swecha Boot Camp
Polymer Web Framework - Swecha Boot Camp
 
Lecture 11 - Web components
Lecture 11 - Web componentsLecture 11 - Web components
Lecture 11 - Web components
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 
Angular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHEREAngular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHERE
 

More from Manuel Carrasco Moñino

The Java alternative to Javascript
The Java alternative to JavascriptThe Java alternative to Javascript
The Java alternative to Javascript
Manuel Carrasco Moñino
 
GWT and PWA
GWT and PWAGWT and PWA
Present and Future of GWT from a developer perspective
Present and Future of GWT from a developer perspectivePresent and Future of GWT from a developer perspective
Present and Future of GWT from a developer perspective
Manuel Carrasco Moñino
 
GWT Contributor Workshop
GWT Contributor WorkshopGWT Contributor Workshop
GWT Contributor Workshop
Manuel Carrasco Moñino
 
CRUD with Polymer 2.0
CRUD with Polymer 2.0CRUD with Polymer 2.0
CRUD with Polymer 2.0
Manuel Carrasco Moñino
 
Building Components for Business Apps
Building Components for Business AppsBuilding Components for Business Apps
Building Components for Business Apps
Manuel Carrasco Moñino
 
Vaadin codemotion 2014
Vaadin codemotion 2014Vaadin codemotion 2014
Vaadin codemotion 2014
Manuel Carrasco Moñino
 
GwtQuery the perfect companion for GWT, GWT.create 2013
GwtQuery the perfect companion for GWT,  GWT.create 2013GwtQuery the perfect companion for GWT,  GWT.create 2013
GwtQuery the perfect companion for GWT, GWT.create 2013
Manuel Carrasco Moñino
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
Manuel Carrasco Moñino
 
Aprendiendo GWT
Aprendiendo GWTAprendiendo GWT
Aprendiendo GWT
Manuel Carrasco Moñino
 
Apache James/Hupa & GWT
Apache James/Hupa & GWTApache James/Hupa & GWT
Apache James/Hupa & GWT
Manuel Carrasco Moñino
 
GWT: Why GWT, GQuery, and RequestFactory
GWT: Why GWT, GQuery, and RequestFactoryGWT: Why GWT, GQuery, and RequestFactory
GWT: Why GWT, GQuery, and RequestFactory
Manuel Carrasco Moñino
 
Gwt IV -mvp
Gwt IV -mvpGwt IV -mvp
Gwt III - Avanzado
Gwt III - AvanzadoGwt III - Avanzado
Gwt III - Avanzado
Manuel Carrasco Moñino
 
Gwt II - trabajando con gwt
Gwt II - trabajando con gwtGwt II - trabajando con gwt
Gwt II - trabajando con gwt
Manuel Carrasco Moñino
 
Gwt I - entendiendo gwt
Gwt I - entendiendo gwtGwt I - entendiendo gwt
Gwt I - entendiendo gwt
Manuel Carrasco Moñino
 
Gwt seminario java_hispano_manolocarrasco
Gwt seminario java_hispano_manolocarrascoGwt seminario java_hispano_manolocarrasco
Gwt seminario java_hispano_manolocarrascoManuel Carrasco Moñino
 

More from Manuel Carrasco Moñino (19)

The Java alternative to Javascript
The Java alternative to JavascriptThe Java alternative to Javascript
The Java alternative to Javascript
 
GWT and PWA
GWT and PWAGWT and PWA
GWT and PWA
 
Present and Future of GWT from a developer perspective
Present and Future of GWT from a developer perspectivePresent and Future of GWT from a developer perspective
Present and Future of GWT from a developer perspective
 
GWT Contributor Workshop
GWT Contributor WorkshopGWT Contributor Workshop
GWT Contributor Workshop
 
CRUD with Polymer 2.0
CRUD with Polymer 2.0CRUD with Polymer 2.0
CRUD with Polymer 2.0
 
Building Components for Business Apps
Building Components for Business AppsBuilding Components for Business Apps
Building Components for Business Apps
 
Vaadin codemotion 2014
Vaadin codemotion 2014Vaadin codemotion 2014
Vaadin codemotion 2014
 
GwtQuery the perfect companion for GWT, GWT.create 2013
GwtQuery the perfect companion for GWT,  GWT.create 2013GwtQuery the perfect companion for GWT,  GWT.create 2013
GwtQuery the perfect companion for GWT, GWT.create 2013
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
 
Aprendiendo GWT
Aprendiendo GWTAprendiendo GWT
Aprendiendo GWT
 
Apache James/Hupa & GWT
Apache James/Hupa & GWTApache James/Hupa & GWT
Apache James/Hupa & GWT
 
GWT: Why GWT, GQuery, and RequestFactory
GWT: Why GWT, GQuery, and RequestFactoryGWT: Why GWT, GQuery, and RequestFactory
GWT: Why GWT, GQuery, and RequestFactory
 
Mod security
Mod securityMod security
Mod security
 
Gwt IV -mvp
Gwt IV -mvpGwt IV -mvp
Gwt IV -mvp
 
Gwt III - Avanzado
Gwt III - AvanzadoGwt III - Avanzado
Gwt III - Avanzado
 
Gwt II - trabajando con gwt
Gwt II - trabajando con gwtGwt II - trabajando con gwt
Gwt II - trabajando con gwt
 
Gwt I - entendiendo gwt
Gwt I - entendiendo gwtGwt I - entendiendo gwt
Gwt I - entendiendo gwt
 
Seguridad en redes de computadores
Seguridad en redes de computadoresSeguridad en redes de computadores
Seguridad en redes de computadores
 
Gwt seminario java_hispano_manolocarrasco
Gwt seminario java_hispano_manolocarrascoGwt seminario java_hispano_manolocarrasco
Gwt seminario java_hispano_manolocarrasco
 

Recently uploaded

Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 

Recently uploaded (20)

Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 

Intro to Web Components, Polymer & Vaadin Elements

  • 1. Intro to Web Components, Polymer & Vaadin Elements Manuel Carrasco Moñino Senior GWT Expert at Vaadin
  • 2. 1. Motivations 2. What are web components. 3. What’s polymer. 4. Introducing Polymer-Elements & Vaadin-Elements 5. Demo: full-stack app using Polymer 6. Progresive apps Agenda
  • 4. Motivations Former Ui Development - Verbose code - Difficult to share - No mobile in mind Web Components - Standard specs. - Prod. ready collections - Active Development - Google - Vaadin
  • 5. What are Web Components? 1. It’s a new TAG for your browser ‘<my-ui- component>’ 2. Based on standard specifications. 3. Advantages: a. Goodbye to browser plugins (WC + HTML5) b. Isolated from other elemens in DOM c. Easy to share (bower) d. Easy to integrate
  • 6. Problem -> DOM unique tree body { background-color: white; }
  • 7. Solution -> Shadow/Shady DOM body { background-color: white; }
  • 16. Polymer - Polymer is a library that allows us to use Web Components, even though some APIs for are missing in some browsers. - Polymer makes easier and faster create anything from a button to a complete application across desktop, mobile, and beyond. - Polymer platform enables sharing UI components between developers. - JS: estable API - polyfills: lightweight shim for Web Components. - Documentation system - Production ready components
  • 17. Polymer Elements A catalog of ready to use elements built with polymer: - Iron Elements (layout, ajax, icons …) - Paper Elements (Material Design) - Neon Elements (Animations) - Gold Elements (Ecomerce) - Platinum Elements (offline, push …) - Google Elements (google apis) - Vaadin Core Elements (enterprise components) - Vaadin Chart Elements (charts) - And much more ...
  • 18. 1. It’s NOT a framework but a small library a. polymer-micro.html (16K - 7K) b. polymer-mini.html (54K - 11K) c. polymer.html (122K - 29K) 2. Polymer Elements are not part of the library, but developed by the team and contributions. 3. Neither the optional Polyfill is part of it. a. webcomponents-lite.min.js (40K - 12K) b. webcomponents.min.js (118K - 33K) Polymer is the library
  • 19. 1. HTML is the Component Model 2. … and a powerful Declarative Language 3. Data flow is handled with a. attributes <input value=”foo”> b. properties myInput.value = “foo” c. events myInput.addEventListener(‘foo’, bar) 4. Web Components is for missing HTML pieces. 5. Polymer facilitates creating and manipulating them. DOM is the framework
  • 20. 1. Composition 2. Encapsulation 3. Mediator pattern An object that encapsulates how a set of objects interact Build Apps with elements
  • 22. Polymer: data-binding <!-- Create an element by composition --> <dom-module id="input-echo"> <template> <!-- Bidirectional data binding --> <paper-input label="Type your name" value="{{name}}"></paper-input> <!-- One way data binding with function execution --> <div>Your name is: [[_format(name)]]</div> <!-- Native elements do not have two-way binding support built in, use Polymer's event-observer syntax instead --> <label>Type your name: </label> <input type="text" value="{{name::keyup}}"> </template> </dom-module> <!-- Register the element --> <script> Polymer({ is: "input-echo", _format: function(name) { return name.toUpperCase(); } }); </script>
  • 23. <input-echo value="Manolo"> Polymer: bound directions <input-echo value="{{name}}"> <div>Your name is: [[_format (name)]]</div> <paper-input value="{{name}}"> <input value="{{name::keyup}}">
  • 24. Polymer: events, observers, notifiers<dom-module id="input-echo"> <template> ... <div on-tap="_onTap">Your name is: [[_format(name)]]</div> ... </template> </dom-module> <script> Polymer({ is: "input-echo", ... properties: { foo: { type: Object, notify: true, reflectToAttribute: true, value: {} } }, observers: [ '_onChange(foo.*)' ], _onTap: function(e) { this.set('foo.bar', this.name); }, _onChange: function(path, object) { this.fire('foo-changed-event', this.foo); } }); </script>
  • 25. let’s build a Progressive Full-stack Application
  • 26. Architecture Elements Polymer PouchDB CouchDB - Responsive - Material Design - Online/Offline - Real Time
  • 27. Components - PolymerElements & VaadinCoreElements - Polymer platform - CouchDB is a database that completely embraces the web. - Store your data with JSON documents - Access your data via HTTP - Serve pages directly - PouchDB is database inspired by Apache CouchDB that is designed to run well within the browser.
  • 28. - atom: just another text editor. It’s built on top of Chrome by github. - node.js: a JS runtime based on V8 the Chrome JS engine - npm: the node package manager - gulp: a make like for javascript projects - bower: a dependency manager for web projects - git: npm and bower packages and stored in git repos. Usual Tools for Polymer
  • 29. Demo Checkout the Code (each commit is one step) http://manolo.github.io/polymer-robots Run the live App https://github.com/manolo/polymer-robots Tip: open it in Chrome-Android and from the menu select ‘Add to the home Screen’
  • 32. - A web application that has a responsive layout, works offline and can be installed on the home screen of a device. - It is different from a ‘classic hybrid app’, which is an HTML5 application contained in a native wrapper installed from an app store. - Polymer is perfect for modularize and hidde stuff inside web components (web-workers, localstorage, database access, offline cache …) - Try to Progressive Apps
  • 33. Progressive Apps 1. Responsive: to fit any form factor 2. Connectivity independent: Progressively-enhanced to let them work offline 3. Fresh: Transparently always up-to-date 4. Discoverable: Are identifiable as “applications” thanks to W3C Manifests 5. Installable: to the home screen through browser- provided prompts 6. Linkable: zero-install, and easy to share.
  • 34. Additional tools api-generator: It’s a code generator to produce GWT wrappers & Vaadin Connectors, for JS components. a. Scrapes source documentation b. Right now polymer, but considering other sources. c. Uses standard JS libraries to parse components. - node.js, npm, bower, gulp - hydrolysis parser + lodash.template JsInterop: GWT Export java code and use JS without boiler-plate.