Template Specialization with Express Apps
Template specialization is a way to dynamically switch the partials in your views based on the request/response context. This becomes vital for big corporations like Paypal since we have cases where parts of the views are customized based on locale, device, user profile based A/B tests etc.This idea was born out of the work we did to support template specialization with
Krakenjs suite - the open sourced bootstrapping framework from Paypal. However, the idea is general enough to be implemented directly with vanilla express apps. This talk will demo template specialization in express apps with dust templates.
Dust is a powerful javascript template engine which works well with node.js, and also provides the hooks required to add this capability. Additionally, I will also go over the recipe to enable specialization for any template engine, provided the engine exposes the hooks to tap into the render work flow to do your magic!