Skip to content

Remove refreshOnFocus prop from <SanityLive>#3495

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

Remove refreshOnFocus prop from <SanityLive>#3495
stipsan merged 1 commit into
mainfrom
remove-refreshOnFocus

Conversation

@stipsan
Copy link
Copy Markdown
Member

@stipsan stipsan commented May 8, 2026

The motivation for removing this feature is that most users saw this as unexpected behavior, especially since when using browser debug tools window focus events trigger often and paired with how v16 behaves differently with link prefetching and the router.refresh() call it's bedt to remove it.

Copilot AI review requested due to automatic review settings May 8, 2026 14:00
@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 2:01pm
next-sanity-static Ready Ready Preview, Comment May 8, 2026 2:01pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: 7143707

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-dfc68b0d8c8460d423e95f498c03f8be1d32eea2
  • HTML docs preview: Download artifact

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

@stipsan stipsan merged commit 4630270 into main May 8, 2026
13 checks passed
@stipsan stipsan deleted the remove-refreshOnFocus branch May 8, 2026 14:02
@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 refreshOnFocus prop/behavior from <SanityLive> to avoid unexpected refreshes on window focus (notably when browser devtools trigger frequent focus events), and documents the breaking change with a major-version changeset.

Changes:

  • Removed refreshOnFocus from the public DefinedLiveProps type and from defineLive prop plumbing.
  • Deleted the client-side RefreshOnFocus implementation and stopped dynamically importing/rendering it from SanityLive.
  • Added a major changeset with migration guidance for reintroducing focus-refresh behavior manually.

Reviewed changes

Copilot reviewed 5 out of 5 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 refreshOnFocus from the public live props type.
packages/next-sanity/src/live/conditions/react-server/defineLive.tsx Stops accepting/passing refreshOnFocus into the client component.
packages/next-sanity/src/live/client-components/SanityLive.tsx Removes dynamic import/prop/default logic and no longer renders focus-refresh behavior.
packages/next-sanity/src/live/client-components/RefreshOnFocus.tsx Deletes the focus-based refresh component.
.changeset/thirty-zebras-slide.md Adds major release notes + migration snippet (contains a typo).

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

}
```

The motivation for removing this feature is that most users saw this as unexpected behavior, especially since when using browser debug tools window focus events trigger often and [paired with how v16 behaves differently with link prefetching and the `router.refresh()` call it's bedt to remove it.](https://github.com/vercel/next.js/issues/93210)
@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