Skip to content

feat(react): support React 19 with lifecycle compatibility tests - #84

Open
siddontang wants to merge 1 commit into
tidbcloud:mainfrom
siddontang:feat/react-19-compatibility
Open

siddontang wants to merge 1 commit into
tidbcloud:mainfrom
siddontang:feat/react-19-compatibility

Conversation

@siddontang

Copy link
Copy Markdown

The React wrapper currently rejects React 19 through its ^18.3.1 peer range, although its hooks and CodeMirror integration can support both versions. This change supports ^18.3.1 || ^19.0.0, uses the automatic JSX runtime in tests, and adds a CI matrix for React/React DOM 18.3.1, 19.0.0, and 19.3.1 with matching React types. Each job verifies the actual loaded runtime version and type-checks the wrapper.

Lifecycle regressions found during compatibility testing are fixed too: deleting or clearing a cache now destroys its CodeMirror views, and component cleanup safely detaches the captured DOM node. A mounted provider still preserves edits when switching files; standalone editors and unmounted providers dispose their views. The README documents ownership and disposal, and a Changeset covers the React wrapper and core package.

Validation:

  • All three matrix versions: wrapper/dependency build and 18 core/React tests passed locally, including normal/StrictMode mounts, editing, cached documents, theme/dialect changes, and cleanup.
  • Default React 18 development checkout: full pnpm build passed, including Vite, Next.js, and Vue playgrounds.
  • Full pnpm exec jest --runInBand: 11 suites / 40 tests passed.
  • Changed-file Prettier check, repository pre-commit hooks, and git diff --check passed.
  • The new cleanup tests failed against the original implementation before the fix.

This compatibility claim is limited to the SQL editor. It does not upgrade the playgrounds or establish React 19 support for unrelated UIKit dependencies. Existing Rollup external-dependency and TS5096 warnings remain unchanged.

Signed-off-by: siddon <siddontang@gmail.com>
@pingcap-cla-assistant

pingcap-cla-assistant Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot Bot added the size/XL label Oct 27, 2026
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.

1 participant