SlideShare a Scribd company logo
Web Components
What happens next is unbelievable
Design and
Specification
Abstract into
components
Implement &
Document
Plug & Play
Component
Asset Driven Development
Break designs down into a toolkit of components / blocks / modules / layouts
Easier to test and fix bugs
DRY - Don’t Repeat Yourself
Reusable *
* ish
Problems
Components can be influenced by context
Responsive Design
Documentation
Changing HTML
Tied to a back end technology or templating language
Process
Components can be influenced by context
Conflicting styles / scripts
BEM - .block__element--modifier
Data behaviour - <button data-behaviour=”js-awesomeness”>
Would be nicer to “seal” components
Responsive Design
Media queries are limited
Based on viewport
Step in the right direction
Only really useful for page-level layouts
Very rarely want a component to be influenced by viewport
Brittle
Responsive Design
Media queries are limited
Based on viewport
Step in the right direction
Only really useful for page-level layouts
Very rarely want a component to be influenced by viewport
Brittle
Element / Container queries
Responsive Design
Media queries are limited
Based on viewport
Step in the right direction
Only really useful for page-level layouts
Very rarely want a component to be influenced by viewport
Brittle
Element / Container queries
No CSS Specification
Use Cases & Requirements Document
Responsive Images Community Group
In draft
Main cause for contention is how to handle circularity
Long way off
Documentation
Styleguide
More of a design thing
Asset Library
Front End Frameworks - Bootstrap, Foundation
Documentation
Styleguide
More of a design thing
Asset Library
Front End Frameworks - Bootstrap, Foundation
Copy & pasting HTML
What if HTML changes?
“Bootstrap for every client”
Writing decent documentation is time consuming
Dealing with changes / keeping up to date
Ideal situation is to automate as much of the process as possible
“Bootstrap for every client”
Hundreds of tools claim to do this
Sturgeon’s Law - 90% are shit
2 we’ve trialled:
Tied to a back end or templating language
PHP
Concrete5
Symfony
Rails
There is a need for a pure front end - back end agnostic - solution
Web Components
What happens next is unbelievable
HTML Imports
4 new specifications
Shadow DOMCustom Elements
HTML Templates
HTML Imports
Include and reuse a HTML Document in a HTML Document
Block rendering
Better to concatenate multiple import files
Vulcanise - npm build tool
async attribute
Don’t block parsing
Accessing the content of an import with the link element’s .import property
warnings.html index.html
Javascript within an import
Behaves just like a script tag with a defer attribute
Executes in the context of the importing document
JS within an import can access it’s own DOM and/or the DOM of the page that’s
importing it
Scripts are executed in order
index.html
component.html
Allows you to bundle HTML/CSS/JS together into re-usable packages
Code organisation
Manage dependencies with automatic de-deduplication
Parallel HTML parsing
HTML Imports
DOM-based, client-side templating
Allow you to declare chunks of reusable mark-up
Inert until activated
Hidden DOM that doesn’t render
Scripts don’t run, images don’t load, etc
document.getElementById() won’t return child nodes of a template
Can be placed anywhere within <head> or <body>
HTML Templates
Declaring and activating a template
Declare using the new <template> tag
Activate by copying a template’s .content with document.importNode()
Encapsulation
Hidden DOM within an element
Shadow DOM
<video>
Adds a new type of node than can be associated with an element
This node is called a shadow root
An element that has a shadow root is called a shadow host
Create Shadow DOM by invoking .createShadowRoot() on a DOM node
Shadow DOM
Allows developers to extend the DOM and create new elements
We can be more expressive and give more meaning to our mark up
Bundle functionality together into a single tag
Extend the API of existing elements
Custom Elements
Allows developers to extend the DOM and create new elements
Custom Elements
We can be more expressive and give more meaning to our mark up
Bundle functionality together into a single tag
Extend the API of existing elements
Elements are created using document.registerElement(tag-name, prototype)
Tag names must contain a dash
prototype argument is optional; custom elements inherit from HTMLELement by
default
Calling document.registerElement() tells the browser about your new element and
returns a constructor that can be used to create instances of your element
Registering a new element
To extend a native HTML element create a new element that inherits the
prototype of the element you want to extend
Extending an existing element
GitHub example
time is used as base element
datetime attribute provides an absolute date/time
relative-time is specified as type extension
TextContent shows the relative date/time
HTML Imports
Shadow DOMCustom Elements
HTML Templates
Not quite!
HTML Imports
Shadow DOM
Custom Elements
HTML Templates
Supported In development Under consideration Not interested
PolymerX-Tag Bosonic
Small library for creating
custom elements
IE9+
All web components specs
Adds features like two-way
data binding and property
observation
Large library of pre-built
components
IE10+
All web components specs
Includes a handful of basic
elements like tabs
IE9+
HTML Imports
Shadow DOMCustom Elements
HTML Templates
Rawnet Lightning Talk - Web Components

More Related Content

What's hot

Build Reusable Web Components using HTML5 Web cComponents
Build Reusable Web Components using HTML5 Web cComponentsBuild Reusable Web Components using HTML5 Web cComponents
Build Reusable Web Components using HTML5 Web cComponentsGil Fink
 
Razor into the Razor'verse
Razor into the Razor'verseRazor into the Razor'verse
Razor into the Razor'verseEd Charbeneau
 
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
 
Ria Development With Flex And PHP
Ria Development With Flex And PHPRia Development With Flex And PHP
Ria Development With Flex And PHPJohn Coggeshall
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flexJoseph Khan
 
Html 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally ChohanHtml 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally Chohanballychohanuk
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5kolev-prp
 
Front-end tower of Babylon
Front-end tower of BabylonFront-end tower of Babylon
Front-end tower of BabylonDenis Radin
 
Michael(tm) Smith: HTML5 at Web Directions South 2008
Michael(tm) Smith: HTML5 at Web Directions South 2008Michael(tm) Smith: HTML5 at Web Directions South 2008
Michael(tm) Smith: HTML5 at Web Directions South 2008Michael(tm) Smith
 
Building Flexible SharePoint Solutions with AngularJS
Building Flexible SharePoint Solutions with AngularJSBuilding Flexible SharePoint Solutions with AngularJS
Building Flexible SharePoint Solutions with AngularJSbgerman
 
From Solutions to Apps - Moving to SP2013
From Solutions to Apps - Moving to SP2013From Solutions to Apps - Moving to SP2013
From Solutions to Apps - Moving to SP2013bgerman
 
2012 12 best of spc - moving to the sp2013 app model
2012 12 best of spc - moving to the sp2013 app model2012 12 best of spc - moving to the sp2013 app model
2012 12 best of spc - moving to the sp2013 app modelbgerman
 
Web components
Web componentsWeb components
Web componentsGil Fink
 
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
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5Steven Chipman
 
HTML5 New Features and Resources
HTML5 New Features and ResourcesHTML5 New Features and Resources
HTML5 New Features and ResourcesRon Reiter
 

What's hot (20)

Build Reusable Web Components using HTML5 Web cComponents
Build Reusable Web Components using HTML5 Web cComponentsBuild Reusable Web Components using HTML5 Web cComponents
Build Reusable Web Components using HTML5 Web cComponents
 
Html 5
Html 5Html 5
Html 5
 
Razor into the Razor'verse
Razor into the Razor'verseRazor into the Razor'verse
Razor into the Razor'verse
 
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
 
HTML - 5 - Introduction
HTML - 5 - IntroductionHTML - 5 - Introduction
HTML - 5 - Introduction
 
Ria Development With Flex And PHP
Ria Development With Flex And PHPRia Development With Flex And PHP
Ria Development With Flex And PHP
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flex
 
Html 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally ChohanHtml 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally Chohan
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
Front-end tower of Babylon
Front-end tower of BabylonFront-end tower of Babylon
Front-end tower of Babylon
 
Michael(tm) Smith: HTML5 at Web Directions South 2008
Michael(tm) Smith: HTML5 at Web Directions South 2008Michael(tm) Smith: HTML5 at Web Directions South 2008
Michael(tm) Smith: HTML5 at Web Directions South 2008
 
Building Flexible SharePoint Solutions with AngularJS
Building Flexible SharePoint Solutions with AngularJSBuilding Flexible SharePoint Solutions with AngularJS
Building Flexible SharePoint Solutions with AngularJS
 
From Solutions to Apps - Moving to SP2013
From Solutions to Apps - Moving to SP2013From Solutions to Apps - Moving to SP2013
From Solutions to Apps - Moving to SP2013
 
2012 12 best of spc - moving to the sp2013 app model
2012 12 best of spc - moving to the sp2013 app model2012 12 best of spc - moving to the sp2013 app model
2012 12 best of spc - moving to the sp2013 app model
 
Web components
Web componentsWeb components
Web components
 
Html 5
Html 5Html 5
Html 5
 
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
 
Html5 Basics
Html5 BasicsHtml5 Basics
Html5 Basics
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
HTML5 New Features and Resources
HTML5 New Features and ResourcesHTML5 New Features and Resources
HTML5 New Features and Resources
 

Viewers also liked

4 byte AS number workshop material
4 byte AS number workshop material4 byte AS number workshop material
4 byte AS number workshop materialKae Hsu
 
Rawnet Lightning talk - 'A Day in the Life of an Account Manager'
Rawnet Lightning talk - 'A Day in the Life of an Account Manager'Rawnet Lightning talk - 'A Day in the Life of an Account Manager'
Rawnet Lightning talk - 'A Day in the Life of an Account Manager'Rawnet
 
Botnets & DDoS Introduction
Botnets & DDoS IntroductionBotnets & DDoS Introduction
Botnets & DDoS IntroductionKae Hsu
 
Rawnet Lightning Talk - Design Inspiration
Rawnet Lightning Talk - Design InspirationRawnet Lightning Talk - Design Inspiration
Rawnet Lightning Talk - Design InspirationRawnet
 
How internet works and how messages are transferred in Internet
How internet works and how messages are transferred in InternetHow internet works and how messages are transferred in Internet
How internet works and how messages are transferred in Internetpagetron
 
Rawnet Lightning Talk - Elasticsearch
Rawnet Lightning Talk -  ElasticsearchRawnet Lightning Talk -  Elasticsearch
Rawnet Lightning Talk - ElasticsearchRawnet
 
Network and TCP performance relationship workshop
Network and TCP performance relationship workshopNetwork and TCP performance relationship workshop
Network and TCP performance relationship workshopKae Hsu
 
FEGTS IP Training - Network Diagnostic Introduction
FEGTS IP Training - Network Diagnostic IntroductionFEGTS IP Training - Network Diagnostic Introduction
FEGTS IP Training - Network Diagnostic IntroductionKae Hsu
 
4 Byte As Ns Test Scenarios
4 Byte As Ns Test Scenarios4 Byte As Ns Test Scenarios
4 Byte As Ns Test ScenariosKae Hsu
 
Toward The Semantic Deep Web
Toward The Semantic Deep WebToward The Semantic Deep Web
Toward The Semantic Deep WebSamiul Hoque
 
A review of Concrete 5 and what is new in version 5.7
A review of Concrete 5 and what is new in version 5.7A review of Concrete 5 and what is new in version 5.7
A review of Concrete 5 and what is new in version 5.7Rawnet
 
Rawnet Lightning Talk - 'What is an idea & how do you create them?'
Rawnet Lightning Talk - 'What is an idea & how do you create them?'Rawnet Lightning Talk - 'What is an idea & how do you create them?'
Rawnet Lightning Talk - 'What is an idea & how do you create them?'Rawnet
 
How To Process And Solve Network Security In ISP
How To Process And Solve Network Security In ISPHow To Process And Solve Network Security In ISP
How To Process And Solve Network Security In ISPKae Hsu
 
4byte As Number Migration Suggestion
4byte As Number Migration Suggestion4byte As Number Migration Suggestion
4byte As Number Migration SuggestionKae Hsu
 
Noisy information transmission through molecular interaction networks
Noisy information transmission through molecular interaction networksNoisy information transmission through molecular interaction networks
Noisy information transmission through molecular interaction networksMichael Stumpf
 
Web 101 by Jennifer Lill
Web 101 by Jennifer LillWeb 101 by Jennifer Lill
Web 101 by Jennifer LillJennifer Lill
 
Rawnet Lightning Talk - Anyone Can Draw.
Rawnet Lightning Talk - Anyone Can Draw.Rawnet Lightning Talk - Anyone Can Draw.
Rawnet Lightning Talk - Anyone Can Draw.Rawnet
 
20th TWNIC OPM IPv6 Support by SDN & NFV
20th TWNIC OPM IPv6 Support by SDN & NFV20th TWNIC OPM IPv6 Support by SDN & NFV
20th TWNIC OPM IPv6 Support by SDN & NFVKae Hsu
 
Network Design in Cloud-ready IDC
Network Design in Cloud-ready IDCNetwork Design in Cloud-ready IDC
Network Design in Cloud-ready IDCKae Hsu
 
CDN and ISP Operation
CDN and ISP OperationCDN and ISP Operation
CDN and ISP OperationKae Hsu
 

Viewers also liked (20)

4 byte AS number workshop material
4 byte AS number workshop material4 byte AS number workshop material
4 byte AS number workshop material
 
Rawnet Lightning talk - 'A Day in the Life of an Account Manager'
Rawnet Lightning talk - 'A Day in the Life of an Account Manager'Rawnet Lightning talk - 'A Day in the Life of an Account Manager'
Rawnet Lightning talk - 'A Day in the Life of an Account Manager'
 
Botnets & DDoS Introduction
Botnets & DDoS IntroductionBotnets & DDoS Introduction
Botnets & DDoS Introduction
 
Rawnet Lightning Talk - Design Inspiration
Rawnet Lightning Talk - Design InspirationRawnet Lightning Talk - Design Inspiration
Rawnet Lightning Talk - Design Inspiration
 
How internet works and how messages are transferred in Internet
How internet works and how messages are transferred in InternetHow internet works and how messages are transferred in Internet
How internet works and how messages are transferred in Internet
 
Rawnet Lightning Talk - Elasticsearch
Rawnet Lightning Talk -  ElasticsearchRawnet Lightning Talk -  Elasticsearch
Rawnet Lightning Talk - Elasticsearch
 
Network and TCP performance relationship workshop
Network and TCP performance relationship workshopNetwork and TCP performance relationship workshop
Network and TCP performance relationship workshop
 
FEGTS IP Training - Network Diagnostic Introduction
FEGTS IP Training - Network Diagnostic IntroductionFEGTS IP Training - Network Diagnostic Introduction
FEGTS IP Training - Network Diagnostic Introduction
 
4 Byte As Ns Test Scenarios
4 Byte As Ns Test Scenarios4 Byte As Ns Test Scenarios
4 Byte As Ns Test Scenarios
 
Toward The Semantic Deep Web
Toward The Semantic Deep WebToward The Semantic Deep Web
Toward The Semantic Deep Web
 
A review of Concrete 5 and what is new in version 5.7
A review of Concrete 5 and what is new in version 5.7A review of Concrete 5 and what is new in version 5.7
A review of Concrete 5 and what is new in version 5.7
 
Rawnet Lightning Talk - 'What is an idea & how do you create them?'
Rawnet Lightning Talk - 'What is an idea & how do you create them?'Rawnet Lightning Talk - 'What is an idea & how do you create them?'
Rawnet Lightning Talk - 'What is an idea & how do you create them?'
 
How To Process And Solve Network Security In ISP
How To Process And Solve Network Security In ISPHow To Process And Solve Network Security In ISP
How To Process And Solve Network Security In ISP
 
4byte As Number Migration Suggestion
4byte As Number Migration Suggestion4byte As Number Migration Suggestion
4byte As Number Migration Suggestion
 
Noisy information transmission through molecular interaction networks
Noisy information transmission through molecular interaction networksNoisy information transmission through molecular interaction networks
Noisy information transmission through molecular interaction networks
 
Web 101 by Jennifer Lill
Web 101 by Jennifer LillWeb 101 by Jennifer Lill
Web 101 by Jennifer Lill
 
Rawnet Lightning Talk - Anyone Can Draw.
Rawnet Lightning Talk - Anyone Can Draw.Rawnet Lightning Talk - Anyone Can Draw.
Rawnet Lightning Talk - Anyone Can Draw.
 
20th TWNIC OPM IPv6 Support by SDN & NFV
20th TWNIC OPM IPv6 Support by SDN & NFV20th TWNIC OPM IPv6 Support by SDN & NFV
20th TWNIC OPM IPv6 Support by SDN & NFV
 
Network Design in Cloud-ready IDC
Network Design in Cloud-ready IDCNetwork Design in Cloud-ready IDC
Network Design in Cloud-ready IDC
 
CDN and ISP Operation
CDN and ISP OperationCDN and ISP Operation
CDN and ISP Operation
 

Similar to Rawnet Lightning Talk - Web Components

Web components
Web componentsWeb components
Web componentsMohd Saeed
 
Web components
Web componentsWeb components
Web componentsNoam Kfir
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the futureDA-14
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven developmentGil Fink
 
Milwaukee JS - Live binding with CanJS
Milwaukee JS - Live binding with CanJSMilwaukee JS - Live binding with CanJS
Milwaukee JS - Live binding with CanJSStan Carrico
 
Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance TipsRavi Raj
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedGil Fink
 
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
 
Intro to polymer-Devfest Yaoundé 2013
Intro to polymer-Devfest Yaoundé 2013Intro to polymer-Devfest Yaoundé 2013
Intro to polymer-Devfest Yaoundé 2013gdgyaounde
 
HTML5 and Search Engine Optimization (SEO)
HTML5 and Search Engine Optimization (SEO)HTML5 and Search Engine Optimization (SEO)
HTML5 and Search Engine Optimization (SEO)Performics.Convonix
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSTimo Herttua
 
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009ken.egozi
 
Websites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly WebsitesWebsites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly Websiteswebsiteunlimited
 
High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesStoyan Stefanov
 
Implementing Vanilla Web Components
Implementing Vanilla Web ComponentsImplementing Vanilla Web Components
Implementing Vanilla Web Componentssonumanoj
 

Similar to Rawnet Lightning Talk - Web Components (20)

Web components
Web componentsWeb components
Web components
 
Web components
Web componentsWeb components
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
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Milwaukee JS - Live binding with CanJS
Milwaukee JS - Live binding with CanJSMilwaukee JS - Live binding with CanJS
Milwaukee JS - Live binding with CanJS
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance Tips
 
Html 5 - What's new?
Html 5 - What's new?Html 5 - What's new?
Html 5 - What's new?
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has Arrived
 
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...
 
Polymer
PolymerPolymer
Polymer
 
Intro to polymer-Devfest Yaoundé 2013
Intro to polymer-Devfest Yaoundé 2013Intro to polymer-Devfest Yaoundé 2013
Intro to polymer-Devfest Yaoundé 2013
 
HTML5 and Search Engine Optimization (SEO)
HTML5 and Search Engine Optimization (SEO)HTML5 and Search Engine Optimization (SEO)
HTML5 and Search Engine Optimization (SEO)
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
 
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
 
Websites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly WebsitesWebsites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly Websites
 
HTML.pptx
HTML.pptxHTML.pptx
HTML.pptx
 
Html 5
Html 5Html 5
Html 5
 
High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practices
 
Implementing Vanilla Web Components
Implementing Vanilla Web ComponentsImplementing Vanilla Web Components
Implementing Vanilla Web Components
 

Recently uploaded

Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxabhinandnam9997
 
Case study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxCase study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxAnkitscribd
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyDamar Juniarto
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkklolsDocherty
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesSanjeev Rampal
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理aagad
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?Linksys Velop Login
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfSiskaFitrianingrum
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideVarun Mithran
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxlaozhuseo02
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEHimani415946
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan
 

Recently uploaded (13)

Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
Case study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxCase study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptx
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
The Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI StudioThe Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI Studio
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 

Rawnet Lightning Talk - Web Components

  • 1. Web Components What happens next is unbelievable
  • 2.
  • 3.
  • 4.
  • 6. Asset Driven Development Break designs down into a toolkit of components / blocks / modules / layouts Easier to test and fix bugs DRY - Don’t Repeat Yourself Reusable * * ish
  • 7. Problems Components can be influenced by context Responsive Design Documentation Changing HTML Tied to a back end technology or templating language Process
  • 8. Components can be influenced by context Conflicting styles / scripts BEM - .block__element--modifier Data behaviour - <button data-behaviour=”js-awesomeness”> Would be nicer to “seal” components
  • 9. Responsive Design Media queries are limited Based on viewport Step in the right direction Only really useful for page-level layouts Very rarely want a component to be influenced by viewport Brittle
  • 10.
  • 11. Responsive Design Media queries are limited Based on viewport Step in the right direction Only really useful for page-level layouts Very rarely want a component to be influenced by viewport Brittle Element / Container queries
  • 12.
  • 13. Responsive Design Media queries are limited Based on viewport Step in the right direction Only really useful for page-level layouts Very rarely want a component to be influenced by viewport Brittle Element / Container queries No CSS Specification Use Cases & Requirements Document Responsive Images Community Group In draft Main cause for contention is how to handle circularity Long way off
  • 14. Documentation Styleguide More of a design thing Asset Library Front End Frameworks - Bootstrap, Foundation
  • 15.
  • 16. Documentation Styleguide More of a design thing Asset Library Front End Frameworks - Bootstrap, Foundation Copy & pasting HTML What if HTML changes? “Bootstrap for every client” Writing decent documentation is time consuming Dealing with changes / keeping up to date Ideal situation is to automate as much of the process as possible
  • 17. “Bootstrap for every client” Hundreds of tools claim to do this Sturgeon’s Law - 90% are shit 2 we’ve trialled:
  • 18. Tied to a back end or templating language PHP Concrete5 Symfony Rails There is a need for a pure front end - back end agnostic - solution
  • 19. Web Components What happens next is unbelievable
  • 20. HTML Imports 4 new specifications Shadow DOMCustom Elements HTML Templates
  • 21. HTML Imports Include and reuse a HTML Document in a HTML Document Block rendering Better to concatenate multiple import files Vulcanise - npm build tool async attribute Don’t block parsing
  • 22. Accessing the content of an import with the link element’s .import property warnings.html index.html
  • 23. Javascript within an import Behaves just like a script tag with a defer attribute Executes in the context of the importing document JS within an import can access it’s own DOM and/or the DOM of the page that’s importing it Scripts are executed in order index.html component.html
  • 24. Allows you to bundle HTML/CSS/JS together into re-usable packages Code organisation Manage dependencies with automatic de-deduplication Parallel HTML parsing HTML Imports
  • 25. DOM-based, client-side templating Allow you to declare chunks of reusable mark-up Inert until activated Hidden DOM that doesn’t render Scripts don’t run, images don’t load, etc document.getElementById() won’t return child nodes of a template Can be placed anywhere within <head> or <body> HTML Templates
  • 26. Declaring and activating a template Declare using the new <template> tag Activate by copying a template’s .content with document.importNode()
  • 27. Encapsulation Hidden DOM within an element Shadow DOM
  • 29. Adds a new type of node than can be associated with an element This node is called a shadow root An element that has a shadow root is called a shadow host Create Shadow DOM by invoking .createShadowRoot() on a DOM node Shadow DOM
  • 30. Allows developers to extend the DOM and create new elements We can be more expressive and give more meaning to our mark up Bundle functionality together into a single tag Extend the API of existing elements Custom Elements
  • 31.
  • 32. Allows developers to extend the DOM and create new elements Custom Elements We can be more expressive and give more meaning to our mark up Bundle functionality together into a single tag Extend the API of existing elements
  • 33. Elements are created using document.registerElement(tag-name, prototype) Tag names must contain a dash prototype argument is optional; custom elements inherit from HTMLELement by default Calling document.registerElement() tells the browser about your new element and returns a constructor that can be used to create instances of your element Registering a new element
  • 34. To extend a native HTML element create a new element that inherits the prototype of the element you want to extend Extending an existing element
  • 35. GitHub example time is used as base element datetime attribute provides an absolute date/time relative-time is specified as type extension TextContent shows the relative date/time
  • 36. HTML Imports Shadow DOMCustom Elements HTML Templates
  • 38.
  • 39. HTML Imports Shadow DOM Custom Elements HTML Templates Supported In development Under consideration Not interested
  • 40. PolymerX-Tag Bosonic Small library for creating custom elements IE9+ All web components specs Adds features like two-way data binding and property observation Large library of pre-built components IE10+ All web components specs Includes a handful of basic elements like tabs IE9+
  • 41. HTML Imports Shadow DOMCustom Elements HTML Templates