Server side view rendering - dry-view

Oskar Szrajer
Oskar SzrajerSoftware Developer
VIEW RENDERING
OSKAR SZRAJER - @GOTAR
SERVER SIDE VIEW RENDERING
PAST AND PRESENT
▸ Controllers
▸ Helpers
▸ Templates
SERVER SIDE VIEW RENDERING
PAST AND PRESENT
▸ Controllers

(Too many responsibilities)
▸ Helpers
▸ Templates

SERVER SIDE VIEW RENDERING
PAST AND PRESENT
▸ Controllers

(Too many responsibilities)
▸ Helpers

(Disorganised, mostly gross)
▸ Templates

SERVER SIDE VIEW RENDERING
PAST AND PRESENT
▸ Controllers

(Too many responsibilities)
▸ Helpers

(Disorganised, mostly gross)
▸ Templates

(Cluttered, too much logic)
SERVER SIDE VIEW RENDERING
PAST AND PRESENT
▸ Controllers

(Too many responsibilities)
▸ Helpers

(Disorganised, mostly gross)
▸ Templates

(Cluttered, too much logic)
▸ Decorators?

SERVER SIDE VIEW RENDERING
PAST AND PRESENT
▸ Controllers

(Too many responsibilities)
▸ Helpers

(Disorganised, mostly gross)
▸ Templates

(Cluttered, too much logic)
▸ Decorators?

(Friction, limited)

DRY-VIEW
SERVER SIDE VIEW RENDERING
DRY-VIEW
▸ Views as objects
class Show < Dry::View
end
view = Show.new
class Show < Dry::View
attr_reader :article_repo
def initialize(article_repo:)
@article_repo = article_repo
end
end
view = Show.new(article_repo: repo)
SERVER SIDE VIEW RENDERING
DRY-VIEW
▸ Views as objects
▸ Explicit template locals
class Show < Dry::View
config.template = “articles/show”
expose :article do |slug:|
article_repo.find_by_slug(slug)
end
end
view = Show.new(article_repo: repo)
SERVER SIDE VIEW RENDERING
DRY-VIEW
▸ Views as objects
▸ Explicit template locals
▸ Templates
/ Template written in Slim
h1 = article.title
view = Show.new(article_repo: repo)
view.call(
slug: “together-breakfast”,
).to_s
#=> “<h1>Together breakfast</h1>”
h1 = article.title
== markdown(article.body)
h1 = article.title
== article.body_html
SERVER SIDE VIEW RENDERING
DRY-VIEW
▸ Views as objects
▸ Explicit template locals
▸ Templates
▸ View logic on decorated values
class Parts::Article < Dry::View::Part
def body_html
render_markdown(body)
end
private
def render_markdown(str)
# …
end
end
class Show < Dry::View
config.template = “articles/show”
config.part_namespace = Parts
expose :article # => Parts::Article
end
h1 = article.title
== article.body_html
.share-widget[
data-share-url=article.url
data-share-title=article.title
data-share-body=article.body_preview_text
]
h1 = article.title
== article.body_html
== render(:share_widget,
url: article.url,
title: article.title,
preview_text: article.body_preview_text)
class Parts::Article < Dry::View::Part
def share_widget
render(
:share_widget,
url: article.url,
title: article.title,
preview_text: article.body_preview_text)
end
end
h1 = article.title
== article.body_html
== article.share_widget
== render(:related_article, article: article)
- show_author = defined?(show_autor) ? show_author : false
- link_prefix = defined?(link_prefix) ? link_prefix : “Related: ”
.related-article
a href=article.url = “#{link_prefix} #{article.title}”
- if show_author
.author …
class Scopes::RelatedArticle < Dry::View::Scope
def show_author?
locales.fetch(:show_author, false)
end
def link_text
prexif = locals.fetch(:link_prefix, “Related:”)
“#{prefix} #{article.title}”
end
end
.related-article
a href=article.url = link_text
- if show_author?
.author …
== scope(:related_article, article: article).render
class Context < Dry::View::Context
def initialize(assets:, **)
@assets = assets
super
end
def asset_path(asset_name)
@assets[asset_name]
end
end
img src=asset_path(“header.png”)
h1 = article.title
== article.body_html
== article.share_widget
class Parts::Article < Dry::View::Part
def feature_image_url
url = value.future_image_url
url || asset_path(“article.png”)
end
end
SERVER SIDE VIEW RENDERING
VIEW CONCEPTS
▸ View

(config, dependencies, exposures)
SERVER SIDE VIEW RENDERING
VIEW CONCEPTS
▸ View

(config, dependencies, exposures)
▸ Exposures

(prepare values)
SERVER SIDE VIEW RENDERING
VIEW CONCEPTS
▸ View

(config, dependencies, exposures)
▸ Exposures

(prepare values)
▸ Template & partials

(markup)
SERVER SIDE VIEW RENDERING
VIEW CONCEPTS
▸ View

(config, dependencies, exposures)
▸ Exposures

(prepare values)
▸ Template & partials

(markup)
▸ Parts

(behaviour on values)
SERVER SIDE VIEW RENDERING
VIEW CONCEPTS
▸ View

(config, dependencies, exposures)
▸ Exposures

(prepare values)
▸ Template & partials

(markup)
▸ Parts

(behaviour on values)
▸ Scopes

(behaviour for templates)
SERVER SIDE VIEW RENDERING
VIEW CONCEPTS
▸ View

(config, dependencies, exposures)
▸ Exposures

(prepare values)
▸ Template & partials

(markup)
▸ Parts

(behaviour on values)
▸ Scopes

(behaviour for templates)
▸ Context

(baseline rendering environment)
SERVER SIDE VIEW RENDERING
WHAT HAVE WE LEARNT (GAIN)?
▸ Separation of concerns
▸ Encapsulation
▸ Immutability
▸ Testability
DRY-VIEW!
OSKAR SZRAJER - @GOTAR
1 of 41

Recommended

Beyond MVC by
Beyond MVCBeyond MVC
Beyond MVCOskar Szrajer
178 views16 slides
1 year with ROM on production by
1 year with ROM on production1 year with ROM on production
1 year with ROM on productionOskar Szrajer
1K views32 slides
Rails Girls by
Rails GirlsRails Girls
Rails GirlsOskar Szrajer
296 views7 slides
Beyond MVC, intruduction to Service Object by
Beyond MVC, intruduction to Service ObjectBeyond MVC, intruduction to Service Object
Beyond MVC, intruduction to Service ObjectOskar Szrajer
871 views7 slides
ChatGPT and the Future of Work - Clark Boyd by
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
23.4K views69 slides
Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
5.6K views22 slides

More Related Content

Recently uploaded

BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports by
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsRa'Fat Al-Msie'deen
8 views49 slides
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Lisi Hocke
30 views124 slides
Myths and Facts About Hospice Care: Busting Common Misconceptions by
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common MisconceptionsCare Coordinations
5 views1 slide
The Era of Large Language Models.pptx by
The Era of Large Language Models.pptxThe Era of Large Language Models.pptx
The Era of Large Language Models.pptxAbdulVahedShaik
5 views9 slides
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... by
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...TomHalpin9
6 views29 slides
Software evolution understanding: Automatic extraction of software identifier... by
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...Ra'Fat Al-Msie'deen
9 views33 slides

Recently uploaded(20)

BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports by Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke30 views
Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... by TomHalpin9
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
TomHalpin96 views
Software evolution understanding: Automatic extraction of software identifier... by Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
Fleet Management Software in India by Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable11 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski10 views
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols by Deltares
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - DolsDSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
Deltares7 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 views
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... by Deltares
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
Deltares7 views
AI and Ml presentation .pptx by FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8711 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm14 views
FIMA 2023 Neo4j & FS - Entity Resolution.pptx by Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j7 views
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J... by Deltares
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
Deltares9 views
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the... by Deltares
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
Deltares6 views
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action by Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok5 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 views
Generic or specific? Making sensible software design decisions by Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions

Featured

Introduction to Data Science by
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.2K views51 slides
Time Management & Productivity - Best Practices by
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.7K views42 slides
The six step guide to practical project management by
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
36.6K views27 slides
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
12.6K views21 slides
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
55.5K views138 slides
12 Ways to Increase Your Influence at Work by
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
401.7K views64 slides

Featured(20)

Time Management & Productivity - Best Practices by Vit Horky
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky169.7K views
The six step guide to practical project management by MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.6K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by RachelPearson36
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson3612.6K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.5K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.7K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.2K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.4K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.4K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -... by AccuraCast
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
AccuraCast3.4K views
Exploring ChatGPT for Effective Teaching and Learning.pptx by Stan Skrabut, Ed.D.
Exploring ChatGPT for Effective Teaching and Learning.pptxExploring ChatGPT for Effective Teaching and Learning.pptx
Exploring ChatGPT for Effective Teaching and Learning.pptx
Stan Skrabut, Ed.D.57.7K views
How to train your robot (with Deep Reinforcement Learning) by Lucas García, PhD
How to train your robot (with Deep Reinforcement Learning)How to train your robot (with Deep Reinforcement Learning)
How to train your robot (with Deep Reinforcement Learning)
Lucas García, PhD42.5K views

Server side view rendering - dry-view

  • 2. SERVER SIDE VIEW RENDERING PAST AND PRESENT ▸ Controllers ▸ Helpers ▸ Templates
  • 3. SERVER SIDE VIEW RENDERING PAST AND PRESENT ▸ Controllers
 (Too many responsibilities) ▸ Helpers ▸ Templates

  • 4. SERVER SIDE VIEW RENDERING PAST AND PRESENT ▸ Controllers
 (Too many responsibilities) ▸ Helpers
 (Disorganised, mostly gross) ▸ Templates

  • 5. SERVER SIDE VIEW RENDERING PAST AND PRESENT ▸ Controllers
 (Too many responsibilities) ▸ Helpers
 (Disorganised, mostly gross) ▸ Templates
 (Cluttered, too much logic)
  • 6. SERVER SIDE VIEW RENDERING PAST AND PRESENT ▸ Controllers
 (Too many responsibilities) ▸ Helpers
 (Disorganised, mostly gross) ▸ Templates
 (Cluttered, too much logic) ▸ Decorators?

  • 7. SERVER SIDE VIEW RENDERING PAST AND PRESENT ▸ Controllers
 (Too many responsibilities) ▸ Helpers
 (Disorganised, mostly gross) ▸ Templates
 (Cluttered, too much logic) ▸ Decorators?
 (Friction, limited)

  • 9. SERVER SIDE VIEW RENDERING DRY-VIEW ▸ Views as objects
  • 10. class Show < Dry::View end view = Show.new
  • 11. class Show < Dry::View attr_reader :article_repo def initialize(article_repo:) @article_repo = article_repo end end view = Show.new(article_repo: repo)
  • 12. SERVER SIDE VIEW RENDERING DRY-VIEW ▸ Views as objects ▸ Explicit template locals
  • 13. class Show < Dry::View config.template = “articles/show” expose :article do |slug:| article_repo.find_by_slug(slug) end end view = Show.new(article_repo: repo)
  • 14. SERVER SIDE VIEW RENDERING DRY-VIEW ▸ Views as objects ▸ Explicit template locals ▸ Templates
  • 15. / Template written in Slim h1 = article.title
  • 16. view = Show.new(article_repo: repo) view.call( slug: “together-breakfast”, ).to_s #=> “<h1>Together breakfast</h1>”
  • 17. h1 = article.title == markdown(article.body)
  • 18. h1 = article.title == article.body_html
  • 19. SERVER SIDE VIEW RENDERING DRY-VIEW ▸ Views as objects ▸ Explicit template locals ▸ Templates ▸ View logic on decorated values
  • 20. class Parts::Article < Dry::View::Part def body_html render_markdown(body) end private def render_markdown(str) # … end end
  • 21. class Show < Dry::View config.template = “articles/show” config.part_namespace = Parts expose :article # => Parts::Article end
  • 22. h1 = article.title == article.body_html .share-widget[ data-share-url=article.url data-share-title=article.title data-share-body=article.body_preview_text ]
  • 23. h1 = article.title == article.body_html == render(:share_widget, url: article.url, title: article.title, preview_text: article.body_preview_text)
  • 24. class Parts::Article < Dry::View::Part def share_widget render( :share_widget, url: article.url, title: article.title, preview_text: article.body_preview_text) end end
  • 25. h1 = article.title == article.body_html == article.share_widget
  • 27. - show_author = defined?(show_autor) ? show_author : false - link_prefix = defined?(link_prefix) ? link_prefix : “Related: ” .related-article a href=article.url = “#{link_prefix} #{article.title}” - if show_author .author …
  • 28. class Scopes::RelatedArticle < Dry::View::Scope def show_author? locales.fetch(:show_author, false) end def link_text prexif = locals.fetch(:link_prefix, “Related:”) “#{prefix} #{article.title}” end end
  • 29. .related-article a href=article.url = link_text - if show_author? .author …
  • 31. class Context < Dry::View::Context def initialize(assets:, **) @assets = assets super end def asset_path(asset_name) @assets[asset_name] end end
  • 32. img src=asset_path(“header.png”) h1 = article.title == article.body_html == article.share_widget
  • 33. class Parts::Article < Dry::View::Part def feature_image_url url = value.future_image_url url || asset_path(“article.png”) end end
  • 34. SERVER SIDE VIEW RENDERING VIEW CONCEPTS ▸ View
 (config, dependencies, exposures)
  • 35. SERVER SIDE VIEW RENDERING VIEW CONCEPTS ▸ View
 (config, dependencies, exposures) ▸ Exposures
 (prepare values)
  • 36. SERVER SIDE VIEW RENDERING VIEW CONCEPTS ▸ View
 (config, dependencies, exposures) ▸ Exposures
 (prepare values) ▸ Template & partials
 (markup)
  • 37. SERVER SIDE VIEW RENDERING VIEW CONCEPTS ▸ View
 (config, dependencies, exposures) ▸ Exposures
 (prepare values) ▸ Template & partials
 (markup) ▸ Parts
 (behaviour on values)
  • 38. SERVER SIDE VIEW RENDERING VIEW CONCEPTS ▸ View
 (config, dependencies, exposures) ▸ Exposures
 (prepare values) ▸ Template & partials
 (markup) ▸ Parts
 (behaviour on values) ▸ Scopes
 (behaviour for templates)
  • 39. SERVER SIDE VIEW RENDERING VIEW CONCEPTS ▸ View
 (config, dependencies, exposures) ▸ Exposures
 (prepare values) ▸ Template & partials
 (markup) ▸ Parts
 (behaviour on values) ▸ Scopes
 (behaviour for templates) ▸ Context
 (baseline rendering environment)
  • 40. SERVER SIDE VIEW RENDERING WHAT HAVE WE LEARNT (GAIN)? ▸ Separation of concerns ▸ Encapsulation ▸ Immutability ▸ Testability