Skip to content

Conversation

@CarlaCostea
Copy link
Contributor

Summary

This PR migrates the codebase to React 18 and Material-UI v7, upgrades ESLint to v8, and completes the migration from Enzyme to React Testing Library.

Major Changes

React & Material-UI Migration

  • Migrate all packages to React 18.2.0
  • Upgrade from @material-ui/core to @mui/material v7.3.4
  • Upgrade from @material-ui/icons to @mui/icons-material v7.3.4
  • Update Emotion dependencies (@emotion/react v11.14.0, @emotion/styled v11.14.1) required by MUI v7
  • Update component APIs and imports for MUI v7 compatibility
  • Replace deprecated Material-UI components with their MUI v7 equivalents
  • Update styling approach to use MUI's styled API and Emotion

ESLint Upgrade

  • Upgrade ESLint from v5 to v8.57.0
  • Migrate to @babel/eslint-parser for Babel syntax support
  • Update eslint-plugin-react to v7.34.0
  • Remove Prettier integration from ESLint config (Prettier runs separately via pretty-quick)

ESLint Fixes

  • Fix no-prototype-builtins errors: Replace obj.hasOwnProperty() with Object.prototype.hasOwnProperty.call()
  • Add missing PropTypes validations across all React components
  • Remove unused variables and imports
  • Fix quote style inconsistencies

Test Infrastructure

  • Complete migration from Enzyme to React Testing Library
  • Update test utilities and Jest configuration for React 18
  • Fix broken test utilities (renderWithProviders, PropTypes)
  • Remove ReactDOM.findDOMNode usage

CarlaCostea and others added 30 commits October 13, 2025 14:41
feat: migrate ReactDOM.render to createRoot for React 18 compatibility
…into feat/PD-5258

merge remote into current.
CarlaCostea and others added 21 commits December 11, 2025 13:05
fix: fix math rendering issues after React, mui and drag upgrade for drag-in-the-blank
Add proper ESM package.json structure to enable loading in pie-esm-player:
- Add "type": "module" for ESM package declaration
- Add "sideEffects": false for better tree-shaking
- Add "exports" field with three subpaths:
  - "." for main element (student view)
  - "./controller" for server-side controller
  - "./configure" for authoring interface
- Maintain backward compatibility with CommonJS via dual exports

Elements updated:
categorize, charting, complex-rubric, ebsr, fraction-model, graphing,
graphing-solution-set, hotspot, image-cloze-association, likert, match,
match-list, math-inline, matrix, number-line, passage, placement-ordering,
rubric, select-text

All elements now expose ESM builds from esm/ directory while maintaining
CommonJS builds in lib/ for backward compatibility.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…#2871)

- Update React to v18.2.0 and React DOM to v18.2.0
- Migrate tests from Enzyme to React Testing Library
- Migrate from ReactDOM.render to createRoot API
- Install and configure React Testing Library (@testing-library/react, jest-dom, dom)
- Update jest.config.js: setupFilesAfterEnv, jsdom environment, transform ES modules
- Upgrade ESLint from v5 to v8 with @babel/eslint-parser
- Fix ESLint errors: hasOwnProperty usage, missing PropTypes, unused variables
- Update Jest configuration
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.

6 participants