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

Universal React Apps Using Next.js (JazzCon)

Sia
March 23, 2018

Universal React Apps Using Next.js (JazzCon)

Every user’s hardware is different, and processing speed can hinder user experience on client-side rendered React applications. Server-side rendering and code-splitting can drastically improve user experience by minimizing the work that the client has to do. It’s easy to get lost in the lingo, so this presentation explores what it all means and how to easily build universal React apps using the Next.js framework. I walk through the concepts and use code examples to cement your understanding. You’ll get the most out of this if you’re comfortable with React and ES6 syntax.

Sia

March 23, 2018
Tweet

More Decks by Sia

Other Decks in Programming

Transcript

  1. Server- vs Client-Side Rendering Universal JavaScript Introducing Next.js How to

    learn more Overview ↑ code here ↑ @THEGREENGREEK
  2. “ ” Universal is a term used to emphasize the

    fact that a particular piece of JavaScript code is able to run in multiple environments. GERT HENGEVELD, SOFTWARE ENGINEER AT @XEBIA @THEGREENGREEK
  3. Next.js u Server-rendered by default u Automatic code splitting for

    faster page loads u Simple page-based client-side routing u Webpack-based dev environment, supporting hot module replacement u Customizable with your own Babel and Webpack configurations u Able to implement with Express or any other Node.js HTTP server BY ZEIT Next.js is a minimalistic framework for server-rendered or statically- exported React applications. @THEGREENGREEK
  4. Next.js provides an easy solution to the complexity of Universal

    JS u Rapid set-up – preconfigured Webpack + Babel that is still customizable u Less bloat & less opinionated than Create React App u Minimal convention framework where routes are defined by files in a /pages/ folder u Automatic code-splitting for each page in /pages/ u Can further optimize with lazy-loading modules and components u Can asynchronously load anticipated pages after the current page has rendered u Developer writes one set of (universal) code that the app runs on server or client, whichever is best for the current situation @THEGREENGREEK
  5. Resources u About Next.js https://zeit.co/blog/next u GitHub repo https://github.com/zeit/next.js/ u

    Tutorial https://learnnextjs.com u New version 3.0 details https://zeit.co/blog/next3 u “7 Principles of Rich Web Applications” by Guillermo Rauch, the inspiration for Next.js https://rauchg.com/2014/7-principles-of-rich- web-applications DON’T READ THIS SLIDE, GO TO: http://bit.ly/siaspeaks ! @THEGREENGREEK