Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Leaving jsps in the dust
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Veena Basavaraj
June 30, 2012
Technology
430
2
Share
Leaving jsps in the dust
LinkedIn moving to client templates for the web
Veena Basavaraj
June 30, 2012
More Decks by Veena Basavaraj
See All by Veena Basavaraj
Dust and web-performance at LinkedIn
vybs
1
210
CuriousCaseOfDust.pdf
vybs
1
300
Other Decks in Technology
See All in Technology
Hacobu Tech Deck
hacobu
PRO
0
130
巨大プラットフォームを進化させる「第3のROI」
recruitengineers
PRO
2
1.4k
弁護士ドットコム株式会社 エンジニア職向け 会社紹介資料
bengo4com
1
190
AWS Agent Registry の基礎・概要を理解する/aws-agent-registry-intro
ren8k
3
410
生成AIが変える SaaS の競争原理と弁護士ドットコムのプロダクト戦略
bengo4com
1
2.4k
Good Enough Types: Heuristic Type Inference for Ruby
riseshia
1
320
Claude Code を安全に使おう勉強会 / Claude Code Security Basics
masahirokawahara
12
38k
データを"持てない"環境でのアノテーション基盤設計
sansantech
PRO
1
150
Do Ruby::Box dream of Modular Monolith?
joker1007
1
360
AI時代における技術的負債への取り組み
codenote
1
1.8k
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
780
Building a Standalone Programming Environment
harukasan
PRO
1
100
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
How STYLIGHT went responsive
nonsquared
100
6.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Navigating Weather and Climate Data
rabernat
0
170
Amusing Abliteration
ianozsvald
1
160
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
190
Transcript
Leaving jsps in the dust @vybs
We are pi@linkedIn
front-end infrastructure
Goal(s)
In the beginning... Site-Speed Site-Scale +
What is the Problem?
But... Site-Speed Site-Scale Developer Velocity
Simple things should be dead easy
Build Quick, Iterate More
front-end infrastructure now became....
Static Vs Dynamic Jruby Node.js Grails
Anyone notice a bad pattern?
Do once, Do the same twice, Do the same thrice...!
How does this work effectively in mobile?
Still building heavy pages not apps
We created a few more problems indeed!
How did we solve them?
Unification • Javascript Templates, CDN caching • Write once •
JSON for data • One Standard • Event-ed Server as JSON Aggregator + JS V8 engine • Scale once
JavaScript templates • Evaluated tons, handlebars, dust, mustache • Good:
Simple, less logic, 4KB, precompiled to javascript, performance is a feature • Bad: None are mature enough, i18n/ formatters not out of the box
_t = “Hello {name}! You have {count} new messages from
{#people} {name}, {/people} ”; json = { "name": ”James", "count": 2, “people” : [{ “name” : “Jim”, “distance” : “2” },{ “name”: ”Eran” “distance” : “1”} ] } Hello James! You have 2 new messages from Jim, Eran! !dust.render(_t, json, function(error, data) {! $(“mydiv”).html(data);! }!
Dust - *less logic • Simple, DRY • loops, conditionals,
partials, inheritance {#people} {>”/path/degree_icon_{distance}”/} {/people}
Dust • Client Helpers for extensions, reusability • Rendering logic,
math, i18n • @if, @select, @lte, @ceil, @i18n, @form {#people} <li class="card {@select key=“distance”} {@lte value=“1”/} {@i18n text=“first degree”/} {@gt value=“1”/} {@i18n text=“second degree”/} {/select} </li> {/people}
! on client • Server side precompiled to JS •
Rendering times on client snappy
! on client • Server side processed helper tags •
auto-generate template dependencies {#people} {“>degree_icon”/} {/people}
! on client • Dust Preprocessed helper tags • leverage
JVM based i18n, formatting and A/B testing • creates template driven, context based JSON {#people} {@ss.fmt key=”fmt_name” type=“name” value=”{name}”/} {/people} {#people} {fmt_name} {/people} Client template/ js “people” : [{ “name” : “Joe Jada”, “fmt_name” : “Joe J”, “distance” : “2” },{ “name”: ”Jade Pink” “fmt_name” : “Jade P”, “distance” : “1”} ] } Server Source template uses
! on client • No javascript, SEO pages • Seamless
rendering of dust on the server using V8
data layer JSON JSON Browser UI /JSON Aggregator V8 Page
apps Module Module JSON CDN caching content delivery Static Assets static content js, css, templates linkedin.com
linkedin.com/people/pymk
we dust! https://github.com/linkedin/dustjs https://github.com/linkedin/Lu https://github.com/linkedin/inject