Skip to content

sampoder/prisma-day-2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Prisma, Next.js & ISR: Building Speedy Web Apps

Static Site Generation & Server Side Rendering each have an extensive list of benefits, what if we could combine them? Meet Incremental Static Regeneration and Next.js. In this talk we'll go over what ISR is, the benefits of ISR and how we can use Next.js' ISR with Prisma as well as why we should use it with Prisma. Best of all, we'll be exploring a practical application of Next.js, ISR & Prisma. After this lightning talk, your web pages will be faster than the speed of light.

I gave this talk at Prisma Day 2021, the recording is available here.

Some handy code samples are:

export async function getStaticPaths() {
  const { getUsers } = require('./api/users')
  let users = await getUsers(300)
  let paths = users.map(user => ({
    params: { username: user.name },
  }))
  return { paths, fallback: true }
}
export async function getStaticProps({ params }) {
  const { getRedemptions } = require(β€˜./api/[username]’)
  let initalRedemptions = await getRedemptions(params.username)
  return { 
    props: { initalRedemptions, username: params.username }, 
    revalidate: 30 
  }
}

More information is in the slides.

About

πŸ– An introduction workshop to Prisma & Next.js for Prisma Day 2021

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published