Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Static Site Generators with JavaScript

Static Site Generators with JavaScript

Statically generated sites have been getting more and more popular - from personal websites and blogs to real products and companies. This talk will give an overview of the main JavaScript based Static Site Generators as well as delving deeper into our experience with migrating to and running React Static in production for the past half year.

Nikas Praninskas

November 16, 2018
Tweet

More Decks by Nikas Praninskas

Other Decks in Programming

Transcript

  1. Hostmaker.com - 6 months ago • Slow-ish • Legacy stack

    ◦ Slow builds (25+ min) ◦ Difficult deployment • Needed a brand refresh It was time for a rewrite
  2. Challenges • Tons of unique content ◦ 9 cities +

    6 country hubs ◦ 2+ languages each ◦ 15+ "templates" • Dynamically generated content ◦ PhraseApp ◦ Cosmic JS ◦ Greenhouse ◦ Our own API • Search Engine Optimisation • Page Speed 1500+ unique pages
  3. Why? • Blazing fast ◦ No waiting for content, no

    loading screens • Once it's up, it's up ◦ No moving parts • Easy deployment ◦ Just upload everything to a CDN (i.e. AWS S3) ◦ Scaling -> just "add more CDN" • Great dev experience ◦ Reproducible builds -> easy debugging User Website API
  4. "React-Static is a fast, lightweight, and powerful framework for building

    static-progressive React applications and websites." • The promise of the power of Gatsby without the complexity • It's just React, which means it's just JavaScript
  5. What went well - Very customisable • CSS modules •

    Imgix • Translations and localized content • Dynamic signup flow • User sessions • Custom webpack config
  6. What went well - Did everything it had to •

    Great performance out of the box ◦ Code splitting ◦ Lazy loading • Great developer experience • Started with 500 pre-built pages, now up to 1500+ • Loading data from 12+ endpoints at build time • Around 4 minutes to build and deploy everything • Can scale long term
  7. What did not go well - It's different • Even

    though there's no "server", there's still a build step run via Node • Can't always use the obvious solution • Make sure to read the docs
  8. JAMstack "Modern web development architecture based on client-side JavaScript, reusable

    APIs, and prebuilt Markup." JS API .html build .css .js Markup - jamstack.org
  9. Other people are doing it too "SmashingMagazine.com is now much

    faster, they went from 800 ms time to first load to 80ms." - www.netlify.com/case-studies/smashing/