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
Fancy Web Components with Stencil
Search
Vitalii Bobrov
November 30, 2017
Programming
100
0
Share
Fancy Web Components with Stencil
Vitalii Bobrov
November 30, 2017
More Decks by Vitalii Bobrov
See All by Vitalii Bobrov
Listen to UI: Making Apps Accessible
bobrov1989
0
95
The Future of Audio Processing in the Web
bobrov1989
0
220
Job Behind the Scene: Web Worker
bobrov1989
0
180
Running in Parallel: WebAssembly, Web Workers and Worklets
bobrov1989
0
310
Algorithms and Their Habitat
bobrov1989
0
240
WebAssembly-driven CSS
bobrov1989
2
230
Angular State Management with NgRx Workshop
bobrov1989
0
180
The Man who Sold the Amp: How to Process Music with JS
bobrov1989
1
400
No Apollogies: Making Apps Accessible
bobrov1989
1
260
Other Decks in Programming
See All in Programming
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
340
Claspは野良GASの夢をみるか
takter00
0
170
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
140
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
RTSPクライアントを自作してみた話
simotin13
0
490
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
720
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
110
3Dシーンの圧縮
fadis
1
650
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
0
140
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
1.1k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.5k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
310
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Building Applications with DynamoDB
mza
96
7.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Music & Morning Musume
bryan
47
7.2k
Believing is Seeing
oripsolob
1
140
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
260
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Side Projects
sachag
455
43k
How to build a perfect <img>
jonoalderson
1
5.6k
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 ” “