Skip to content

Remove refreshOnMount prop from <SanityLive>#3493

Merged
stipsan merged 1 commit into
mainfrom
remove-refreshOnMount
May 8, 2026
Merged

Remove refreshOnMount prop from <SanityLive>#3493
stipsan merged 1 commit into
mainfrom
remove-refreshOnMount

Conversation

@stipsan
Copy link
Copy Markdown
Member

@stipsan stipsan commented May 8, 2026

It's an under-utilized feature, we've never used it internally and neither do our customers.

Copilot AI review requested due to automatic review settings May 8, 2026 13:08
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 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 8, 2026 1:09pm
next-sanity-static Ready Ready Preview, Comment May 8, 2026 1:09pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: 1357f3c

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 8, 2026

📚 TypeDoc Generation Result

TypeDoc generated successfully!

  • File size: 2.5M
  • Total exports: 261
  • Artifact: typedoc-82f78c12f8c00700ec06f6764a75e37f346ae101
  • HTML docs preview: Download artifact

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

/**
* Automatic refresh of RSC when the component <SanityLive /> is mounted.
* Note that this is different from revalidation, which is based on tags and causes `sanityFetch` calls to be re-fetched.
* @defaultValue `true`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wow, all this time the doc block has been wrong and specified it's true by default, when it's in fact false 🤦

@stipsan stipsan merged commit 0f1d162 into main May 8, 2026
13 checks passed
@stipsan stipsan deleted the remove-refreshOnMount branch May 8, 2026 13:10
@squiggler-app squiggler-app Bot mentioned this pull request May 8, 2026
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 the underused refreshOnMount API from the live preview <SanityLive /> component and deletes the internal implementation that supported it, with a major changeset documenting the breaking change.

Changes:

  • Remove refreshOnMount from public/typed props and stop threading it through defineLive<SanityLive />.
  • Delete the RefreshOnMount client component and its conditional render path.
  • Update related changesets (add a major changeset for the removal; minor edits to other release notes).

Reviewed changes

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

Show a summary per file
File Description
packages/next-sanity/src/live/shared/types.ts Removes refreshOnMount from the shared live props type.
packages/next-sanity/src/live/conditions/react-server/defineLive.tsx Stops destructuring/passing refreshOnMount into the client component.
packages/next-sanity/src/live/client-components/SanityLive.tsx Drops the prop/default and removes the <RefreshOnMount /> render path; switches RefreshOnInterval to a static import.
packages/next-sanity/src/live/client-components/RefreshOnMount.tsx Removes the now-unused implementation entirely.
packages/next-sanity/src/live/client-components/RefreshOnInterval.tsx Adds 'use client' and changes to a named export (RefreshOnInterval).
.changeset/sixty-ties-pick.md Frontmatter quoting tweak (release note formatting).
.changeset/plain-lines-throw.md Adds a major changeset describing the breaking change and a migration snippet.
.changeset/hip-pandas-retire.md Adjusts example import paths in release notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Create a new `RefreshOnMount` component:

```tsx
// app/RefreshOnMount.tsx
```diff
// app/layout.tsx
import {SanityLive} from '#sanity/live'
+import {DebugStatus} from './RefreshOnMount'
Comment on lines +52 to +55
- <SanityLive refreshOnMount />
+ <SanityLive />
+ <RefreshOnMount />
</>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants