SlideShare a Scribd company logo
1 of 16
Download to read offline
Polymer 
Jakub Škvára 
@skvaros 
Dev Fest Kraków 2014
What is polymer 
Polymer is a new type of library for 
the web, built on top of Web 
Components, and designed to 
leverage the evolving web platform 
on modern browsers.
Web Components 
● Custom elements: <my-element></my-element> 
● Shadow dom: (better <iframe>) 
● HTML Imports: <link rel="import" href="my-element. 
html"> 
● Templates: <template></template> 
Polymer: 
● Data binding: <div>{{model}}</div>
Compatibility 
● Chrome 36+ 
● Polyfils
Examples 
● https://www.polymer-project.org/ 
● http://www.chromestatus.com/features 
● https://www.polymer-project.org/apps/topeka/ 
● https://www.polymer-project.org/components/paper-calculator/demo.html 
● http://todomvc.com/architecture-examples/polymer/ 
● http://googlewebcomponents.github.io/ 
● http://customelements.io/ 
● http://html5-demos.appspot.com/ 
● http://builtwithpolymer.org/ 
● http://devfest.gdgbeijing.org/ 
● http://zenorocha.github.io/voice-elements/ 
● http://www.gdgdc.com/ 
● http://ebidel.github.io/material-playground/
Why you should be excited 
Developer productivity 
● DOM + JS + CSS → no new APIs to learn! 
● say what you mean → readability 
Re-usability 
● don't reinvent the wheel 
● easy interop with other frameworks 
● CSS isolation 
Good software engineering paradigms on web (OOP)
Import Custom Element 
<!-- Polyfill Web Components support for older browsers --> 
<script src="components/platform/platform.js"></script> 
<!-- Import element --> 
<link rel="import" href="google-map.html"> 
<!-- Use element --> 
<google-map lat="37.790" long="-122.390"></google-map>
Create Custom Element 
<polymer-element name="my-counter" attributes="counter"> 
<template> 
<style> /*...*/ </style> 
Value: <span>{{counter}}</span><br> 
<button on-tap="{{increment}}">Increment</button> 
</template> 
<script src=”my-counter.dart” type=”application/dart”> 
</script> 
</polymer-element>
Custom element dart code 
import 'package:polymer/polymer.dart' ; 
import 'dart:html' ; 
@CustomTag('my-counter' ) 
class MyCounter extends PolymerElement { 
@observable int counter = 0; 
MyCounter. created() : super. created(); 
void increment(Event e, var detail, Node target) { 
counter += 1; 
} 
}
Custom attributes 
<my-volume volume="11"></my-volume> 
@CustomTag('my-volume') 
class MyVolume extends PolymerElement { 
@published int volume = 0; 
MyVolume.created() : super.created(); 
}
Templates 
<template> 
<template if="{{count <= 0}}"> 
<p>Click the button. It is fun!</p> 
</template> 
<template repeat="{{fruit in fruits}}"> 
<li>I like {{ fruit }}.</li> 
</template> 
</template>
Extending DOM elements 
<button is="fancy-button" >Click me</button> 
import 'package:polymer/polymer.dart' ; 
import 'dart:html' show ButtonElement ; 
@CustomTag( 'fancy-button' ) 
class FancyButton extends ButtonElement with Polymer, Observable { 
FancyButton. created() : super. created() { 
polymerCreated(); 
} 
}
Useful information 
● https://www.dartlang.org/polymer/ 
● https://github.com/dart-lang/polymer-dart-patterns 
● https://www.polymer-project.org/ 
● https://www.polymer-project. 
org/docs/polymer/debugging.html
github.com/jskvara/dart-polymer-code-lab-krakow/

More Related Content

What's hot

How to build a web application with Polymer
How to build a web application with PolymerHow to build a web application with Polymer
How to build a web application with PolymerSami Suo-Heikki
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web ComponentsFu Cheng
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Springsdeeg
 
Polymer - Welcome to the Future @ PyGrunn 08/07/2014
Polymer - Welcome to the Future @ PyGrunn 08/07/2014Polymer - Welcome to the Future @ PyGrunn 08/07/2014
Polymer - Welcome to the Future @ PyGrunn 08/07/2014Spyros Ioakeimidis
 
jQuery Mobile Workshop
jQuery Mobile WorkshopjQuery Mobile Workshop
jQuery Mobile WorkshopRon Reiter
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkImam Raza
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSmurtazahaveliwala
 
Polymer - Lego for the web!
Polymer - Lego for the web!Polymer - Lego for the web!
Polymer - Lego for the web!Codemotion
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5Ron Reiter
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introductionLuigi De Russis
 
Web Components
Web ComponentsWeb Components
Web ComponentsFITC
 
Web Components Everywhere
Web Components EverywhereWeb Components Everywhere
Web Components EverywhereIlia Idakiev
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSAldo Pizzagalli
 
Web Components: The future of Web Application Development
Web Components: The future of Web Application DevelopmentWeb Components: The future of Web Application Development
Web Components: The future of Web Application DevelopmentJermaine Oppong
 

What's hot (20)

Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 
Google Polymer Framework
Google Polymer FrameworkGoogle Polymer Framework
Google Polymer Framework
 
How to build a web application with Polymer
How to build a web application with PolymerHow to build a web application with Polymer
How to build a web application with Polymer
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Spring
 
Polymer - Welcome to the Future @ PyGrunn 08/07/2014
Polymer - Welcome to the Future @ PyGrunn 08/07/2014Polymer - Welcome to the Future @ PyGrunn 08/07/2014
Polymer - Welcome to the Future @ PyGrunn 08/07/2014
 
jQuery Mobile Workshop
jQuery Mobile WorkshopjQuery Mobile Workshop
jQuery Mobile Workshop
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talk
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 
Polymer - Lego for the web!
Polymer - Lego for the web!Polymer - Lego for the web!
Polymer - Lego for the web!
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
Web Components
Web ComponentsWeb Components
Web Components
 
Web Components Everywhere
Web Components EverywhereWeb Components Everywhere
Web Components Everywhere
 
Mini-Training: AngularJS
Mini-Training: AngularJSMini-Training: AngularJS
Mini-Training: AngularJS
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Web Components: The future of Web Application Development
Web Components: The future of Web Application DevelopmentWeb Components: The future of Web Application Development
Web Components: The future of Web Application Development
 

Viewers also liked (13)

The FIPPP at FIRST
The FIPPP at FIRSTThe FIPPP at FIRST
The FIPPP at FIRST
 
Etp presentation 9718856431
Etp presentation      9718856431Etp presentation      9718856431
Etp presentation 9718856431
 
Biochemical etp
Biochemical etpBiochemical etp
Biochemical etp
 
EFFLUENT TREATMENT PLANT
EFFLUENT TREATMENT PLANT EFFLUENT TREATMENT PLANT
EFFLUENT TREATMENT PLANT
 
ETP- Effluent Treatment Plant
ETP- Effluent Treatment PlantETP- Effluent Treatment Plant
ETP- Effluent Treatment Plant
 
Indian Paper Industry
Indian Paper IndustryIndian Paper Industry
Indian Paper Industry
 
Effluent Treatment Plant(ETP)
Effluent Treatment Plant(ETP)Effluent Treatment Plant(ETP)
Effluent Treatment Plant(ETP)
 
ETP Presentation by Siddarth Ananthagiri
ETP Presentation by Siddarth AnanthagiriETP Presentation by Siddarth Ananthagiri
ETP Presentation by Siddarth Ananthagiri
 
Effluent Treatment Plant Design, Operation And Analysis Of Waste Water
Effluent Treatment Plant Design, Operation And Analysis Of Waste Water Effluent Treatment Plant Design, Operation And Analysis Of Waste Water
Effluent Treatment Plant Design, Operation And Analysis Of Waste Water
 
Polymer
PolymerPolymer
Polymer
 
Polymer
PolymerPolymer
Polymer
 
ETP
ETPETP
ETP
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 

Similar to Polymer Code Lab in Dart - DevFest Kraków 2014

Александр Кашеверов - Polymer
Александр Кашеверов - PolymerАлександр Кашеверов - Polymer
Александр Кашеверов - PolymerDataArt
 
Polytechnic 1.0 Granada
Polytechnic 1.0 GranadaPolytechnic 1.0 Granada
Polytechnic 1.0 GranadaIsrael Blancas
 
The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014Tommie Gannert
 
Polymer - Una bella historia de amor
Polymer - Una bella historia de amorPolymer - Una bella historia de amor
Polymer - Una bella historia de amorIsrael Blancas
 
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...Codemotion
 
Web components - An Introduction
Web components - An IntroductionWeb components - An Introduction
Web components - An Introductioncherukumilli2
 
Desbravando Web Components
Desbravando Web ComponentsDesbravando Web Components
Desbravando Web ComponentsMateus Ortiz
 
Orchard Harvest 2014 - The Future of Widgets?
Orchard Harvest 2014 - The Future of Widgets?Orchard Harvest 2014 - The Future of Widgets?
Orchard Harvest 2014 - The Future of Widgets?Steve Taylor
 
Web Components and Modular CSS
Web Components and Modular CSSWeb Components and Modular CSS
Web Components and Modular CSSAndrew Rota
 
Why you should be using Web Components. And How - DevWeek 2015
Why you should be using Web Components. And How - DevWeek 2015Why you should be using Web Components. And How - DevWeek 2015
Why you should be using Web Components. And How - DevWeek 2015Phil Leggetter
 
Polymer - pleasant client-side programming with web components
Polymer - pleasant client-side programming with web componentsPolymer - pleasant client-side programming with web components
Polymer - pleasant client-side programming with web componentspsstoev
 
angular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxangular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxshekharmpatil1309
 
Web Components for Java Developers
Web Components for Java DevelopersWeb Components for Java Developers
Web Components for Java DevelopersJoonas Lehtinen
 
Introduction to web components
Introduction to web componentsIntroduction to web components
Introduction to web componentsMarc Bächinger
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the futureDA-14
 
Polymer - El fin a tus problemas con el FrontEnd
Polymer - El fin a tus problemas con el FrontEndPolymer - El fin a tus problemas con el FrontEnd
Polymer - El fin a tus problemas con el FrontEndIsrael Blancas
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
 

Similar to Polymer Code Lab in Dart - DevFest Kraków 2014 (20)

Александр Кашеверов - Polymer
Александр Кашеверов - PolymerАлександр Кашеверов - Polymer
Александр Кашеверов - Polymer
 
Polytechnic 1.0 Granada
Polytechnic 1.0 GranadaPolytechnic 1.0 Granada
Polytechnic 1.0 Granada
 
The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014
 
Polymer - Una bella historia de amor
Polymer - Una bella historia de amorPolymer - Una bella historia de amor
Polymer - Una bella historia de amor
 
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...
 
Web components - An Introduction
Web components - An IntroductionWeb components - An Introduction
Web components - An Introduction
 
Desbravando Web Components
Desbravando Web ComponentsDesbravando Web Components
Desbravando Web Components
 
Polymer
PolymerPolymer
Polymer
 
Orchard Harvest 2014 - The Future of Widgets?
Orchard Harvest 2014 - The Future of Widgets?Orchard Harvest 2014 - The Future of Widgets?
Orchard Harvest 2014 - The Future of Widgets?
 
Web Components and Modular CSS
Web Components and Modular CSSWeb Components and Modular CSS
Web Components and Modular CSS
 
Why you should be using Web Components. And How - DevWeek 2015
Why you should be using Web Components. And How - DevWeek 2015Why you should be using Web Components. And How - DevWeek 2015
Why you should be using Web Components. And How - DevWeek 2015
 
Web Components
Web ComponentsWeb Components
Web Components
 
Polymer - pleasant client-side programming with web components
Polymer - pleasant client-side programming with web componentsPolymer - pleasant client-side programming with web components
Polymer - pleasant client-side programming with web components
 
angular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxangular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptx
 
Web Components for Java Developers
Web Components for Java DevelopersWeb Components for Java Developers
Web Components for Java Developers
 
Polymer 1.0
Polymer 1.0Polymer 1.0
Polymer 1.0
 
Introduction to web components
Introduction to web componentsIntroduction to web components
Introduction to web components
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the future
 
Polymer - El fin a tus problemas con el FrontEnd
Polymer - El fin a tus problemas con el FrontEndPolymer - El fin a tus problemas con el FrontEnd
Polymer - El fin a tus problemas con el FrontEnd
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 

Recently uploaded

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 

Recently uploaded (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 

Polymer Code Lab in Dart - DevFest Kraków 2014

  • 1. Polymer Jakub Škvára @skvaros Dev Fest Kraków 2014
  • 2.
  • 3. What is polymer Polymer is a new type of library for the web, built on top of Web Components, and designed to leverage the evolving web platform on modern browsers.
  • 4. Web Components ● Custom elements: <my-element></my-element> ● Shadow dom: (better <iframe>) ● HTML Imports: <link rel="import" href="my-element. html"> ● Templates: <template></template> Polymer: ● Data binding: <div>{{model}}</div>
  • 5.
  • 6. Compatibility ● Chrome 36+ ● Polyfils
  • 7. Examples ● https://www.polymer-project.org/ ● http://www.chromestatus.com/features ● https://www.polymer-project.org/apps/topeka/ ● https://www.polymer-project.org/components/paper-calculator/demo.html ● http://todomvc.com/architecture-examples/polymer/ ● http://googlewebcomponents.github.io/ ● http://customelements.io/ ● http://html5-demos.appspot.com/ ● http://builtwithpolymer.org/ ● http://devfest.gdgbeijing.org/ ● http://zenorocha.github.io/voice-elements/ ● http://www.gdgdc.com/ ● http://ebidel.github.io/material-playground/
  • 8. Why you should be excited Developer productivity ● DOM + JS + CSS → no new APIs to learn! ● say what you mean → readability Re-usability ● don't reinvent the wheel ● easy interop with other frameworks ● CSS isolation Good software engineering paradigms on web (OOP)
  • 9. Import Custom Element <!-- Polyfill Web Components support for older browsers --> <script src="components/platform/platform.js"></script> <!-- Import element --> <link rel="import" href="google-map.html"> <!-- Use element --> <google-map lat="37.790" long="-122.390"></google-map>
  • 10. Create Custom Element <polymer-element name="my-counter" attributes="counter"> <template> <style> /*...*/ </style> Value: <span>{{counter}}</span><br> <button on-tap="{{increment}}">Increment</button> </template> <script src=”my-counter.dart” type=”application/dart”> </script> </polymer-element>
  • 11. Custom element dart code import 'package:polymer/polymer.dart' ; import 'dart:html' ; @CustomTag('my-counter' ) class MyCounter extends PolymerElement { @observable int counter = 0; MyCounter. created() : super. created(); void increment(Event e, var detail, Node target) { counter += 1; } }
  • 12. Custom attributes <my-volume volume="11"></my-volume> @CustomTag('my-volume') class MyVolume extends PolymerElement { @published int volume = 0; MyVolume.created() : super.created(); }
  • 13. Templates <template> <template if="{{count <= 0}}"> <p>Click the button. It is fun!</p> </template> <template repeat="{{fruit in fruits}}"> <li>I like {{ fruit }}.</li> </template> </template>
  • 14. Extending DOM elements <button is="fancy-button" >Click me</button> import 'package:polymer/polymer.dart' ; import 'dart:html' show ButtonElement ; @CustomTag( 'fancy-button' ) class FancyButton extends ButtonElement with Polymer, Observable { FancyButton. created() : super. created() { polymerCreated(); } }
  • 15. Useful information ● https://www.dartlang.org/polymer/ ● https://github.com/dart-lang/polymer-dart-patterns ● https://www.polymer-project.org/ ● https://www.polymer-project. org/docs/polymer/debugging.html