A short talk on the whys and wherefores of server-rendered JavaScript apps, presented at ManhattanJS.
Server-Rendered JavaScript Apps
View Slide
Why Client-Side JavaScript?• Fast Navigation• Fast Data Access• Rich Interactivity• Coherent Programming Model
Why Server-Rendered?• Consistent Performance• Fast Initial Render• Web Crawlers/cURL
Can you get the best ofboth worlds?
“Progressive Enhancement”
“Progressive Enhancement”• Server render, then add behaviorusing JavaScript• No client-side routing• Complexity increases over time
Complexity grows exponentiallywith each new feature.
Progressive enhancement(as a technique) is dead.
But what if we could get the benefitsof progressive enhancement as aby-product of modern development?
FastBoot
It doesn’t replace yourexisting server.Point of Clarification
JSON dataGET /api/posts.jsonGET /postsBrowser CDNJS AppEmpty HTML, JavaScript (Big!)APIServer
Initial HTMLJSON dataGET /postsBrowser FastBootFirstPage APIServerJavaScriptJS App
Demo
github.com/tildeio/ember-cli-fastboot
Next Up: Rehydration
Rehydration• Show server-rendered HTML• Wait for JavaScript to load• JavaScript “takes over” once loaded• Side effect: Wicked fast re-renders(thanks to “virtual DOM”)
Thank You