FormidableLabs / nextjs-sanity-fe

NextJS Demo site with Sanity CMS
https://nextjs-sanity.formidable.dev/
29 stars 6 forks source link

use client wrapper on tsup #216

Closed nlkluth closed 8 months ago

nlkluth commented 8 months ago

What

Uses config to add 'use client'; to shared-ui lib

Why

These components are then compatible with RSC/Next

Future

It would be nice if this wasn't an all-or-nothing approach. Per component eluded my attempts. I think it may have to do with the single-file bundle 🤔

References

This is still early on so some better solutions may come about.

See: https://github.com/egoist/tsup/issues/835

Also: https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#advice-for-library-authors which references https://github.com/shuding/react-wrap-balancer/blob/main/tsup.config.ts#L10-L13

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nextjs-sanity-fe ✅ Ready (Inspect) Visit Preview Dec 15, 2023 6:22pm