Skip to content

Remove stega option from define live#3527

Merged
stipsan merged 2 commits into
mainfrom
remove-stega-option-from-defineLive
May 12, 2026
Merged

Remove stega option from define live#3527
stipsan merged 2 commits into
mainfrom
remove-stega-option-from-defineLive

Conversation

@stipsan
Copy link
Copy Markdown
Member

@stipsan stipsan commented May 12, 2026

Split from #3109

Copilot AI review requested due to automatic review settings May 12, 2026 14:12
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
next-sanity Ready Ready Preview, Comment May 12, 2026 2:19pm
next-sanity-static Ready Ready Preview, Comment May 12, 2026 2:19pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

🦋 Changeset detected

Latest commit: 756bb58

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
next-sanity Major

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📚 TypeDoc Generation Result

TypeDoc generated successfully!

  • File size: 2.5M
  • Total exports: 267
  • Artifact: typedoc-eb809aa24394674fc3a63f3958954dbe08606c0c
  • HTML docs preview: Download artifact

The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 fetchOptions and stega from DefineLiveOptions and adjust the React Server defineLive implementation accordingly.
  • Update sanityFetch behavior to no longer rely on fetchOptions and to always auto-enable stega in draft mode when client.stega.studioUrl is 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

  • revalidate is now hard-coded to false, whereas it previously defaulted to undefined in non-production. This changes caching semantics (especially during local development) even when users are not opting into time-based revalidation. Consider keeping the previous process.env.NODE_ENV === 'production' ? false : undefined default while still removing fetchOptions support.
    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.

Comment thread .changeset/eager-wasps-rest.md Outdated
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>
@stipsan stipsan requested a review from Copilot May 12, 2026 14:19
@stipsan stipsan merged commit 3572c9a into main May 12, 2026
13 checks passed
@stipsan stipsan deleted the remove-stega-option-from-defineLive branch May 12, 2026 14:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants