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
0
80
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
46
The Future of Audio Processing in the Web
bobrov1989
0
130
Job Behind the Scene: Web Worker
bobrov1989
0
91
Running in Parallel: WebAssembly, Web Workers and Worklets
bobrov1989
0
230
Algorithms and Their Habitat
bobrov1989
0
170
WebAssembly-driven CSS
bobrov1989
2
170
Angular State Management with NgRx Workshop
bobrov1989
0
120
The Man who Sold the Amp: How to Process Music with JS
bobrov1989
1
330
No Apollogies: Making Apps Accessible
bobrov1989
1
210
Other Decks in Programming
See All in Programming
技術を根付かせる / How to make technology take root
kubode
1
240
Bedrock Agentsレスポンス解析によるAgentのOps
licux
2
720
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
340
Honoのおもしろいミドルウェアをみてみよう
yusukebe
1
200
TokyoR116_BeginnersSession1_環境構築
kotatyamtema
0
110
負債になりにくいCSSをデザイナとつくるには?
fsubal
9
2.3k
プログラミング言語学習のススメ / why-do-i-learn-programming-language
yashi8484
0
120
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
5
3.8k
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
660
SwiftUI Viewの責務分離
elmetal
PRO
0
140
時計仕掛けのCompose
mkeeda
1
280
最近のVS Codeで気になるニュース 2025/01
74th
1
250
Featured
See All Featured
Thoughts on Productivity
jonyablonski
69
4.5k
Code Review Best Practice
trishagee
66
17k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
What's in a price? How to price your products and services
michaelherold
244
12k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
BBQ
matthewcrist
86
9.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Music & Morning Musume
bryan
46
6.3k
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 ” “