SlideShare a Scribd company logo
1 of 37
Download to read offline
WEB
COMPONENTS
THE FUTURE WEB
http://goo.gl/Nh8jd9
HOW ARE WE DEVELOPING?
Let's say you want a build a page like
DAY TO DAY APPROACH
1. Go to getbootstrap.com
2. Get the CDN links for CSS and JS
3. Copy the Starter Template and Make Changes
WHAT ABOUT PLUGINS?
Say a Date Picker..
1. Go to jqueryui.com
2. Download the source example
3. Update and make changes
PRIMARY PROBLEM
NAMESPACE COLLISION
window.$j = jQuery.noConflict();
NO ENCAPSULATION OF MARK UP AND STYLES
.search .datepicker
{
background:green;
}
.widget-clock .datepicker
{
background:yellow;
}
IFRAMES???
HOW CAN WE SOLVE THIS IN A BETTER WAY?
and a date picker will be generated for you
And a Bootstrap Inverse Navbar will be scaffolded
JUST IMAGINE
If you can write a tag like
<date-picker data-start="today" data-disable="after 10 days"></date-picker>
Or this
<bootstrap-nav-inverse>
<proj>My Project</proj>
<link>Home</link>
<link>About</link>
<link>Contact</link>
</bootstrap-nav-inverse>
OR EVEN BETTER..
<GANGNAM-STYLE></GANGNAM-STYLE>
MORE REALISTIC
<TWITTER-BUTTON></TWITTER-BUTTON>
Tweet 1,114
Follow
 @zenorocha 17.5K followers
Tweet
 #customelements
Tweet
 to
 @zenorocha
ONE MORE
<DROPBOX-BUTTON></DROPBOX-BUTTON>
Choose from Dropbox Save to Dropbox
HOW CAN WE ACHIEVE THIS?
SURPISE!! SURPISE!!
This is already present in our browser
WHAT DO I MEAN?
HAVE YOU EVER WONDERED?
Inspect Me!!
Check : Inspecting Elements
SOMETHING BIGGER?
0:12
<video width="320" height="240" controls="">
<source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
<source src="http://www.w3schools.com/html/movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
HOW CAN WE DO THIS?
WEB COMPONENTS
Web Components === Write your own HTML tags & behaviours
WEB COMPONENTS
Are built using 4 key pieces
HTML TEMPLATES
SHADOW DOM
CUSTOM ELEMENTS
HTML IMPORTS
BROWSER SUPPORT
More Details
POLYFILLS
Polymer
Bosonic
x-tag
HTML TEMPLATES
SHADOW DOM
CUSTOM ELEMENTS
HTML IMPORTS
HTML TEMPLATES
In simple terms, these are just
These tags are inert - Parsed Not Rendered
Most importantly, the content inside the tag is hidden from
DOM ( $("template img") or
document.querySelectorAll("template img"))
<template></template>
<template id="myTemplate">
<img src="flowers.png">
<audio controls="">
<source src="audio.ogg" type="audio/ogg">
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
</template>
WHILE DEVELOPING
Encapsulate HTML will be stored here
<template id="myTemplate">
<img src="image.png">
<audio controls="">
<source src="audio.ogg" type="audio/ogg">
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
</template>
<script>
</script>
// Get the template content
var content = document.querySelector('#myTemplate').content;
// Modify if necessary
var img = content.querySelector('img');
img.src = "flowers.png";
// Append the content to DOM
document.body.appendChild(content.cloneNode());
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components
Web components

More Related Content

What's hot

WooCommerce: How to Customize WordPress via PHP Snippets
WooCommerce: How to Customize WordPress via PHP SnippetsWooCommerce: How to Customize WordPress via PHP Snippets
WooCommerce: How to Customize WordPress via PHP Snippets
Rodolfo Melogli
 
Please, dont touch the slow parts v.3.6 @webtechcon
Please, dont touch the slow parts v.3.6 @webtechconPlease, dont touch the slow parts v.3.6 @webtechcon
Please, dont touch the slow parts v.3.6 @webtechcon
Francesco Fullone
 
Plugins at WordCamp Phoenix
Plugins at WordCamp PhoenixPlugins at WordCamp Phoenix
Plugins at WordCamp Phoenix
Andrew Ryno
 

What's hot (20)

Master WooCommerce Troubleshooting
Master WooCommerce TroubleshootingMaster WooCommerce Troubleshooting
Master WooCommerce Troubleshooting
 
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
 
Adobe & HTML5
Adobe & HTML5Adobe & HTML5
Adobe & HTML5
 
Writer Mary Klest
Writer Mary Klest Writer Mary Klest
Writer Mary Klest
 
10 things to make you a Great Mobile Web Developer
10 things to make you a Great Mobile Web Developer10 things to make you a Great Mobile Web Developer
10 things to make you a Great Mobile Web Developer
 
Browser As Platform
Browser As PlatformBrowser As Platform
Browser As Platform
 
8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid Them8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid Them
 
Hardening WordPress - Friends of Search 2014 (WordPress Security)
Hardening WordPress - Friends of Search 2014 (WordPress Security)Hardening WordPress - Friends of Search 2014 (WordPress Security)
Hardening WordPress - Friends of Search 2014 (WordPress Security)
 
Rock Your Blocks! Web Design Acceleration with Genesis Pro
Rock Your Blocks! Web Design Acceleration with Genesis ProRock Your Blocks! Web Design Acceleration with Genesis Pro
Rock Your Blocks! Web Design Acceleration with Genesis Pro
 
WooCommerce: How to Customize WordPress via PHP Snippets
WooCommerce: How to Customize WordPress via PHP SnippetsWooCommerce: How to Customize WordPress via PHP Snippets
WooCommerce: How to Customize WordPress via PHP Snippets
 
HTML5 Video Player - HTML5 Dev Conf 2012
HTML5 Video Player - HTML5 Dev Conf 2012HTML5 Video Player - HTML5 Dev Conf 2012
HTML5 Video Player - HTML5 Dev Conf 2012
 
Please, dont touch the slow parts v.3.6 @webtechcon
Please, dont touch the slow parts v.3.6 @webtechconPlease, dont touch the slow parts v.3.6 @webtechcon
Please, dont touch the slow parts v.3.6 @webtechcon
 
Between a Block & a Hard Place
Between a Block & a Hard PlaceBetween a Block & a Hard Place
Between a Block & a Hard Place
 
Optimizing your WordPress website
Optimizing your WordPress websiteOptimizing your WordPress website
Optimizing your WordPress website
 
The Fast Track to Mastering Modern WordPress - Rob Stinson & Carrie Dils
The Fast Track to Mastering Modern WordPress - Rob Stinson & Carrie DilsThe Fast Track to Mastering Modern WordPress - Rob Stinson & Carrie Dils
The Fast Track to Mastering Modern WordPress - Rob Stinson & Carrie Dils
 
Plugins at WordCamp Phoenix
Plugins at WordCamp PhoenixPlugins at WordCamp Phoenix
Plugins at WordCamp Phoenix
 
Responsible [digital] Home Ownership
Responsible [digital] Home OwnershipResponsible [digital] Home Ownership
Responsible [digital] Home Ownership
 
Not Just a Pretty Face: How to design and build a cross-CMS CSS framework
Not Just a Pretty Face: How to design and build a cross-CMS CSS frameworkNot Just a Pretty Face: How to design and build a cross-CMS CSS framework
Not Just a Pretty Face: How to design and build a cross-CMS CSS framework
 
WordCamp Denmark Keynote
WordCamp Denmark KeynoteWordCamp Denmark Keynote
WordCamp Denmark Keynote
 
Make mobile web apps rock
Make mobile web apps rockMake mobile web apps rock
Make mobile web apps rock
 

Similar to Web components

Using Established e-Marketplace
Using Established e-MarketplaceUsing Established e-Marketplace
Using Established e-Marketplace
webhostingguy
 
@media - Even Faster Web Sites
@media - Even Faster Web Sites@media - Even Faster Web Sites
@media - Even Faster Web Sites
Steve Souders
 

Similar to Web components (20)

BreizhBeans - Web components
BreizhBeans - Web componentsBreizhBeans - Web components
BreizhBeans - Web components
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
 
World 2013 - Pushing MicroStrategy to the Limit, The Hacker Way
World 2013 - Pushing MicroStrategy to the Limit, The Hacker WayWorld 2013 - Pushing MicroStrategy to the Limit, The Hacker Way
World 2013 - Pushing MicroStrategy to the Limit, The Hacker Way
 
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
 
X tag with web components - joe ssekono
X tag with web components - joe ssekonoX tag with web components - joe ssekono
X tag with web components - joe ssekono
 
WordPress SEO in 2014 - WordCamp Baltimore 2014
WordPress SEO in 2014 - WordCamp Baltimore 2014WordPress SEO in 2014 - WordCamp Baltimore 2014
WordPress SEO in 2014 - WordCamp Baltimore 2014
 
Hardcode SEO
Hardcode SEOHardcode SEO
Hardcode SEO
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
IE8 Dev Overview_pp2003
IE8 Dev Overview_pp2003IE8 Dev Overview_pp2003
IE8 Dev Overview_pp2003
 
Optimization 2020 | Using Edge SEO For Technical Issues ft. Dan Taylor
Optimization 2020 | Using Edge SEO For Technical Issues ft. Dan TaylorOptimization 2020 | Using Edge SEO For Technical Issues ft. Dan Taylor
Optimization 2020 | Using Edge SEO For Technical Issues ft. Dan Taylor
 
[O'Reilly] HTML5 Design
[O'Reilly] HTML5 Design[O'Reilly] HTML5 Design
[O'Reilly] HTML5 Design
 
Please dont touch-3.6-jsday
Please dont touch-3.6-jsdayPlease dont touch-3.6-jsday
Please dont touch-3.6-jsday
 
Static site gen talk
Static site gen talkStatic site gen talk
Static site gen talk
 
Using Established e-Marketplace
Using Established e-MarketplaceUsing Established e-Marketplace
Using Established e-Marketplace
 
Flavours of SEO
Flavours of SEOFlavours of SEO
Flavours of SEO
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
Fundamentals of HTML5
Fundamentals of HTML5Fundamentals of HTML5
Fundamentals of HTML5
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
 
@media - Even Faster Web Sites
@media - Even Faster Web Sites@media - Even Faster Web Sites
@media - Even Faster Web Sites
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Web components

  • 2. HOW ARE WE DEVELOPING? Let's say you want a build a page like
  • 3. DAY TO DAY APPROACH 1. Go to getbootstrap.com 2. Get the CDN links for CSS and JS 3. Copy the Starter Template and Make Changes
  • 4. WHAT ABOUT PLUGINS? Say a Date Picker.. 1. Go to jqueryui.com 2. Download the source example 3. Update and make changes
  • 5. PRIMARY PROBLEM NAMESPACE COLLISION window.$j = jQuery.noConflict(); NO ENCAPSULATION OF MARK UP AND STYLES .search .datepicker { background:green; } .widget-clock .datepicker { background:yellow; }
  • 6. IFRAMES??? HOW CAN WE SOLVE THIS IN A BETTER WAY?
  • 7. and a date picker will be generated for you And a Bootstrap Inverse Navbar will be scaffolded JUST IMAGINE If you can write a tag like <date-picker data-start="today" data-disable="after 10 days"></date-picker> Or this <bootstrap-nav-inverse> <proj>My Project</proj> <link>Home</link> <link>About</link> <link>Contact</link> </bootstrap-nav-inverse> OR EVEN BETTER..
  • 9. MORE REALISTIC <TWITTER-BUTTON></TWITTER-BUTTON> Tweet 1,114 Follow @zenorocha 17.5K followers Tweet #customelements Tweet to @zenorocha
  • 11. HOW CAN WE ACHIEVE THIS? SURPISE!! SURPISE!! This is already present in our browser WHAT DO I MEAN?
  • 12. HAVE YOU EVER WONDERED? Inspect Me!! Check : Inspecting Elements
  • 13. SOMETHING BIGGER? 0:12 <video width="320" height="240" controls=""> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4"> <source src="http://www.w3schools.com/html/movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video> HOW CAN WE DO THIS?
  • 14. WEB COMPONENTS Web Components === Write your own HTML tags & behaviours
  • 15. WEB COMPONENTS Are built using 4 key pieces HTML TEMPLATES SHADOW DOM CUSTOM ELEMENTS HTML IMPORTS
  • 18. HTML TEMPLATES SHADOW DOM CUSTOM ELEMENTS HTML IMPORTS
  • 19. HTML TEMPLATES In simple terms, these are just These tags are inert - Parsed Not Rendered Most importantly, the content inside the tag is hidden from DOM ( $("template img") or document.querySelectorAll("template img")) <template></template> <template id="myTemplate"> <img src="flowers.png"> <audio controls=""> <source src="audio.ogg" type="audio/ogg"> <source src="audio.mp3" type="audio/mpeg"> Your browser does not support the audio tag. </audio> </template>
  • 20. WHILE DEVELOPING Encapsulate HTML will be stored here <template id="myTemplate"> <img src="image.png"> <audio controls=""> <source src="audio.ogg" type="audio/ogg"> <source src="audio.mp3" type="audio/mpeg"> Your browser does not support the audio tag. </audio> </template> <script> </script> // Get the template content var content = document.querySelector('#myTemplate').content; // Modify if necessary var img = content.querySelector('img'); img.src = "flowers.png"; // Append the content to DOM document.body.appendChild(content.cloneNode());