Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Web Components and the Future of JS Frameworks
Search
bradgignac
May 17, 2014
Programming
3
730
Web Components and the Future of JS Frameworks
bradgignac
May 17, 2014
Tweet
Share
More Decks by bradgignac
See All by bradgignac
Why You Might Not Need Yet Another Environment
bradgignac
1
590
Understanding the Shift to Mobile
bradgignac
0
390
Front-End Operations
bradgignac
4
760
Intro to CoreOS
bradgignac
4
1.2k
Modular CSS
bradgignac
0
25
Rich Client Design Patterns
bradgignac
3
300
Other Decks in Programming
See All in Programming
Unity6.3 AudioUpdate
cova8bitdots
0
120
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
360
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.3k
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
210
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
790
AI活用のコスパを最大化する方法
ochtum
0
130
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
470
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.7k
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
530
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
370
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
150
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
320
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
100
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
920
A Soul's Torment
seathinner
5
2.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
170
Exploring anti-patterns in Rails
aemeredith
2
290
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
The Limits of Empathy - UXLibs8
cassininazir
1
250
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Transcript
and the Future of JS Frameworks Web Components
None
None
@bradgignac bradgignac.com
A Brief History of JavaScript
1995 2004 2006 2011 2014 The Birth of JavaScript
JavaScript
C#
C
1995 2004 2006 2011 2014 The Birth of JavaScript
1995 2004 2006 2011 2014 Web 2.0
None
None
1995 2004 2006 2011 2014 Web 2.0
1995 2004 2006 2011 2014 jQuery
None
1995 2004 2006 2011 2014 jQuery
1995 2004 2006 2011 2014 Rise of the Microlibrary
None
None
1995 2004 2006 2011 2014 Rise of the Microlibrary
1995 2004 2006 2011 2014 A “Diverse Ecosystem”
None
Backbone
Angular
What’s the Difference?
What are Web Components?
Web Components enable Web application authors to define widgets with
a level of visual richness and interactivity not possible with CSS alone, and ease of composition and reuse not possible with script libraries today.
Web Components give developers a composable, reusable method for packaging
HTML, CSS, and JavaScript.
Modal
<div class="modal"> <div class="modal-‐header">This Is My Title</div> <div
class="modal-‐content">Lorem ipsum dolor...</div> <div class="modal-‐footer"><!-‐-‐ Buttons -‐-‐></div> </div> <div>
<my-‐modal header="This Is My Title"> <p>Lorem ipsum dolor...</p> </my-‐modal>
<my-modal>
How do we use them?
Let’s Build a Modal
<my-‐modal header="This Is My Title"> <p>Lorem ipsum dolor sit
amet...</p> </my-‐modal> <my-modal>
<template id="modal"> <style scoped>...</style> <div class="modal-‐header"><!-‐-‐ Header -‐-‐></div>
<div class="modal-‐content"><content /></div> <div class="modal-‐footer"> <button>Cancel</button> <button>Save</button> </div> </template> Templates
<template id="my-‐modal"> <style scoped> @host {
... } .modal-‐header { ... } .modal-‐content { ... } .modal-‐footer { ... } </style> ... </template> Scoped Styles
var template, host; template = document.querySelector('#my-‐modal'); host = this.createShadowRoot(); host.appendChild(template.content.cloneNode(true));
Shadow DOM
var ModalPrototype, Modal; ModalPrototype = Object.create(HTMLElement.prototype); ModalPrototype.createCallback = function
() { ... }; Modal = document.register('my-‐modal', { prototype: ModalPrototype }); Custom Elements
HTML Imports ES6 Modules ES6 Module Loader Packaging
Mutation Observers Object.observe Node.bind Related Technologies
Encapsulation Performance Interoperability Better Frameworks Benefits
Using Web Components Today
Polymer Polymer('my-‐modal', { header: 'This Is My Header' });
Polymer <polymer-‐element name="my-‐modal" attributes="header"> <template> <style
scoped>...</style> <div class="modal-‐header">{{ header }}</div> <div class="modal-‐content"><content /></div> <div class="modal-‐footer"> <button>Cancel</button> <button>Save</button> </div> </template> <script>...</script> </polymer-‐element>
Angular angular.module('myModal').directive('myModal', function () { return {
restrict: 'E', transclude: true, templateUrl: 'myModal.html', scope: { header: '@' } }; });
Angular <div class="modal"></div> <style scoped>...</style> <div class="modal-‐header">{{ header
}}</div> <div class="modal-‐content" ng-‐transclude></div> <div class="modal-‐footer"> <button>Cancel</button> <button>Save</button> </div> </div>
Ember <script type="text/x-‐handlebars" id="components/my-‐modal"> <style scoped>...</style> <div class="modal-‐header">{{
header }}</div> <div class="modal-‐content">{{ yield }}</div> <div class="modal-‐footer"> <button>Cancel</button> <button>Save</button> </div> </script>
Questions?