theKashey / react-prerendered-component

🤔Partial hydration and caching in a pre-suspense era
174 stars 4 forks source link

Is there a ready-to-use solution that integrates this lib with next.js? #11

Open kostia1st opened 1 year ago

kostia1st commented 1 year ago

I'm interested in component caching and templatization that this lib claims to offer. However, an extra step seems to be required in order to use it with next.js, since next.js does not provide us with explicit code that writes HTML to response stream.

Am I missing something? Or if not, is there any 3rd party pre-built logic to integrate this lib with Next.js?

theKashey commented 1 year ago

NextJS provides two ways to tap into required logic - that would be middlewares(preferred) or custom server

However, you are right - without another piece connecting all the required dots that would be pretty hard to make it work. A very interesting task to solve 👍