SlideShare a Scribd company logo
Simpler
Web Architectures Now!
Gustaf Nilsson Kotte @gustaf_nk
Elevator pitch
Show client-side techniques that
make server-side rendering a
feasible option for your web
applications.
client-side web benefits
simpler deploys and operations (PaaS and server-less architectures too)
partial updates
fine-grained content caching (ajax)
cross-team components
enables richer interactions (...that are not even possible in classical web)
client-side web challenges
rate of change
device diversity (especially on mobile)
https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889/8
time-to-first-interaction (mobile, latency/bandwidth + CPU)
AMP + Progressive Web Apps: Start fast, stay engaged - Google I/O 2016
interoperability and evolvability (single runtime, isolation vs small bundle size)
techniques
techniques
pjax → partial updates (HTML views over ajax)
client-side includes (caching and reusable content)
server-side driven updates (update state, application logic kept server-side)
pjax
pjax
jquery-pjax (GitHub 2011)
https://github.com/defunkt/jquery-pjax
pushState ajax
~500 LOC (not counting comments)
jquery-pjax
$(document).pjax('css-selector-for-links', '#css-selector-for-container')
demo: web shop
team A: products, static site (variations, related information)
team B: shopping cart and check-out
separate teams → separate systems (Conway’s Law)
demo
client-side
includes
client-side includes
hinclude.js
https://github.com/mnot/hinclude/
2005 by Mark Nottingham (@mnot)
https://en.wikipedia.org/wiki/Mark_Nottingham
~150 LOC (not counting comments)
hinclude.js
<hx:include src="/path/to/include">
Fallback content here
</hx:include>
<hx:include src="/path/to/include" id="foo-include">
Refresh like this: hinclude.refresh("foo-include")
</hx:include>
h-include.js
custom element version of hinclude.js
https://github.com/gustafnk/h-include
custom element polyfill: 3KB
https://github.com/WebReflection/document-register-element
<h-include src="/path/to/include">
Fallback content here
</h-include>
includes in includes, etc etc
fix for flashy fallback content
<script>
<!-- https://gist.github.com/egeorjon/6755681 -->
document.documentElement.className = document.documentElement.className.replace( /(?:^|s)no-script(?!S)/g , '' )
</script>
<style>
h-include:not(.included) {
display: none;
}
.no-script h-include, h-include.included {
display: block;
}
</style>
server-side driven updates
domain events
<h-include src="/path/to/include">
<-- after inclusion -->
<div data-refresh-on="shopping-cart-item-added">
<p>Shopping cart: 0</p>
</div>
</h-include>
server: if(xhr): return domain event(s)
client: for each event:
for each subscribing element:
trigger refresh on parent h-include
demo
client code
summary
server-side web (with pjax and client-side includes)
✓ partials updates (pjax + client-side includes + server-side driven updates)
✓ better caching (client-side includes)
✓ cross-team components (client-side includes + server-side driven updates)
✗ enables richer interactions (do you really need them in all scenarios?)
thank you! thank you! thank you! thank you!
thank you! thank you! thank you! thank you!
thank you! thank you! thank you! thank you!
thank you! thank you! thank you! thank you!
thank you! thank you! thank you! thank you!
thank you! thank you! thank you! thank you!
thank you! thank you! thank you! thank you!
thank you! thank you! thank you! (@gustaf_nk)
https://github.com/gustafnk/static-web-shop-example
http://static-web-shop-example.netlify.com/
https://github.com/gustafnk/h-include
question: what about isomorphic web apps?
high language lock-in effect (probably javascript)
iso web apps != progressive enhancement
blocking vs non-blocking data flow (hard!)
time-to-meaningful-interaction (“Uncanny Valley”)
1KB JS == 1ms UI thread stall on mobile
your best devs busy not producing value
https://www.jayway.com/2016/05/23/6-reasons-isomorphic-web-apps-not-silver-bullet-youre-looking/

More Related Content

PDF
A Simpler Web App Architecture (jDays 2016)
PDF
Jayway Web Tech Radar 2015
PDF
HTML Hypermedia APIs and Adaptive Web Design - RuPy
PDF
Design Hypermedia APIs
PDF
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
PDF
HTML Hypermedia APIs and Adaptive Web Design - reject.js
PPTX
How to automate your BizTalk Installations and Deployments with Chef
PPTX
Host, deploy & scale Blazor Server Apps
A Simpler Web App Architecture (jDays 2016)
Jayway Web Tech Radar 2015
HTML Hypermedia APIs and Adaptive Web Design - RuPy
Design Hypermedia APIs
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - reject.js
How to automate your BizTalk Installations and Deployments with Chef
Host, deploy & scale Blazor Server Apps

What's hot (20)

PPTX
Building solutions with the SharePoint Framework - deep-dive
PDF
JAMstack
PPTX
Building solutions with the SharePoint Framework - introduction
PPTX
Single page application
PPTX
Building SPAs with AngularJS
PDF
JAMstack WTJ
PDF
Rise and Fall of the Frontend Developer
PPTX
WebAssembly
PPTX
Making Single Page Applications (SPA) faster
PPTX
Single Page Application (SPA) using AngularJS
PDF
WordPress: React Way
PPTX
PPTX
Pros and Cons of developing a Thick Clientside App
PPTX
Progressive web applications
PPTX
Modern SharePoint Development using Visual Studio Code
PPTX
Asp.net introduction
PDF
Server rendering-talk
PPTX
Codegen2021 blazor mobile
PDF
Refactoring to a Single Page Application
PDF
ITT Flisol 2013
Building solutions with the SharePoint Framework - deep-dive
JAMstack
Building solutions with the SharePoint Framework - introduction
Single page application
Building SPAs with AngularJS
JAMstack WTJ
Rise and Fall of the Frontend Developer
WebAssembly
Making Single Page Applications (SPA) faster
Single Page Application (SPA) using AngularJS
WordPress: React Way
Pros and Cons of developing a Thick Clientside App
Progressive web applications
Modern SharePoint Development using Visual Studio Code
Asp.net introduction
Server rendering-talk
Codegen2021 blazor mobile
Refactoring to a Single Page Application
ITT Flisol 2013
Ad

Similar to Simpler Web Architectures Now! (At The Frontend 2016) (20)

PDF
Bringing JAMStack to the Enterprise
PDF
Microservice Websites – Micro CPH
PPT
ASP.NET AJAX with Visual Studio 2008
PDF
Note of CGI and ASP
ODP
Html5
PDF
James Turner (Caplin) - Enterprise HTML5 Patterns
PPT
Web-Technologies 26.06.2003
PPTX
Building a website without a webserver on Azure
PDF
HTML5: An Introduction To Next Generation Web Development
PDF
Bringing the JAMstack to the Enterprise
PDF
Microservice Websites (microXchg 2017)
PPTX
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
PDF
Word camp nextweb
PDF
HTML5 Refresher
PPT
SynapseIndia asp.net2.0 ajax Development
PDF
Progressive web apps
PDF
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
PPTX
JS Fest 2019/Autumn. Александр Товмач. JAMstack
PPTX
Usability AJAX and other ASP.NET Features
Bringing JAMStack to the Enterprise
Microservice Websites – Micro CPH
ASP.NET AJAX with Visual Studio 2008
Note of CGI and ASP
Html5
James Turner (Caplin) - Enterprise HTML5 Patterns
Web-Technologies 26.06.2003
Building a website without a webserver on Azure
HTML5: An Introduction To Next Generation Web Development
Bringing the JAMstack to the Enterprise
Microservice Websites (microXchg 2017)
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Word camp nextweb
HTML5 Refresher
SynapseIndia asp.net2.0 ajax Development
Progressive web apps
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
JS Fest 2019/Autumn. Александр Товмач. JAMstack
Usability AJAX and other ASP.NET Features
Ad

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Machine learning based COVID-19 study performance prediction
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
KodekX | Application Modernization Development
PDF
NewMind AI Weekly Chronicles - August'25 Week I
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
20250228 LYD VKU AI Blended-Learning.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation_ Review paper, used for researhc scholars
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx
KodekX | Application Modernization Development
NewMind AI Weekly Chronicles - August'25 Week I

Simpler Web Architectures Now! (At The Frontend 2016)

  • 1. Simpler Web Architectures Now! Gustaf Nilsson Kotte @gustaf_nk
  • 2. Elevator pitch Show client-side techniques that make server-side rendering a feasible option for your web applications.
  • 3. client-side web benefits simpler deploys and operations (PaaS and server-less architectures too) partial updates fine-grained content caching (ajax) cross-team components enables richer interactions (...that are not even possible in classical web)
  • 4. client-side web challenges rate of change device diversity (especially on mobile) https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889/8 time-to-first-interaction (mobile, latency/bandwidth + CPU) AMP + Progressive Web Apps: Start fast, stay engaged - Google I/O 2016 interoperability and evolvability (single runtime, isolation vs small bundle size)
  • 6. techniques pjax → partial updates (HTML views over ajax) client-side includes (caching and reusable content) server-side driven updates (update state, application logic kept server-side)
  • 10. demo: web shop team A: products, static site (variations, related information) team B: shopping cart and check-out separate teams → separate systems (Conway’s Law)
  • 11. demo
  • 13. client-side includes hinclude.js https://github.com/mnot/hinclude/ 2005 by Mark Nottingham (@mnot) https://en.wikipedia.org/wiki/Mark_Nottingham ~150 LOC (not counting comments)
  • 14. hinclude.js <hx:include src="/path/to/include"> Fallback content here </hx:include> <hx:include src="/path/to/include" id="foo-include"> Refresh like this: hinclude.refresh("foo-include") </hx:include>
  • 15. h-include.js custom element version of hinclude.js https://github.com/gustafnk/h-include custom element polyfill: 3KB https://github.com/WebReflection/document-register-element <h-include src="/path/to/include"> Fallback content here </h-include> includes in includes, etc etc
  • 16. fix for flashy fallback content <script> <!-- https://gist.github.com/egeorjon/6755681 --> document.documentElement.className = document.documentElement.className.replace( /(?:^|s)no-script(?!S)/g , '' ) </script> <style> h-include:not(.included) { display: none; } .no-script h-include, h-include.included { display: block; } </style>
  • 17. server-side driven updates domain events <h-include src="/path/to/include"> <-- after inclusion --> <div data-refresh-on="shopping-cart-item-added"> <p>Shopping cart: 0</p> </div> </h-include> server: if(xhr): return domain event(s) client: for each event: for each subscribing element: trigger refresh on parent h-include
  • 18. demo
  • 21. server-side web (with pjax and client-side includes) ✓ partials updates (pjax + client-side includes + server-side driven updates) ✓ better caching (client-side includes) ✓ cross-team components (client-side includes + server-side driven updates) ✗ enables richer interactions (do you really need them in all scenarios?)
  • 22. thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! (@gustaf_nk) https://github.com/gustafnk/static-web-shop-example http://static-web-shop-example.netlify.com/ https://github.com/gustafnk/h-include
  • 23. question: what about isomorphic web apps? high language lock-in effect (probably javascript) iso web apps != progressive enhancement blocking vs non-blocking data flow (hard!) time-to-meaningful-interaction (“Uncanny Valley”) 1KB JS == 1ms UI thread stall on mobile your best devs busy not producing value https://www.jayway.com/2016/05/23/6-reasons-isomorphic-web-apps-not-silver-bullet-youre-looking/