$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Fancy Web Components with Stencil
Search
Vitalii Bobrov
November 30, 2017
Programming
0
89
Fancy Web Components with Stencil
Vitalii Bobrov
November 30, 2017
Tweet
Share
More Decks by Vitalii Bobrov
See All by Vitalii Bobrov
Listen to UI: Making Apps Accessible
bobrov1989
0
76
The Future of Audio Processing in the Web
bobrov1989
0
180
Job Behind the Scene: Web Worker
bobrov1989
0
150
Running in Parallel: WebAssembly, Web Workers and Worklets
bobrov1989
0
280
Algorithms and Their Habitat
bobrov1989
0
210
WebAssembly-driven CSS
bobrov1989
2
210
Angular State Management with NgRx Workshop
bobrov1989
0
150
The Man who Sold the Amp: How to Process Music with JS
bobrov1989
1
370
No Apollogies: Making Apps Accessible
bobrov1989
1
240
Other Decks in Programming
See All in Programming
STYLE
koic
0
150
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
110
AIコーディングエージェント(NotebookLM)
kondai24
0
170
テストやOSS開発に役立つSetup PHP Action
matsuo_atsushi
0
150
AIコーディングエージェント(Manus)
kondai24
0
160
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.2k
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
6
1.2k
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
20k
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
1.2k
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
170
CSC509 Lecture 14
javiergs
PRO
0
220
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.1k
Statistics for Hackers
jakevdp
799
230k
Embracing the Ebb and Flow
colly
88
4.9k
Scaling GitHub
holman
464
140k
Music & Morning Musume
bryan
46
7k
Navigating Team Friction
lara
191
16k
Designing for Performance
lara
610
69k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
RailsConf 2023
tenderlove
30
1.3k
Faster Mobile Websites
deanohume
310
31k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.1k
Transcript
FANCY WEB COMPONENTS WITH
VITALII BOBROV JAVASCRIPT DEV @ LUXOFT @bobrov1989 vitaliy-bobrov.github.io
STENCIL IS A COMPILER THAT GENERATES WEB COMPONENTS ” “
WHAT IS STENCIL?
IT IS NOT A FRAMEWORK
CONSISTS OF 4 API WHAT IS WEB COMPONENTS? • JavaScript
Modules • Custom Elements • HTML Template • Shadow DOM
FRAMEWORKS WEB COMPONENTS SKATEJS
BROWSERS SUPPORT Chrome (blink-based) Safari Firefox Edge IE JS modules
(optional) ☹ Custom Elements ☹ ☹ HTML Template ☹ Shadow DOM ☹ ☹
FOR OLD BROWSERS USE POLYFILL
WHY WE SHOULD USE WEB COMPONENTS?
RE-USABLE COMPONENTS ALL WE WANT
COMPONENTS THAT NOT RELY ON ANY FRAMEWORK BUT PLATFORM ”
“ AND FRAMEWORK AGNOSTIC
AWESOME ALL MODERN FRAMEWORKS
STENCIL COMBINES THE BEST CONCEPTS OF THE MOST POPULAR FRAMEWORKS
INTO A SIMPLE BUILD-TIME TOOL ” “ JUST USE ALL THE BEST
KEY FEATURES • Virtual DOM • Async rendering (inspired by
React Fiber) • Reactive data-binding • TypeScript • JSX • Server Side Rendering (SSR)
FIBER VS STENCIL DEMO https://claudiopro.github.io/react-fiber-vs-stack-demo/fiber.html https://stencil-fiber-demo.firebaseapp.com/perf.html
WE ARE ENTERING NO FRAMEWORK ERA ” “
HOW TO GET STARTED?
BASIC COMPONENT import { Component, Prop } from '@stencil/core'; @Component({
tag: 'my-name', styleUrl: 'my-name.scss' }) export class MyName { @Prop() first: string; @Prop() last: string; render() { return ( <div> Hello, my name is {this.first} {this.last} </div> ); } }
API REVIEW
DECORATORS • @Component • @Prop • @State • @Method •
@Element • @Event • @Listen
LIFE CYCLE HOOKS • componentWillLoad • componentDidLoad • componentWillUpdate •
componentDidUpdate • componentDidUnload
PROPERTY HOOKS • @PropWillChange • @PropDidChange
DEMO TIME https://github.com/vitaliy-bobrov/stencil-meetjs-demo
QUESTIONS?
THANK YOU! USE THE PLATFORM ” “