next-sanity
next-sanity copied to clipboard
`groq-js` may be incorrectly included in the client bundle
This issue stems from a community question regarding the client bundle size.
@chris-erickson pointed out that their next.js client build included groq-js.
groq-js
is expected to show up as a dependency to @sanity/groq-store
however it should be code-split and imported dynamically only when a sanity user is logged in.
This issue is an item to investigate that
Hey there has any progress been made on this / are there any work arounds people have found ?
We're working on a new version that lets you use React.lazy
or next/dynamic
to code-split away preview related code from your pages. Until they're actually needed :)
We've just released v2.0.0
which has a new preview mode that no longer includes groq-js
outside of previews 😌
@stipsan This is awesome y'all are killing it !! 🎊 💯