Remove stega option from define live#3527
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 756bb58 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
199ef1e to
2c363fe
Compare
📚 TypeDoc Generation Result✅ TypeDoc generated successfully!
The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully. |
There was a problem hiding this comment.
Pull request overview
Removes deprecated defineLive configuration options (time-based fetchOptions revalidation and the top-level stega toggle), simplifying the server-side Live integration and documenting the breaking changes via changesets.
Changes:
- Remove
fetchOptionsandstegafromDefineLiveOptionsand adjust the React ServerdefineLiveimplementation accordingly. - Update
sanityFetchbehavior to no longer rely onfetchOptionsand to always auto-enable stega in draft mode whenclient.stega.studioUrlis configured (unless overridden per-call). - Add changesets describing both breaking changes; tweak an MVP layout to render a random number via a separate component.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/next-sanity/src/live/shared/types.ts | Removes fetchOptions and stega from DefineLiveOptions type surface. |
| packages/next-sanity/src/live/conditions/react-server/defineLive.tsx | Drops support for removed options and updates default stega/revalidate handling. |
| apps/mvp/app/(website)/PostsLayout.tsx | Refactors random number rendering into a separate component. |
| .changeset/puny-pants-take.md | Major changeset documenting removal of fetchOptions from defineLive. |
| .changeset/eager-wasps-rest.md | Major changeset documenting removal of stega from defineLive. |
Comments suppressed due to low confidence (1)
packages/next-sanity/src/live/conditions/react-server/defineLive.tsx:135
revalidateis now hard-coded tofalse, whereas it previously defaulted toundefinedin non-production. This changes caching semantics (especially during local development) even when users are not opting into time-based revalidation. Consider keeping the previousprocess.env.NODE_ENV === 'production' ? false : undefineddefault while still removingfetchOptionssupport.
const perspective = _perspective ?? (await resolveCookiePerspective())
const useCdn = perspective === 'published'
const revalidate = false
const isBuildPhase = process.env['NEXT_PHASE'] === PHASE_PRODUCTION_BUILD
const cacheMode = useCdn && !isBuildPhase ? 'noStale' : undefined
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Cody Olsen <81981+stipsan@users.noreply.github.com>
Split from #3109