SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Workshop:
Introduction to Web Components & Polymer
Little Rock Tech Fest - October 5, 2017
John Riviello
@JohnRiv
Chris Lorenzo
@Chiefcll
Workshop materials are available at:
http://tinyurl.com/
lrtf-polymer
If you haven’t already, go there now :-)
WEB COMPONENTS
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer4
… a set of web platform APIs that allow
you to create new custom, reusable,
encapsulated HTML tags to use in web
pages and web apps...
Source: https://www.webcomponents.org/introduction
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer5
… [built] on the Web Component standards,
will work across modern browsers, and
can be used with any JavaScript library or
framework that works with HTML.
Source: https://www.webcomponents.org/introduction
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer6
4 Specs
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer7
Custom Elements
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer8
Custom Elements
•Provides a way for authors to build their own
fully-featured DOM elements.
- <xc-tab>Your Wifi</xc-tab>
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer9
HTML Imports
• Means to import custom elements
- <link rel="import" href="../xc-tab/xc-tab.html">
• Componetize the HTML, CSS & JavaScript
• Built-in deduplication
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer10
HTML Imports
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer11
Templates
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer12
• Used to declare fragments of HTML
- <template id="tab">
<div class="tab-content"></div>
</template>
• The element itself renders nothing
• Can be cloned and inserted in the document via
JavaScript, which will quickly render the content
Templates
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer13
Shadow DOM
What Are Web Components?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer14
•Allows you to take a DOM subtree and
hide it from the document scope
•Hides CSS styles as well
•Common examples from HTML5 include:
<select>, <video>, & <input type="date">
Shadow DOM
Can we even use
these things?
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer16
Source: https://www.webcomponents.org/
What’s
Google Polymer?
Google Polymer Project
A Bit of History
Declaration of Independence (1819), by John Trumbull is available in the US Public Domain. Color adjusted from original
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer23
Source: https://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0975.html
v0
v0
A Bit of History
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer24
v0.3
“Experimental”
v0.5
“Still Learning”
v0.8
“Beta”
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer26
Sources: https://developers.google.com/web/fundamentals/getting-started/primers/customelements
https://developers.google.com/web/fundamentals/getting-started/primers/shadowdom
Custom Elements v1
Shadow DOM v1
Polymer 2.0
• Uses the v1 specs
• ES6 class syntax to define a
Custom Element
• Introduced hybrid element syntax,
which works in Polymer 2.x & ^1.7
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer28
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer29
Polymer 3.0
(Early Access Preview)
Polymer 3.0
• ES Modules instead of HTML Imports
• Templates (HTML & CSS) move to JS
• Install components via NPM (with Yarn)
instead of Bower
Polymer 3.0
• Official release won’t be until Dec ’17
• At least 1 browser must natively
support dynamic imports:
import(`module.js`).then(module =>
{ module.doSomething(); })
• Tool will help with updating from 2 to 3
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer33
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer34
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer35
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer36
Polymer 2.0
https://www.polymer-project.org/2.0/
docs/devguide/feature-overview
Let’s code!
Codelab:
Build Google Maps using
Web Components & No Code!
tinyurl.com/lrtf-polymer-map
Codelab: Build Google Maps using Web Components & No Code!
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer40
Steps 3-5 - Relevant Map Data:
•latitude="34.7489045"
•longitude="-92.2711374"
•start-address="Statehouse Convention Center"
•end-address="Rock Town Distillery"
Step 5: item-icon becomes slot="item-icon"
Codelab: Build Google Maps using Web Components & No Code!
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer41
Step 6 - Polymer 2.x Hybrid dom-bind syntax:
<dom-bind>
<template is="dom-bind">...</template>
</dom-bind>
More info:
https://www.polymer-project.org/2.0/docs/upgrade
#convert-template-extension-elements-at-the-document-level
Codelab: Build Google Maps using Web Components & No Code!
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer42
Step 7 - Polymer 2.x Hybrid custom-style syntax:
<custom-style>
<style is="custom-style">...</style>
</custom-style>
More info:
https://www.polymer-project.org/2.0/docs/upgrade
#wrap-custom-style-elements
Codelab: Build Google Maps using Web Components & No Code!
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer43
BONUS Challanges!
1. Select “DRIVING” by default
- Hint: check out the Properties listed
www.webcomponents.org/element/PolymerElements/
paper-tabs/elements/paper-tabs
2. Improve the styles for the search box
Demo:
Little Rock Tech Fest Speaker Info
As A Web Component
<lrtf-speaker> </lrtf-speaker>
Codelab:
Build a Polymer 2.0 App From Scratch
tinyurl.com/lrtf-polymer-app
Codelab: Build a Polymer 2.0 App From Scratch!
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer46
Step 5 Notes:
1. No need to bower install throughout this Codelab
2. The 2nd time it has you preview the app, the flag WILL
appear because the SVG is already in your project
3. You can skip the “Set up data for the app” section
since the data is already in your project
Codelab: Build a Polymer 2.0 App From Scratch!
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer47
Step 7 Notes:
When you’re asked to look for this code:
<paper-button id="optionA">Brazil</paper-button>
<paper-button id="optionB">Uruguay</paper-button>
The code is actually:
<paper-button id="optionA" class="answer">Brazil</paper-button>
<paper-button id="optionB" class="answer">Uruguay</paper-button>
Codelab: Build a Polymer 2.0 App From Scratch!
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer48
BONUS Challenges!
1. Add some :focus styles
2. Fix the 404 for /data/svg/.svg
3. Have the “ANOTHER!” button NOT reload the page
4. Write Tests
5. Progressive Web App
For the answers, see the commits to https://github.com/ComcastSamples/polymer-whose-flag/commits/steps
Useful Links
•WebComponents.org - webcomponents.org
• Polymer Website - polymer-project.org
• Polymer Slack - polymer-slack.herokuapp.com
• PWAs with Polymer: a checklist - https://meowni.ca/posts/polymer-pwa-checklist/
• How to use Polymer with Webpack - http://robdodson.me/how-to-use-polymer-with-webpack/
• Polycasts on YouTube -
https://www.youtube.com/playlist?list=PLOU2XLYxmsII5c3Mgw6fNYCzaWrsM3sMN
- Top recommended Polycast to watch: Data Binding 101 -
https://youtu.be/1sx6YNn58OQ?list=PLOU2XLYxmsII5c3Mgw6fNYCzaWrsM3sMN
• 2017 Polymer Summit videos on YouTube -
https://www.youtube.com/playlist?list=PLNYkxOF6rcIDP0PqVaJxqNWwIgvoEPzJi
• 2017 Google I/O Polymer videos on YouTube -
https://www.youtube.com/playlist?list=PL_c6rbXV248du6m1VJABo32mP7sXWVb4m
•Web Components & Polymer - 2016 Chrome Dev Summit video - https://youtu.be/Ihdp63FaRKA
Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer49
Thank you!
John Riviello
@JohnRiv
Chris Lorenzo
@Chiefcll

Weitere ähnliche Inhalte

Was ist angesagt?

FuelPHP - a PHP HMVC Framework by silicongulf.com
FuelPHP - a PHP HMVC Framework by silicongulf.comFuelPHP - a PHP HMVC Framework by silicongulf.com
FuelPHP - a PHP HMVC Framework by silicongulf.comChristopher Cubos
 
Python in the browser
Python in the browserPython in the browser
Python in the browserPyCon Italia
 
FuelPHP presentation - PeoplePerHour workshop
FuelPHP presentation - PeoplePerHour workshopFuelPHP presentation - PeoplePerHour workshop
FuelPHP presentation - PeoplePerHour workshopFotis Alexandrou
 
Why Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your ClientsWhy Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your ClientsPantheon
 
plumbing for the next web
plumbing for the next webplumbing for the next web
plumbing for the next webIan Forrester
 
How NOT to build a pipeline
How NOT to build a pipelineHow NOT to build a pipeline
How NOT to build a pipelineJosh Hill
 
M is for modernization
M is for modernizationM is for modernization
M is for modernizationRed Pill Now
 
Desktop Apps with PHP and Titanium
Desktop Apps with PHP and TitaniumDesktop Apps with PHP and Titanium
Desktop Apps with PHP and TitaniumBen Ramsey
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type scriptGil Fink
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software EngineerSean Coates
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0Thomas Conté
 
Desktop Apps with PHP and Titanium (ZendCon 2010)
Desktop Apps with PHP and Titanium (ZendCon 2010)Desktop Apps with PHP and Titanium (ZendCon 2010)
Desktop Apps with PHP and Titanium (ZendCon 2010)Ben Ramsey
 
Continuous Integration Is for Teams: Moving past buzzword driven development
Continuous Integration Is for Teams: Moving past buzzword driven development Continuous Integration Is for Teams: Moving past buzzword driven development
Continuous Integration Is for Teams: Moving past buzzword driven development Pantheon
 

Was ist angesagt? (19)

FuelPHP - a PHP HMVC Framework by silicongulf.com
FuelPHP - a PHP HMVC Framework by silicongulf.comFuelPHP - a PHP HMVC Framework by silicongulf.com
FuelPHP - a PHP HMVC Framework by silicongulf.com
 
FuelPHP
FuelPHPFuelPHP
FuelPHP
 
Python in the browser
Python in the browserPython in the browser
Python in the browser
 
FuelPHP presentation - PeoplePerHour workshop
FuelPHP presentation - PeoplePerHour workshopFuelPHP presentation - PeoplePerHour workshop
FuelPHP presentation - PeoplePerHour workshop
 
HTML 5 Overview
HTML 5 OverviewHTML 5 Overview
HTML 5 Overview
 
Why Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your ClientsWhy Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your Clients
 
plumbing for the next web
plumbing for the next webplumbing for the next web
plumbing for the next web
 
How NOT to build a pipeline
How NOT to build a pipelineHow NOT to build a pipeline
How NOT to build a pipeline
 
Seven Reasons for Code Bloat
Seven Reasons for Code BloatSeven Reasons for Code Bloat
Seven Reasons for Code Bloat
 
M is for modernization
M is for modernizationM is for modernization
M is for modernization
 
Desktop Apps with PHP and Titanium
Desktop Apps with PHP and TitaniumDesktop Apps with PHP and Titanium
Desktop Apps with PHP and Titanium
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type script
 
Introduction to polymer project
Introduction to polymer projectIntroduction to polymer project
Introduction to polymer project
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
MyReplayInZen
MyReplayInZenMyReplayInZen
MyReplayInZen
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
Desktop Apps with PHP and Titanium (ZendCon 2010)
Desktop Apps with PHP and Titanium (ZendCon 2010)Desktop Apps with PHP and Titanium (ZendCon 2010)
Desktop Apps with PHP and Titanium (ZendCon 2010)
 
Continuous Integration Is for Teams: Moving past buzzword driven development
Continuous Integration Is for Teams: Moving past buzzword driven development Continuous Integration Is for Teams: Moving past buzzword driven development
Continuous Integration Is for Teams: Moving past buzzword driven development
 

Ähnlich wie Workshop: Introduction to Web Components & Polymer

Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereJohn Riviello
 
Intro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsIntro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsManuel Carrasco Moñino
 
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 #econfpsu16John Riviello
 
IRJET- Polymer Javascript
IRJET- Polymer JavascriptIRJET- Polymer Javascript
IRJET- Polymer JavascriptIRJET Journal
 
Web Components
Web ComponentsWeb Components
Web ComponentsFITC
 
Web components Introduction
Web components IntroductionWeb components Introduction
Web components IntroductionEugenio Romano
 
project_proposal_osrf
project_proposal_osrfproject_proposal_osrf
project_proposal_osrfom1234567890
 
Lecture 11 - Web components
Lecture 11 - Web componentsLecture 11 - Web components
Lecture 11 - Web componentsBryan Ollendyke
 
#1 - HTML5 Overview
#1 - HTML5 Overview#1 - HTML5 Overview
#1 - HTML5 Overviewiloveigloo
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraLINAGORA
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with CodeceptionJeremy Coates
 
Introduction to Polymer Project - DILo Surabaya
Introduction to Polymer Project - DILo SurabayaIntroduction to Polymer Project - DILo Surabaya
Introduction to Polymer Project - DILo SurabayaDILo Surabaya
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in DjangoLakshman Prasad
 
AstroLabs_Academy_Learning_to_Code-Coding_Bootcamp_Day1.pdf
AstroLabs_Academy_Learning_to_Code-Coding_Bootcamp_Day1.pdfAstroLabs_Academy_Learning_to_Code-Coding_Bootcamp_Day1.pdf
AstroLabs_Academy_Learning_to_Code-Coding_Bootcamp_Day1.pdfFarHanWasif1
 
10 Things Webdesigners tend to do Wrong in SEO - SMX 2014
10 Things Webdesigners tend to do Wrong in SEO  - SMX 201410 Things Webdesigners tend to do Wrong in SEO  - SMX 2014
10 Things Webdesigners tend to do Wrong in SEO - SMX 2014Timon Hartung
 
A peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentA peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentR-Cubed Design Forge
 

Ähnlich wie Workshop: Introduction to Web Components & Polymer (20)

Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is Here
 
Intro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsIntro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin Elements
 
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
 
IRJET- Polymer Javascript
IRJET- Polymer JavascriptIRJET- Polymer Javascript
IRJET- Polymer Javascript
 
Web Components
Web ComponentsWeb Components
Web Components
 
Web components Introduction
Web components IntroductionWeb components Introduction
Web components Introduction
 
project_proposal_osrf
project_proposal_osrfproject_proposal_osrf
project_proposal_osrf
 
Lecture 11 - Web components
Lecture 11 - Web componentsLecture 11 - Web components
Lecture 11 - Web components
 
#1 - HTML5 Overview
#1 - HTML5 Overview#1 - HTML5 Overview
#1 - HTML5 Overview
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
 
Swf search final
Swf search finalSwf search final
Swf search final
 
Introduction to Polymer Project - DILo Surabaya
Introduction to Polymer Project - DILo SurabayaIntroduction to Polymer Project - DILo Surabaya
Introduction to Polymer Project - DILo Surabaya
 
Polymer 101
Polymer 101Polymer 101
Polymer 101
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Web Components and PWA
Web Components and PWAWeb Components and PWA
Web Components and PWA
 
AstroLabs_Academy_Learning_to_Code-Coding_Bootcamp_Day1.pdf
AstroLabs_Academy_Learning_to_Code-Coding_Bootcamp_Day1.pdfAstroLabs_Academy_Learning_to_Code-Coding_Bootcamp_Day1.pdf
AstroLabs_Academy_Learning_to_Code-Coding_Bootcamp_Day1.pdf
 
10 Things Webdesigners tend to do Wrong in SEO - SMX 2014
10 Things Webdesigners tend to do Wrong in SEO  - SMX 201410 Things Webdesigners tend to do Wrong in SEO  - SMX 2014
10 Things Webdesigners tend to do Wrong in SEO - SMX 2014
 
A peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentA peek into the world of WordPress plugin development
A peek into the world of WordPress plugin development
 
Polymer
PolymerPolymer
Polymer
 

Mehr von John Riviello

The Decision Buy-In Algorithm
The Decision Buy-In AlgorithmThe Decision Buy-In Algorithm
The Decision Buy-In AlgorithmJohn Riviello
 
Future-Proofing Your JavaScript Framework Decision
Future-Proofing Your JavaScript Framework DecisionFuture-Proofing Your JavaScript Framework Decision
Future-Proofing Your JavaScript Framework DecisionJohn Riviello
 
The Critical Career Path Conversation
The Critical Career Path ConversationThe Critical Career Path Conversation
The Critical Career Path ConversationJohn Riviello
 
Ensuring Design Standards with Web Components
Ensuring Design Standards with Web ComponentsEnsuring Design Standards with Web Components
Ensuring Design Standards with Web ComponentsJohn Riviello
 
Polymer-Powered Design Systems - DevFest Florida
Polymer-Powered Design Systems - DevFest FloridaPolymer-Powered Design Systems - DevFest Florida
Polymer-Powered Design Systems - DevFest FloridaJohn Riviello
 
The Truth About Your Web App's Performance
The Truth About Your Web App's PerformanceThe Truth About Your Web App's Performance
The Truth About Your Web App's PerformanceJohn Riviello
 
The Truth About Your Web App's Performance
The Truth About Your Web App's PerformanceThe Truth About Your Web App's Performance
The Truth About Your Web App's PerformanceJohn Riviello
 

Mehr von John Riviello (7)

The Decision Buy-In Algorithm
The Decision Buy-In AlgorithmThe Decision Buy-In Algorithm
The Decision Buy-In Algorithm
 
Future-Proofing Your JavaScript Framework Decision
Future-Proofing Your JavaScript Framework DecisionFuture-Proofing Your JavaScript Framework Decision
Future-Proofing Your JavaScript Framework Decision
 
The Critical Career Path Conversation
The Critical Career Path ConversationThe Critical Career Path Conversation
The Critical Career Path Conversation
 
Ensuring Design Standards with Web Components
Ensuring Design Standards with Web ComponentsEnsuring Design Standards with Web Components
Ensuring Design Standards with Web Components
 
Polymer-Powered Design Systems - DevFest Florida
Polymer-Powered Design Systems - DevFest FloridaPolymer-Powered Design Systems - DevFest Florida
Polymer-Powered Design Systems - DevFest Florida
 
The Truth About Your Web App's Performance
The Truth About Your Web App's PerformanceThe Truth About Your Web App's Performance
The Truth About Your Web App's Performance
 
The Truth About Your Web App's Performance
The Truth About Your Web App's PerformanceThe Truth About Your Web App's Performance
The Truth About Your Web App's Performance
 

Kürzlich hochgeladen

Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsMonica Sydney
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftAanSulistiyo
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查ydyuyu
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptxAsmae Rabhi
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsMonica Sydney
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Roommeghakumariji156
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 

Kürzlich hochgeladen (20)

Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 

Workshop: Introduction to Web Components & Polymer

  • 1. Workshop: Introduction to Web Components & Polymer Little Rock Tech Fest - October 5, 2017 John Riviello @JohnRiv Chris Lorenzo @Chiefcll
  • 2. Workshop materials are available at: http://tinyurl.com/ lrtf-polymer If you haven’t already, go there now :-)
  • 4. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer4 … a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps... Source: https://www.webcomponents.org/introduction
  • 5. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer5 … [built] on the Web Component standards, will work across modern browsers, and can be used with any JavaScript library or framework that works with HTML. Source: https://www.webcomponents.org/introduction
  • 6. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer6 4 Specs
  • 7. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer7 Custom Elements
  • 8. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer8 Custom Elements •Provides a way for authors to build their own fully-featured DOM elements. - <xc-tab>Your Wifi</xc-tab>
  • 9. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer9 HTML Imports
  • 10. • Means to import custom elements - <link rel="import" href="../xc-tab/xc-tab.html"> • Componetize the HTML, CSS & JavaScript • Built-in deduplication What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer10 HTML Imports
  • 11. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer11 Templates
  • 12. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer12 • Used to declare fragments of HTML - <template id="tab"> <div class="tab-content"></div> </template> • The element itself renders nothing • Can be cloned and inserted in the document via JavaScript, which will quickly render the content Templates
  • 13. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer13 Shadow DOM
  • 14. What Are Web Components? Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer14 •Allows you to take a DOM subtree and hide it from the document scope •Hides CSS styles as well •Common examples from HTML5 include: <select>, <video>, & <input type="date"> Shadow DOM
  • 15. Can we even use these things?
  • 16. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer16 Source: https://www.webcomponents.org/
  • 19.
  • 20.
  • 21.
  • 22. A Bit of History Declaration of Independence (1819), by John Trumbull is available in the US Public Domain. Color adjusted from original
  • 23. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer23 Source: https://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0975.html v0 v0
  • 24. A Bit of History Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer24 v0.3 “Experimental” v0.5 “Still Learning” v0.8 “Beta”
  • 25.
  • 26. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer26 Sources: https://developers.google.com/web/fundamentals/getting-started/primers/customelements https://developers.google.com/web/fundamentals/getting-started/primers/shadowdom Custom Elements v1 Shadow DOM v1
  • 27. Polymer 2.0 • Uses the v1 specs • ES6 class syntax to define a Custom Element • Introduced hybrid element syntax, which works in Polymer 2.x & ^1.7
  • 28. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer28
  • 29. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer29
  • 31. Polymer 3.0 • ES Modules instead of HTML Imports • Templates (HTML & CSS) move to JS • Install components via NPM (with Yarn) instead of Bower
  • 32. Polymer 3.0 • Official release won’t be until Dec ’17 • At least 1 browser must natively support dynamic imports: import(`module.js`).then(module => { module.doSomething(); }) • Tool will help with updating from 2 to 3
  • 33. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer33
  • 34. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer34
  • 35. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer35
  • 36. Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer36
  • 39. Codelab: Build Google Maps using Web Components & No Code! tinyurl.com/lrtf-polymer-map
  • 40. Codelab: Build Google Maps using Web Components & No Code! Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer40 Steps 3-5 - Relevant Map Data: •latitude="34.7489045" •longitude="-92.2711374" •start-address="Statehouse Convention Center" •end-address="Rock Town Distillery" Step 5: item-icon becomes slot="item-icon"
  • 41. Codelab: Build Google Maps using Web Components & No Code! Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer41 Step 6 - Polymer 2.x Hybrid dom-bind syntax: <dom-bind> <template is="dom-bind">...</template> </dom-bind> More info: https://www.polymer-project.org/2.0/docs/upgrade #convert-template-extension-elements-at-the-document-level
  • 42. Codelab: Build Google Maps using Web Components & No Code! Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer42 Step 7 - Polymer 2.x Hybrid custom-style syntax: <custom-style> <style is="custom-style">...</style> </custom-style> More info: https://www.polymer-project.org/2.0/docs/upgrade #wrap-custom-style-elements
  • 43. Codelab: Build Google Maps using Web Components & No Code! Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer43 BONUS Challanges! 1. Select “DRIVING” by default - Hint: check out the Properties listed www.webcomponents.org/element/PolymerElements/ paper-tabs/elements/paper-tabs 2. Improve the styles for the search box
  • 44. Demo: Little Rock Tech Fest Speaker Info As A Web Component <lrtf-speaker> </lrtf-speaker>
  • 45. Codelab: Build a Polymer 2.0 App From Scratch tinyurl.com/lrtf-polymer-app
  • 46. Codelab: Build a Polymer 2.0 App From Scratch! Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer46 Step 5 Notes: 1. No need to bower install throughout this Codelab 2. The 2nd time it has you preview the app, the flag WILL appear because the SVG is already in your project 3. You can skip the “Set up data for the app” section since the data is already in your project
  • 47. Codelab: Build a Polymer 2.0 App From Scratch! Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer47 Step 7 Notes: When you’re asked to look for this code: <paper-button id="optionA">Brazil</paper-button> <paper-button id="optionB">Uruguay</paper-button> The code is actually: <paper-button id="optionA" class="answer">Brazil</paper-button> <paper-button id="optionB" class="answer">Uruguay</paper-button>
  • 48. Codelab: Build a Polymer 2.0 App From Scratch! Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer48 BONUS Challenges! 1. Add some :focus styles 2. Fix the 404 for /data/svg/.svg 3. Have the “ANOTHER!” button NOT reload the page 4. Write Tests 5. Progressive Web App For the answers, see the commits to https://github.com/ComcastSamples/polymer-whose-flag/commits/steps
  • 49. Useful Links •WebComponents.org - webcomponents.org • Polymer Website - polymer-project.org • Polymer Slack - polymer-slack.herokuapp.com • PWAs with Polymer: a checklist - https://meowni.ca/posts/polymer-pwa-checklist/ • How to use Polymer with Webpack - http://robdodson.me/how-to-use-polymer-with-webpack/ • Polycasts on YouTube - https://www.youtube.com/playlist?list=PLOU2XLYxmsII5c3Mgw6fNYCzaWrsM3sMN - Top recommended Polycast to watch: Data Binding 101 - https://youtu.be/1sx6YNn58OQ?list=PLOU2XLYxmsII5c3Mgw6fNYCzaWrsM3sMN • 2017 Polymer Summit videos on YouTube - https://www.youtube.com/playlist?list=PLNYkxOF6rcIDP0PqVaJxqNWwIgvoEPzJi • 2017 Google I/O Polymer videos on YouTube - https://www.youtube.com/playlist?list=PL_c6rbXV248du6m1VJABo32mP7sXWVb4m •Web Components & Polymer - 2016 Chrome Dev Summit video - https://youtu.be/Ihdp63FaRKA Workshop: Introduction to Web Components & Polymer - @JohnRiv - tinyurl.com/lrtf-polymer49