the future of templating and
frameworks…
Filip Bech-Larsen
@IMPACTdigitaldk
Whats next in templating
Filip Bech-Larsen
@IMPACTdigitaldk
@filipbech
#weAreHiring #Aarhus #Cph
The future of templating and frameworks
https://developers.google.com/experts/people/filip-bruun-bech-larsen
Whats next in templating
Filip Bech-Larsen
@IMPACTdigitaldk
templating…
• Building user interface using a declarative format (kinda looks like html)
• Some parts are static - some are dynamic
UI = f(state)
React really taught this to the world…
a trip down memory lane…
The future of templating and frameworks
The future of templating and frameworks
The future of templating and frameworks
The future of templating and frameworks
The future of templating and frameworks
The future of templating and frameworks
The future of templating and frameworks
whats next?
lets take a step back…
the job of a templating system
• balance between
• developer experience
• fast boot
• fast update
What does the platform provide?
• template element
• (tagged) template literals
The template element
• holds “inert” DOM
• scripts don’t run
• styles don’t apply
• easily cloned
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template
The future of templating and frameworks
Template literals
• instead of quotes uses backticks - `
• can span multiple lines
• can embed expressions
• can be tagged…
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
The future of templating and frameworks
tagged template literals
• a tag is a function that processes the template literal - both the literal and the
expressive parts. Can return anything
The future of templating and frameworks
tagged template literals
• a tag is a function that processes the template literal - both the literal and the
expressive parts. Can return anything.
• the literal parts-array will be the same (===) in consecutive calls
The future of templating and frameworks
can we use this to create a cool
templating system?
the job of a templating system
• balance between
• developer experience
• fast boot
• fast update
a solution?
• template in js means tools
• create template to stamp out clone
• identity of staticParts as caching-key
• We know what changed…
introducing lit-html
lit-html
• A tag-function (called html) that returns templating instructions (called
TemplateResult)
• A render method to produce and maintain dom from TemplateResult
• <2kb gzipped and super fast
https://github.com/Polymer/lit-html
The future of templating and frameworks
what can lit handle
Text content
expressions
expressions
attributes
TemplateResult
for composition
Arrays
Arrays
for composition
DOM nodes
Async via promises
extending lit-html
directives
remember this?
directives
directives
or use await, or simply just setValue(promise)
lit-extended is sugar
• properties instead of attributes by default
• declarative event-listening syntax
• only 540b gzipped extra…
lit-extended
so you say its fast?
Performance
• 2 aproaches to rendering/updating
• Be clever (Polymer) - scales with complexity (no of changes)
• Be brutal (React) - scales with number of nodes (but very fast because of
vdom)
Performance
• 2 aproaches to rendering/updating
• Be clever (Polymer) - scales with complexity (no of changes)
• Be brutal (React) - scales with number of nodes (but very fast because of
vdom)
• Lit-html tries to sit in the middle (scales with expressions)
that all good…
how do I make a component?
lit only handles templates
bring your own component
encapsulation, data-flow, events
if only the platform had that…
Web-Components
WebComponents
• custom-elements
• shadow-DOM
• template-element
• html-imports
The future of templating and frameworks
Lit-html and webcomponents
• Lit is build to be a great fit with web-components
• make a render-method that returns a TemplateResult
• use property setters to invalidate
• re-render when invalidated
• dispatch native DOM-events
The future of templating and frameworks
there are helpers already
Like LitElement (lit-html-element on npm)
• superpowers properties
• change => invalidation
• types (for conversion), attributes reflection, default value
• computed properties
• batching rendering
• lifecycle hooks
• easy id element-queries
LitElement
https://github.com/kenchris/lit-element
The future of templating and frameworks
with decorators…
one more thing…
element-router
• native web-component router (no dependencies)
• syntax/api almost like Preact-router
• <1 kb
https://github.com/filipbech/element-router
templating with lit
is pretty sweet
closing thoughts…
Thank you!
This was “Whats next in templating”
I’m @filipbech
@IMPACTdigitaldk
Follow for slides

More Related Content

PDF
Whats next in templating
PDF
Whats next in templating
PDF
Whats next in clientside templating
PDF
Whats next in clientside templating
PPTX
What's the "right" PHP Framework?
PPTX
PDF
FuelPHP presentation - PeoplePerHour workshop
PDF
FuelPHP - a PHP HMVC Framework by silicongulf.com
Whats next in templating
Whats next in templating
Whats next in clientside templating
Whats next in clientside templating
What's the "right" PHP Framework?
FuelPHP presentation - PeoplePerHour workshop
FuelPHP - a PHP HMVC Framework by silicongulf.com

What's hot (20)

PDF
Merged Automation Talk - Pete Carapetyan - Feb 2016
PPTX
Kotlin REST & GraphQL API
PPTX
Why Kotlin?
PPTX
Day 8 - jRuby
PPTX
Proxying DBI with DBD::Gofer and App::Staticperl
PDF
Craft Beer & Clojure
KEY
Why I Love TorqueBox (And Why You Will Too)
PPTX
Functional Programming in PHP
PDF
Lock-free algorithms for Kotlin Coroutines
PPTX
Repeating History...On Purpose...with Elixir
PPTX
MWLUG - Universal Java
PDF
Mixing Plone and Django for explosive results
PDF
Scala vs ruby
PDF
Crystal
PDF
Stockholm JAM September 2018
PDF
Front-end tower of Babylon
PPTX
Peeling back the Lambda layers
PDF
Ruby an overall approach
PPTX
Introduction to Ruby on Rails
PPTX
Talk about java
Merged Automation Talk - Pete Carapetyan - Feb 2016
Kotlin REST & GraphQL API
Why Kotlin?
Day 8 - jRuby
Proxying DBI with DBD::Gofer and App::Staticperl
Craft Beer & Clojure
Why I Love TorqueBox (And Why You Will Too)
Functional Programming in PHP
Lock-free algorithms for Kotlin Coroutines
Repeating History...On Purpose...with Elixir
MWLUG - Universal Java
Mixing Plone and Django for explosive results
Scala vs ruby
Crystal
Stockholm JAM September 2018
Front-end tower of Babylon
Peeling back the Lambda layers
Ruby an overall approach
Introduction to Ruby on Rails
Talk about java
Ad

Similar to The future of templating and frameworks (20)

PDF
HTML literals, the JSX of the platform
PDF
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
PDF
Webcomponents from 0-100 - with Google's Lit
PDF
Web components and friends
PDF
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
PDF
Lit Webcomponents Framework - Lit It Up Keynote
PDF
ReactJS vs AngularJS - Head to Head comparison
PDF
Webcomponents are your frameworks best friend
PPTX
Open Apereo - Web components workshop
PDF
Going native with html5 web components
PDF
Lit there be light
PDF
Web開発の技術選び、 好き嫌いでやってませんか 〜技術選びで注目すべきポイントとは〜
PPTX
Web components, so close!
PDF
All the reasons for choosing react js that you didn't know about - Avi Marcus...
PDF
React & Flux Workshop
PDF
Incremental DOM and Recent Trend of Frontend Development
PPTX
Web components
PDF
HTML5 and XHTML2
PDF
Web component driven development
PPTX
Rawnet Lightning Talk - Web Components
HTML literals, the JSX of the platform
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Webcomponents from 0-100 - with Google's Lit
Web components and friends
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
Lit Webcomponents Framework - Lit It Up Keynote
ReactJS vs AngularJS - Head to Head comparison
Webcomponents are your frameworks best friend
Open Apereo - Web components workshop
Going native with html5 web components
Lit there be light
Web開発の技術選び、 好き嫌いでやってませんか 〜技術選びで注目すべきポイントとは〜
Web components, so close!
All the reasons for choosing react js that you didn't know about - Avi Marcus...
React & Flux Workshop
Incremental DOM and Recent Trend of Frontend Development
Web components
HTML5 and XHTML2
Web component driven development
Rawnet Lightning Talk - Web Components
Ad

More from Filip Bruun Bech-Larsen (20)

PDF
Content as a Service with Umbraco Headless
PDF
Frameworks and webcomponents
PDF
Angular ❤️ CMS from #AngularUp
PDF
Future of the Web
PDF
Diversity at impact
PDF
Angular ❤️CMS
PDF
The Future of the web
PDF
Building a dynamic SPA website with Angular
PDF
Frontend development of the (current) future
PDF
Commerce and the browser in 2017
PPTX
Frontend State of the union
PPTX
AngularJS best practices
PPTX
Frontend development of the (current) future
PPTX
Dynamic content with Angular
PPTX
Observables - the why, what & how
PPTX
Angular2 workshop
PPTX
Progressive Web Apps og Payment Request
PPTX
Spangulumbraco
PPTX
Web development post io2016
PPTX
Observables in angular2
Content as a Service with Umbraco Headless
Frameworks and webcomponents
Angular ❤️ CMS from #AngularUp
Future of the Web
Diversity at impact
Angular ❤️CMS
The Future of the web
Building a dynamic SPA website with Angular
Frontend development of the (current) future
Commerce and the browser in 2017
Frontend State of the union
AngularJS best practices
Frontend development of the (current) future
Dynamic content with Angular
Observables - the why, what & how
Angular2 workshop
Progressive Web Apps og Payment Request
Spangulumbraco
Web development post io2016
Observables in angular2

Recently uploaded (20)

PPTX
Microsoft User Copilot Training Slide Deck
PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
PDF
Ensemble model-based arrhythmia classification with local interpretable model...
PDF
Human Computer Interaction Miterm Lesson
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
SaaS reusability assessment using machine learning techniques
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PDF
Co-training pseudo-labeling for text classification with support vector machi...
PPTX
MuleSoft-Compete-Deck for midddleware integrations
Microsoft User Copilot Training Slide Deck
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
Ensemble model-based arrhythmia classification with local interpretable model...
Human Computer Interaction Miterm Lesson
Introduction to MCP and A2A Protocols: Enabling Agent Communication
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
giants, standing on the shoulders of - by Daniel Stenberg
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
Data Virtualization in Action: Scaling APIs and Apps with FME
SaaS reusability assessment using machine learning techniques
Connector Corner: Transform Unstructured Documents with Agentic Automation
EIS-Webinar-Regulated-Industries-2025-08.pdf
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
Early detection and classification of bone marrow changes in lumbar vertebrae...
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
Co-training pseudo-labeling for text classification with support vector machi...
MuleSoft-Compete-Deck for midddleware integrations

The future of templating and frameworks