Skip to content

Replace effect-driven state updates in plugins - #4745

Merged
trevor-scheer merged 2 commits into
mainfrom
trevor/react-effect-cleanup
Nov 2, 2026
Merged

trevor-scheer merged 2 commits into
mainfrom
trevor/react-effect-cleanup

Conversation

@trevor-scheer

Copy link
Copy Markdown
Contributor

The dependency update exposed eight react/set-state-in-effect violations in collections and query builder. Those effects synchronize local state after rendering the previous editor/store snapshot, causing another render of the tree. This removes all eight suppressions and follows React's guidance on adjusting state.

The save form mounts with a fresh identity for each save request, including repeated requests with the same operation name. Query-builder document, target, and expansion changes are reconciled before children commit. It keeps the last valid document during incomplete edits, ignores the editor's echo of builder writes, and preserves manual collapse until another cursor event.

Effects remain for imperative cursor restoration, scrolling, and highlight expiration. A deleted-fragment cursor reset belongs to its originating editor, so replacing the editor can't replay it against a different tab.

@changeset-bot

changeset-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f5f2ab9

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

This PR includes changesets to release 2 packages
Name Type
@graphiql/plugin-collections Patch
@graphiql/plugin-query-builder 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

@trevor-scheer
trevor-scheer marked this pull request as ready for review November 2, 2026 02:33
@trevor-scheer
trevor-scheer merged commit a8393d0 into main Nov 2, 2026
14 checks passed
@trevor-scheer
trevor-scheer deleted the trevor/react-effect-cleanup branch November 2, 2026 02:34
@github-actions github-actions Bot mentioned this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant