Skip to content

Conversation

@felixrieseberg
Copy link
Member

Summary

Upgrade React from 16.14 to 18.3 as a prerequisite for migrating from Blueprint.js to shadcn/ui.

Changes

Core React 18 migration

  • Upgraded react/react-dom from ^16.14.0 to ^18.3.1
  • Upgraded react-mosaic-component from ^4.1.1 to ^6.1.1
  • Upgraded @testing-library/react from ^12.1.5 to ^16.1.0
  • Migrated ReactDOM.render() to createRoot().render() in src/renderer/app.tsx
  • Added src/blueprint-react18.d.ts with module augmentations for Blueprint v3 children prop compatibility
  • Added @types/react resolution to prevent duplicate type versions

React 18 behavioral fixes

  • Fixed handleChannelChange in settings-electron.tsx to derive toggle from state instead of event.currentTarget.checked
  • Added null check for this.context?.mosaicActions in output.tsx

Test migration (Enzyme to RTL)

  • Removed enzyme, enzyme-adapter-react-16, enzyme-to-json and their @types packages
  • Migrated all 21 Enzyme test files to React Testing Library
  • Deleted 19 obsolete snapshot files
  • Added crypto.subtle polyfill in tests/setup.ts for jsdom compatibility
  • Fixed pre-existing RTL tests for React 18 compatibility (act, waitFor, MobX observer re-rendering)

Verification

  • tsc --noEmit: 0 errors
  • vitest run: 91 files, 805 passed, 0 failed
  • eslint: 0 errors
  • yarn start: app builds and launches successfully

@felixrieseberg felixrieseberg requested review from a team and codebytere as code owners February 9, 2026 19:20
Upgrade react/react-dom to ^18.3.1, react-mosaic-component to ^6.1.1,
and @testing-library/react to ^16.1.0. Migrate ReactDOM.render() to
createRoot(), add Blueprint v3 type augmentations for React 18
compatibility, remove Enzyme and migrate all 21 Enzyme test files to
React Testing Library. Fix React 18 behavioral changes in controlled
inputs and MobX observer re-rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@socket-security
Copy link

@coveralls
Copy link

Coverage Status

coverage: 77.931% (-0.6%) from 78.498%
when pulling 9b35f4d on felixr/react-18
into ee5c030 on main.

Copy link
Member

@dsanders11 dsanders11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we split off the test migrations into a separate PR? It'll be easier to tell which changes are only in service of the RTL migration, versus which changes are also part of the React 18 upgrade.

@felixrieseberg
Copy link
Member Author

Splitting into two separate PRs: one for React 18 upgrade, one for Enzyme→RTL test migration.

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.

3 participants