From 7bd4791272cb8b4d67c6b037e40a44db16f7a269 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 6 Aug 2026 08:59:26 +0000 Subject: [PATCH 1/2] feat(deps): update react-hook-form to v8 beta and re-enable React Compiler Bump the react-hook-form catalog entry to 8.0.0-beta.3 for sanity-plugin-media and sanity-plugin-dashboard-widget-vercel. v8 adds first-class React Compiler support, so the temporary 'use no memo' opt-out in the media asset details form is removed and the plugin ships fully compiled again. None of the v8 breaking changes affect this codebase: no useFieldArray, Watch component, watch(callback), or setValue on field arrays; the register() input-ref change is transparent to prop-spreading consumers. Also convert the remaining inline Footer/Header dialog components to plain JSX, dropping the react/react-compiler lint suppressions that pattern required. @hookform/resolvers has no v8-compatible release yet (peers ^7.0.0); the resolver contract is unchanged and works with the beta, so allow it via peerDependencyRules.allowedVersions. --- .changeset/media-react-hook-form-v8.md | 5 +++++ .../vercel-widget-react-hook-form-v8.md | 5 +++++ .../components/DialogAssetEdit/Details.tsx | 5 ----- .../src/components/DialogConfirm/index.tsx | 15 +++---------- .../components/DialogFolderCreate/index.tsx | 12 ++-------- .../src/components/DialogTagCreate/index.tsx | 12 ++-------- .../src/components/DialogTagEdit/index.tsx | 12 ++-------- pnpm-lock.yaml | 22 +++++++++---------- pnpm-workspace.yaml | 5 ++++- 9 files changed, 34 insertions(+), 59 deletions(-) create mode 100644 .changeset/media-react-hook-form-v8.md create mode 100644 .changeset/vercel-widget-react-hook-form-v8.md diff --git a/.changeset/media-react-hook-form-v8.md b/.changeset/media-react-hook-form-v8.md new file mode 100644 index 0000000000..046284d7ff --- /dev/null +++ b/.changeset/media-react-hook-form-v8.md @@ -0,0 +1,5 @@ +--- +"sanity-plugin-media": patch +--- + +Update react-hook-form to v8 (8.0.0-beta.3), which has first-class React Compiler support, and re-enable React Compiler for the asset details form. Dialog footers (and the confirm dialog header) are no longer declared as inline components, so they no longer remount whenever form state changes. diff --git a/.changeset/vercel-widget-react-hook-form-v8.md b/.changeset/vercel-widget-react-hook-form-v8.md new file mode 100644 index 0000000000..789a10409b --- /dev/null +++ b/.changeset/vercel-widget-react-hook-form-v8.md @@ -0,0 +1,5 @@ +--- +"sanity-plugin-dashboard-widget-vercel": patch +--- + +Update react-hook-form to v8 (8.0.0-beta.3) diff --git a/plugins/sanity-plugin-media/src/components/DialogAssetEdit/Details.tsx b/plugins/sanity-plugin-media/src/components/DialogAssetEdit/Details.tsx index 3c0fb19d9b..4a12503666 100644 --- a/plugins/sanity-plugin-media/src/components/DialogAssetEdit/Details.tsx +++ b/plugins/sanity-plugin-media/src/components/DialogAssetEdit/Details.tsx @@ -64,11 +64,6 @@ export default function Details({ creditLine, locales, }: DetailsProps) { - 'use no memo' - // React Compiler memoizes the register() field JSX using asset-derived deps only. - // That can leave Save stuck disabled while the DOM still updates (uncontrolled inputs). - // Tags work because they use Controller; string fields use register and need this opt-out. - const hasLocales = locales && locales.length > 0 const [activeLocaleTab, setActiveLocaleTab] = useState(0) const folderId = currentAsset?.opt?.media?.folder?._ref diff --git a/plugins/sanity-plugin-media/src/components/DialogConfirm/index.tsx b/plugins/sanity-plugin-media/src/components/DialogConfirm/index.tsx index c600a6b7a3..5b0dfcfe54 100644 --- a/plugins/sanity-plugin-media/src/components/DialogConfirm/index.tsx +++ b/plugins/sanity-plugin-media/src/components/DialogConfirm/index.tsx @@ -37,7 +37,7 @@ const DialogConfirm = (props: Props) => { handleClose() } - const Footer = () => ( + const footer = (