Remove refreshOnFocus prop from <SanityLive>#3495
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7143707 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 |
📚 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 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
refreshOnFocusfrom the publicDefinedLivePropstype and fromdefineLiveprop plumbing. - Deleted the client-side
RefreshOnFocusimplementation and stopped dynamically importing/rendering it fromSanityLive. - 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) |
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.