tatethurston/TwirpScript

Support for Nextjs 13 Fetch API

frankwoodi opened this issue · 2 comments

In nextjs 13, static rendering, ISR and SSR is determined only by the arguments in fetch. Since we have no access to fetch API and it’s features this is impossible

import { GetHat } from ./generated.pb’

async function Component({id}) {
    const hat = await GetHat({ id }).config({
    next: {
         revalidate: 1000,
         tags: ['collection']
       },
    cache: “no-store”
    })

return (<p>{hat}</p>)
}

}

@frankwoodi did you checkout the rpcTransport option?

Thanks @tatethurston, I wrote a wrapper around it and it works fine