next-sanity icon indicating copy to clipboard operation
next-sanity copied to clipboard

`groq-js` may be incorrectly included in the client bundle

Open ricokahler opened this issue 3 years ago • 2 comments

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

ricokahler avatar Jun 11 '21 16:06 ricokahler

Hey there has any progress been made on this / are there any work arounds people have found ?

scottgrunerud avatar Feb 21 '22 16:02 scottgrunerud

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 :)

stipsan avatar Aug 12 '22 17:08 stipsan

We've just released v2.0.0 which has a new preview mode that no longer includes groq-js outside of previews 😌

stipsan avatar Nov 16 '22 16:11 stipsan

@stipsan This is awesome y'all are killing it !! 🎊 💯

scottgrunerud avatar Nov 16 '22 16:11 scottgrunerud