Skip to content

chore(deps): bump react-rx to v5.1.1 and adopt useObservable - #1820

Draft
stipsan wants to merge 4 commits into
mainfrom
cursor/upgrade-react-rx-v5-568c
Draft

chore(deps): bump react-rx to v5.1.1 and adopt useObservable#1820
stipsan wants to merge 4 commits into
mainfrom
cursor/upgrade-react-rx-v5-568c

Conversation

@stipsan

@stipsan stipsan commented Aug 3, 2026

Copy link
Copy Markdown
Member

Description

Mirrors the Sanity Studio react-rx upgrade stack (#13788#13799#13814#13828) for this plugins monorepo.

  • Catalog react-rx bumped ^4.2.5^5.1.1 (deferred useObservable with identity-coherent snapshot semantics; useSyncObservable available for sync reads)
  • @sanity/embeddings-index-ui switched to catalog:
  • Clean useState/useEffect+.subscribe() bridges migrated to useObservable:
    • @sanity/dashboard (SanityTutorials, ProjectInfo, ProjectUsers with retry via BehaviorSubject)
    • @sanity/assist / sanity-plugin-utils (useListeningQuery)
    • sanity-plugin-dashboard-widget-document-list
  • Existing preview/chrome call sites stay on deferred useObservable — none are controlled-input reads that need useSyncObservable
  • Event-driven mutation listeners left as-is; useObservablePromise not adopted (no shared Suspense/LoadingBlock setup)

Follow-up fix

useListeningQuery was recreating its observable whenever callers passed a fresh initialValue: [] (e.g. DeleteTranslationDialog), leaving the delete-translation e2e stuck on the wrong footer button. initialValue is now stabilized by deep equality; assist params/options are stabilized the same way.

Testing

  • pnpm format / pnpm lint / pnpm knip / pnpm build / pnpm test run
  • Related package vitests after the listening-query fix
  • E2E re-running after push
Open in Web Open in Cursor 

Upgrade the catalog to react-rx ^5.1.1 (identity-coherent deferred
useObservable) and migrate clean useEffect+subscribe RxJS bridges in
dashboard widgets, listening-query hooks, and the document-list widget
to useObservable. Existing preview/chrome call sites stay on deferred
useObservable; no controlled-input reads need useSyncObservable.
@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7e50fd8

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

This PR includes changesets to release 21 packages
Name Type
@sanity/assist Patch
@sanity/dashboard Patch
sanity-plugin-dashboard-widget-document-list Patch
@sanity/embeddings-index-ui Patch
@sanity/language-filter Patch
sanity-plugin-mux-input Patch
@sanity/studio-secrets Patch
sanity-plugin-utils Patch
sanity-plugin-internationalized-array Patch
sanity-plugin-dashboard-widget-netlify Patch
sanity-plugin-dashboard-widget-vercel Patch
sanity-plugin-cloudinary Patch
@sanity/cross-dataset-duplicator Patch
@sanity/personalization-plugin Patch
@sanity/sanity-plugin-async-list Patch
sanity-plugin-documents-pane Patch
sanity-plugin-workflow Patch
@sanity/document-internationalization Patch
@sanity/orderable-document-list Patch
@sanity/sfcc Patch
@sanity/form-toolkit Patch

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

@stipsan stipsan added the 🤖 bot label Aug 3, 2026 — with Cursor
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

✅ E2E Tests

🟢 24 passedview full reportview run

Studio: https://plugins-e2e-test-studio-g61nolhkj.sanity.dev

Datasets: pr-1820-chromium-30827732287, pr-1820-firefox-30827732287

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview Aug 3, 2026 3:30pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plugins-e2e-test-studio Ignored Ignored Aug 3, 2026 3:30pm

Request Review

react-rx v5's mount/deferral passes make Strict Mode double-invoke the
side-effectful useMemo that creates the secrets observable. Assert on
the observed document ID instead of an exact call count.
@socket-security

socket-security Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​react-rx@​5.1.11001008297100

View full report

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 32.06% 5512 / 17188
🔵 Statements 31.83% 5816 / 18267
🔵 Functions 27.79% 1428 / 5137
🔵 Branches 23.34% 2828 / 12115
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
plugins/@sanity/assist/src/_lib/fixedListenQuery.ts 13.04% 0% 0% 13.04% 36-41, 51-64, 74-112
plugins/@sanity/assist/src/_lib/useListeningQuery.ts 15% 0% 0% 18.75% 23-62
plugins/@sanity/dashboard/src/widgets/projectInfo/ProjectInfo.tsx 4% 0% 0% 4.16% 13-25, 35-203
plugins/@sanity/dashboard/src/widgets/projectUsers/ProjectUsers.tsx 2.63% 0% 0% 3.03% 12, 36-160
plugins/@sanity/dashboard/src/widgets/sanityTutorials/SanityTutorials.tsx 4.34% 0% 0% 4.34% 11-16, 26-80
plugins/sanity-plugin-dashboard-widget-document-list/src/DocumentList.tsx 10.71% 0% 0% 10.71% 59-165
plugins/sanity-plugin-dashboard-widget-document-list/src/sanityConnector.ts 4.76% 0% 0% 5.55% 5-59
plugins/sanity-plugin-utils/src/hooks/useListeningQuery.tsx 12.5% 0% 0% 13.63% 26-75
Generated in workflow #8606 for commit 7e50fd8 by the Vitest Coverage Report Action

Call sites like DeleteTranslationDialog pass a fresh `[]` each render.
Treating that as a useMemo dependency recreated the observable forever
and left the delete-translation dialog footer stuck on "Delete document"
instead of "Unset translation reference". Also stabilize assist's
params/options the same way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants