Skip to content

refactor(table-core): remove SyntheticEvent persist() calls#6448

Open
conao3 wants to merge 1 commit into
TanStack:betafrom
conao3:remove-synthetic-event-persist
Open

refactor(table-core): remove SyntheticEvent persist() calls#6448
conao3 wants to merge 1 commit into
TanStack:betafrom
conao3:remove-synthetic-event-persist

Conversation

@conao3

@conao3 conao3 commented Jul 21, 2026

Copy link
Copy Markdown

🎯 Changes

Removes the (e as any).persist?.() calls from the sorting, expanding, resizing, and selection event handlers, plus the JSDoc / generated reference docs that described them.

persist() was a workaround for React's SyntheticEvent pooling, which was removed in React 17 (the method has been a deprecated no-op since then). v9 requires react >= 18, so these calls can't do anything anymore. Dropping them also removes 4 as any casts from table-core.

References:

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

Assisted-by: Claude Code:claude-fable-5

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Handlers for row selection, row expansion, sorting, and column resizing no longer call optional event.persist() methods. Documentation and tests were updated to remove persistence-specific statements and assertions.

Changes

Synthetic event persistence removal

Layer / File(s) Summary
Row selection event handling
packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts, packages/table-core/tests/implementation/features/row-selection/rowSelectionRange.test.ts, docs/reference/static-functions/functions/row_getToggleSelectedHandler.md
Row selection reads target.checked without persisting the event, and the persistence-specific test and documentation are removed.
Expansion and sorting toggle handlers
packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts, packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts, packages/table-core/tests/unit/features/row-expanding/*, packages/table-core/tests/unit/features/row-sorting/*, docs/reference/static-functions/functions/table_getToggleAllRowsExpandedHandler.md, docs/reference/static-functions/functions/column_getToggleSortingHandler.md
Expansion and sorting handlers no longer persist events; tests now assert state updates without persistence checks.
Column resize event handling
packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts
The resize-start handler no longer invokes optional event persistence.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: kevinvandy

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing SyntheticEvent persist() calls from table-core.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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