Skip to content

Conversation

@felixrieseberg
Copy link
Member

Summary

Upgrade React from 16.14 to 18.3 (prerequisite for shadcn/ui migration).

Changes

Dependencies

  • react/react-dom: ^16.14.0 → ^18.3.1
  • react-mosaic-component: ^4.1.1 → ^6.1.1
  • @testing-library/react: ^12.1.5 → ^16.1.0
  • @types/react/@types/react-dom: → ^18.3.0
  • Removed: enzyme, enzyme-adapter-react-16, enzyme-to-json, @types/enzyme*

Source changes

  • src/renderer/app.tsx: ReactDOM.render()createRoot().render()
  • src/renderer/components/settings-electron.tsx: Fix controlled checkbox input (React 18 behavioral change)
  • src/renderer/components/output.tsx: Null-safe this.context?.mosaicActions access
  • src/blueprint-react18.d.ts: Type augmentations for Blueprint v3 children prop compatibility

Test infrastructure

  • tests/setup.ts: Remove Enzyme config, add crypto.subtle polyfill for jsdom
  • vitest.config.ts: Remove enzyme-to-json serializer
  • Fix pre-existing RTL tests for React 18 compat (act(), waitFor(), MobX batching)

Enzyme test files

Enzyme has no React 18 adapter, so all 21 Enzyme test files + 18 snapshot files are deleted here. RTL replacements follow in #1850.

Verification

  • tsc --noEmit: 0 errors
  • vitest run: 70 files, 658 passed
  • yarn start: builds and launches

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 (no React 18 adapter) and delete Enzyme
test files — RTL replacements follow in a separate PR.

Source changes:
- src/renderer/app.tsx: createRoot() migration
- src/renderer/components/settings-electron.tsx: fix controlled input
- src/renderer/components/output.tsx: null-safe context access
- src/blueprint-react18.d.ts: Blueprint children prop augmentations
- tests/setup.ts: remove Enzyme config, add crypto.subtle polyfill

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

@coveralls
Copy link

Coverage Status

coverage: 60.567% (-17.9%) from 78.498%
when pulling 79bd10a on felixr/react-18-core
into ee5c030 on main.

@felixrieseberg
Copy link
Member Author

Splitting differently — RTL migration first, React 18 upgrade later.

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.

2 participants