tatethurston / TwirpScript

A protobuf RPC framework for JavaScript and TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Nextjs 13 Fetch API

opened this issue · 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