SlideShare a Scribd company logo
Custom Elements with Stencil
Becky Veater
Head of Web Development at Elixel
@ryveata
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
What is a custom
element?
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
Built in vanilla Javascript - native support, runs in
every framework
Provides a reusable transferable element - great for
‘pattern’ library approaches
Need polyfills for Firefox and Edge
Built from the lowest possible level - all behaviours
we are used to (Angular/React/Vue) have to be built
from the ground up e.g. virtual dom/data binding
+
+
-
-
Conf 2018 Track 2 - Custom Web Elements with Stencil
What is Stencil?
Is it another framework?
The magical, reusable web component
compiler
Component: transferable distributable module
App: starter for basic app or website
Ionic-PWA: fast production ready PWA
Why Stencil?
➔ Reactive components - data binding
➔ Virtual DOM for speed
➔ Typescript
➔ Shadow DOM
➔ Lazy load polyfilling including CSS vars for
Firefox, Edge and IE11 as needed
Kick off...
Demo
Distribute...
Scope your package to you/your organisation
Register for npm
npm login
npm build
npm publish
Added Extras...
➔ Pre rendering
➔ Service workers
➔ Unit testing
➔ @stencil/router similar to React router for
building in navigation behaviour in app
How to get started...
● https://stenciljs.com
● https://stencilcomponents.com/
● https://github.com/jagreehal/jag-reehal-stencil-tutorial
● https://speakerdeck.com/ahmad/building-web-
components-with-stencil
● https://www.recallact.com/presentation/stenciljs-and-
universal-components
Thank you
@ryveata
@elixelofficial

More Related Content

PPTX
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
PPTX
Building solutions with the SharePoint Framework - introduction
PPTX
Building solutions with the SharePoint Framework - deep-dive
PDF
ReactJS Workflows
PDF
Tomasz Janczuk - Webtaskalifragilistexpialidocious
PDF
Front-end tower of Babylon
PPTX
Host, deploy & scale Blazor Server Apps
PDF
The Thick Front-End
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Building solutions with the SharePoint Framework - introduction
Building solutions with the SharePoint Framework - deep-dive
ReactJS Workflows
Tomasz Janczuk - Webtaskalifragilistexpialidocious
Front-end tower of Babylon
Host, deploy & scale Blazor Server Apps
The Thick Front-End

What's hot (20)

PDF
WordPress as a Headless CMS - Bronson Quick
PPTX
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
PDF
Web Policies & Reporting
PDF
slide-dnrdw
PPTX
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
PDF
The future of Activiti Cloud @ DevCon 2019
PPTX
Codegen2021 blazor mobile
PPTX
EXPERTALKS: Jul 2012 - Build using Gradle
PPTX
Interoperability of components built with different frameworks
PDF
Get your mobile app in production in 3 months: Native and Reactive Mobile Apps
PDF
Introduction To Single Page Application
PDF
Get your mobile app in production in 3 months: Backend
PDF
The WordPress Performance Team
PPTX
Testing your Single Page Application
PPTX
Azure Serverless Conf
PDF
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
PDF
Coding with jetpack
PDF
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
PDF
Server rendering-talk
PPTX
A Gentle Introduction to Blazor
WordPress as a Headless CMS - Bronson Quick
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
Web Policies & Reporting
slide-dnrdw
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
The future of Activiti Cloud @ DevCon 2019
Codegen2021 blazor mobile
EXPERTALKS: Jul 2012 - Build using Gradle
Interoperability of components built with different frameworks
Get your mobile app in production in 3 months: Native and Reactive Mobile Apps
Introduction To Single Page Application
Get your mobile app in production in 3 months: Backend
The WordPress Performance Team
Testing your Single Page Application
Azure Serverless Conf
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
Coding with jetpack
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Server rendering-talk
A Gentle Introduction to Blazor
Ad

Similar to Conf 2018 Track 2 - Custom Web Elements with Stencil (20)

PPTX
Webpack/Parcel: What’s Happening Behind the React App?
PDF
Introduction to Docker - Vellore Institute of Technology
PDF
Introduction to Docker - VIT Campus
PDF
Web componenet using angular element
PPTX
Mobile Application and Developments.pptx
PPTX
Web summit.pptx
PPTX
Expo - Zero to App.pptx
PDF
Cloud-native Patterns (July 4th, 2019)
PDF
Cloud-native Patterns
PDF
A Shift from Monolith to Microservice using Docker
PDF
The path to a serverless-native era with Kubernetes
PDF
Building cross platform web apps
PPTX
Short-Training asp.net vNext
PDF
Node.js an Exectutive View
PDF
DCEU 18: App-in-a-Box with Docker Application Packages
PDF
.NET Cloud-Native Bootcamp
PDF
Exploring pwa for shopware
PDF
Stencil the time for vanilla web components has arrived
PDF
DevOpsDays Warsaw 2015: Automating microservices in Syncano – Michał Kobus & ...
PDF
Tech Talk Comp Apps851 20090930
Webpack/Parcel: What’s Happening Behind the React App?
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - VIT Campus
Web componenet using angular element
Mobile Application and Developments.pptx
Web summit.pptx
Expo - Zero to App.pptx
Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns
A Shift from Monolith to Microservice using Docker
The path to a serverless-native era with Kubernetes
Building cross platform web apps
Short-Training asp.net vNext
Node.js an Exectutive View
DCEU 18: App-in-a-Box with Docker Application Packages
.NET Cloud-Native Bootcamp
Exploring pwa for shopware
Stencil the time for vanilla web components has arrived
DevOpsDays Warsaw 2015: Automating microservices in Syncano – Michał Kobus & ...
Tech Talk Comp Apps851 20090930
Ad

More from TechExeter (20)

PPTX
Exeter Science Centre, by Natalie Whitehead
PPTX
South West InternetOfThings Network by Wo King
PPTX
Generative Adversarial Networks by Tariq Rashid
PDF
Conf 2019 - Workshop: Liam Glanfield - know your threat actor
PDF
Conf 2018 Track 1 - Unicorns aren't real
PDF
Conf 2018 Track 1 - Aerospace Innovation
PDF
Conf 2018 Track 2 - Try Elm
PPTX
Conf 2018 Track 3 - Creating marine geospatial services
PPTX
Conf 2018 Track 2 - Machine Learning with TensorFlow
PDF
Conf 2018 Track 1 - Tessl / revolutionising the house moving process
PPTX
Conf 2018 Keynote - Andy Stanford-Clark, CTO IBM UK
PPTX
Conf 2018 Track 3 - Microservices - What I've learned after a year building s...
PPTX
Gps behaving badly - Guy Busenel
PDF
Why Isn't My Query Using an Index?: An Introduction to SQL Performance
PPTX
Turning Developers into Testers
PDF
Remote working
PPTX
Developing an Agile Mindset
PDF
Think like a gardener
PDF
The trials and tribulations of providing engineering infrastructure
PDF
Scaling clusters to thousands of servers in the cloud
Exeter Science Centre, by Natalie Whitehead
South West InternetOfThings Network by Wo King
Generative Adversarial Networks by Tariq Rashid
Conf 2019 - Workshop: Liam Glanfield - know your threat actor
Conf 2018 Track 1 - Unicorns aren't real
Conf 2018 Track 1 - Aerospace Innovation
Conf 2018 Track 2 - Try Elm
Conf 2018 Track 3 - Creating marine geospatial services
Conf 2018 Track 2 - Machine Learning with TensorFlow
Conf 2018 Track 1 - Tessl / revolutionising the house moving process
Conf 2018 Keynote - Andy Stanford-Clark, CTO IBM UK
Conf 2018 Track 3 - Microservices - What I've learned after a year building s...
Gps behaving badly - Guy Busenel
Why Isn't My Query Using an Index?: An Introduction to SQL Performance
Turning Developers into Testers
Remote working
Developing an Agile Mindset
Think like a gardener
The trials and tribulations of providing engineering infrastructure
Scaling clusters to thousands of servers in the cloud

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Empathic Computing: Creating Shared Understanding
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Big Data Technologies - Introduction.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
KodekX | Application Modernization Development
PPTX
Cloud computing and distributed systems.
PDF
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation theory and applications.pdf
Empathic Computing: Creating Shared Understanding
The AUB Centre for AI in Media Proposal.docx
Big Data Technologies - Introduction.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation_ Review paper, used for researhc scholars
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
Cloud computing and distributed systems.
Unlocking AI with Model Context Protocol (MCP)

Conf 2018 Track 2 - Custom Web Elements with Stencil

  • 1. Custom Elements with Stencil Becky Veater Head of Web Development at Elixel @ryveata
  • 6. What is a custom element?
  • 10. Built in vanilla Javascript - native support, runs in every framework Provides a reusable transferable element - great for ‘pattern’ library approaches Need polyfills for Firefox and Edge Built from the lowest possible level - all behaviours we are used to (Angular/React/Vue) have to be built from the ground up e.g. virtual dom/data binding + + - -
  • 13. Is it another framework?
  • 14. The magical, reusable web component compiler Component: transferable distributable module App: starter for basic app or website Ionic-PWA: fast production ready PWA
  • 16. ➔ Reactive components - data binding ➔ Virtual DOM for speed ➔ Typescript ➔ Shadow DOM ➔ Lazy load polyfilling including CSS vars for Firefox, Edge and IE11 as needed
  • 18. Demo
  • 19. Distribute... Scope your package to you/your organisation Register for npm npm login npm build npm publish
  • 20. Added Extras... ➔ Pre rendering ➔ Service workers ➔ Unit testing ➔ @stencil/router similar to React router for building in navigation behaviour in app
  • 21. How to get started... ● https://stenciljs.com ● https://stencilcomponents.com/ ● https://github.com/jagreehal/jag-reehal-stencil-tutorial ● https://speakerdeck.com/ahmad/building-web- components-with-stencil ● https://www.recallact.com/presentation/stenciljs-and- universal-components

Editor's Notes

  • #6: 2 mins
  • #7: And now to our topic - custom elements and stencil Let’s start with looking at what we mean by a custom element
  • #8: Here is an example of the start of a web component Google Polymer - early advocates
  • #9: One of the very first custom elements was the video tag built into the HTML5 spec (3 years ago) along with other media related tags As a tag it is implemented like this
  • #10: 1 mins But underneath it is actually this Inside the Shadow DOM the underlying elements and styles are encapsulated
  • #11: Pros and cons of native custom element support
  • #14: NOT a framework - a compiler #obligatory cat gif
  • #15: Developed by ionic Release 1 year ago at Google Polymer Summit Extends basic web component development for easier production V 0.12.3 Stencil website is built in stencil Still in development but likely to be released to beta alongside ionic 4
  • #17: Unlike if done natively, Stencil provides a base line set of features that anyone working with Angular or React will be familiar with Ionic were influenced by angular, react, vue and polymer when building so In fact writing for stencil is kind of a cross between both Angular and React Virtual Dom - reconciliation of changes between the non rendered dom and the actual Dom Typescript - Type safe JS :) Shadow DOM - scoping/encapsulation
  • #18: Max 8 mins Npm, may need to install stencil with npm install @stencil/core If you want to start with a clean build remove the my component assets, update the index and update the package.json with appropriate naming and stencil.config.js.
  • #21: Pre rendering (generating static files at build time) improves performance. Can also do server side rendering but pre rendering is default in order to reduce server workload (Express with Node.js) Service workers - using Workbox simplified creation of service workers. Great for producing websites/PWA as provides offline mode out the box Unit testing via Jest