Skip to content

Conversation

@camd
Copy link
Collaborator

@camd camd commented Jan 24, 2026

Post-React 19 upgrade:

Phase 2: Replace Inactive/Problematic Dependencies - COMPLETED ✅

Completed: January 2026

Summary

  1. react-highlight-words updated from 0.20.0 to 0.21.0
  2. react-lazylog tested with React 19 - works correctly (react-virtualized supports React 19)
  3. react-hot-keys tested with React 19 - works correctly (peer dep >=16.9.0)
  4. react-table-6 deferred to Phase 4 (works at runtime despite peer dep warning)
  5. react-linkify kept at 0.2.2 (1.0.0-alpha not production-ready)

2.1 react-lazylog Status

Current: 4.5.3 (INACTIVE - mozilla-frontend-infra marked as archived)
Usage: 2 files (ui/logviewer/App.jsx, ui/shared/tabs/LogviewerTab.jsx)
Status: ✅ Works with React 19

The original react-lazylog from Mozilla is no longer maintained, but its dependency react-virtualized explicitly supports React 19 (^16.3.0 || ^17.0.0 || ^18.0.0 || ^19.0.0). Build and tests pass.

Future: If issues arise, migrate to @melloware/react-logviewer.

2.2 react-table-6 Replacement (Deferred)

Current: 6.11.0 (peer dependency warning)
Usage: 5 files in ui/intermittent-failures/ and ui/perfherder/
Risk: High - Significant refactoring required

Status: Works at runtime despite peer dependency warning. Migration to TanStack Table v8 would require significant refactoring since it's headless (no built-in UI).

Recommendation: Defer to Phase 4. Document current behavior and monitor for actual issues.

2.3 react-highlight-words ✅

Updated: 0.20.0 → 0.21.0
Usage: 1 file (ui/shared/tabs/failureSummary/BugListItem.jsx)

2.4 react-linkify

Current: 0.2.2 → 1.0.0-alpha available
Usage: 2 files (ui/shared/RevisionLinkify.jsx, ui/shared/BugLinkify.jsx)

Status: Kept at 0.2.2. Alpha version is not production-ready.

2.5 react-hot-keys ✅

Current: 2.7.3
Usage: 1 file (ui/job-view/KeyboardShortcuts.jsx)
Status: Works with React 19 (peer dep >=16.9.0)

camd and others added 30 commits December 21, 2025 11:53
The withView HOC is a class component that expected location and history
props to be passed automatically by React Router. In React Router v6,
these are no longer passed - you must use hooks instead.

This caused the error: "Cannot read properties of undefined (reading 'state')"
at line 21: this.default = this.props.location.state || defaultState;

Fix by creating a ViewWithRouter wrapper component that:
- Uses useLocation() and useNavigate() hooks
- Injects location and navigate as props to the class component
- Creates a history-like object with push/replace for backwards compatibility

Also adds unit tests to verify the intermittent-failures routes render
correctly with React Router v6.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace the withView class-based Higher Order Component with a modern
useIntermittentFailuresData custom hook. This eliminates the need for
the ViewWithRouter wrapper and makes the code more readable and testable.

Changes:
- Create useIntermittentFailuresData.jsx custom hook that encapsulates
  all state management and data fetching logic
- Update MainView.jsx to use the hook directly instead of withView HOC
- Update BugDetailsView.jsx to use the hook directly instead of withView HOC
- Remove View.jsx (the old class-based HOC)
- Update tests to work with the new hook-based implementation

The hook uses:
- useState for state management (replacing this.state)
- useEffect for lifecycle (replacing componentDidMount)
- useCallback for memoized functions
- useRef for pending update tracking (replacing setState callbacks)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add Zustand dependency
- Create notificationStore.js with notify, clearNotification,
  clearExpiredNotifications, clearAllOnScreenNotifications actions
- Update 17 components to use Zustand notifications instead of Redux
- Export standalone notify function for use outside React components
- Remove notify from Redux connect() mapDispatchToProps in all components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Create Zustand pinnedJobsStore with all pinned jobs functionality
- Export standalone functions for use outside React components
- Migrate 7 components to use the new store:
  - PinBoard.jsx: Add Zustand subscription for class component reactivity
  - KeyboardShortcuts.jsx: Use standalone pinJob, unPinAll functions
  - DetailsPanel.jsx: Use setPinBoardVisible from Zustand
  - PushList.jsx: Use usePinnedJobsStore hook
  - PushHeader.jsx: Use standalone pinJobs function
  - PushJobs.jsx: Use standalone togglePinJob function
  - FiltersMenu.jsx: Use standalone pinJobs function
- Remove pinnedJobs state from Redux mapStateToProps in all components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Create selectedJobStore.js with Zustand implementation
- Migrate job selection, clearing, and URL-based selection
- Update all components to use Zustand selectedJobStore:
  - KeyboardShortcuts.jsx: Remove Redux connect, use store directly
  - DetailsPanel.jsx: Subscribe to Zustand, track selectedJob in state
  - PinBoard.jsx: Import setSelectedJob from Zustand store
  - TabsPanel.jsx: Use Zustand hooks for selectedJob
  - ActiveFilters.jsx: Use Zustand selectedJobStore
  - FiltersMenu.jsx: Use Zustand hooks
  - PushHeader.jsx: Import from Zustand store
  - PushJobs.jsx: Remove Redux connect, use memo only
  - PushList.jsx: Use Zustand for selectedJob

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Create comprehensive pushStore.js with:
- Nested jobs structure within pushes (jobs stored as push.jobs)
- Derived getters: getJobById, getJobByTaskRun, getPushJobs
- Actions: fetchPushes, pollPushes, updateRange, updatePushJobs
- Pre-calculated unclassified counts per push
- jobMap kept for compatibility during migration

Migrate all components from Redux connect to Zustand:
- PushList, Push, PushHeader, PushLoadErrors, PushActionMenu
- DetailsPanel, PinBoard, ActionBar, AnnotationsTab
- PerformanceTab, PerfData, SideBySide
- SecondaryNavBar, ActiveFilters
- CustomJobActions, BugFiler, InternalIssueFiler
- App.jsx (updated imports, removed useDispatch)

Class component pattern used: Zustand subscription in
componentDidMount/componentWillUnmount with state initialization
from usePushStore.getState()

All components now use Zustand instead of Redux for:
- pushList, jobMap, decisionTaskMap, bugSummaryMap
- loadingPushes, jobsLoaded
- allUnclassifiedFailureCount, filteredUnclassifiedFailureCount
- revisionTips

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add v7_startTransition and v7_relativeSplatPath future flags to
  BrowserRouter to eliminate deprecation warnings and prepare for
  React Router v7 migration
- Update react-19-upgrade-plan.md with verified dependency compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Document decision to replace react-helmet with React 19 native document
metadata support in a follow-up PR after the React 19 upgrade.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Upgrade react and react-dom from 18.3.1 to 19.2.3
- Move @types/react and @types/react-dom to devDependencies with ^19.0.0
- Fix test_data_modal_test.jsx: reset mock for each test to handle React 19's
  stricter state batching behavior

All 421 tests pass, build succeeds, lint passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
React 19 has built-in support for <title>, <meta>, and <link> tags that
automatically hoist to <head> when rendered anywhere in the component tree.

Updated files:
- ui/intermittent-failures/BugDetailsView.jsx
- ui/push-health/Health.jsx
- ui/push-health/MyPushes.jsx
- ui/shared/ComparePageTitle.jsx

Removed react-helmet dependency from package.json.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Mark React 19 upgrade as completed (18.3.1 → 19.2.3)
- Mark react-helmet replacement as completed
- Add replacement options for react-highlight-words:
  - Recommend keeping as-is (works at runtime)
  - Include custom implementation pattern if needed
- Add replacement options for react-table-6:
  - TanStack Table v8 (headless, official successor)
  - Material React Table (TanStack + MUI)
  - Mantine React Table (TanStack + Mantine)
  - AG Grid (most features)
  - Recommend keeping as-is for now

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
camd and others added 2 commits January 4, 2026 10:01
React Router v7 Migration:
- Update react-router-dom to [email protected]
- Update imports in 32 source files and 21 test files
- Remove v7 future flags from BrowserRouter (no longer needed)
- Add TextEncoder/TextDecoder polyfills to test setup

Planning Document:
- Replace react-19-upgrade-plan.md with post-react19-upgrade-plan.md
- Add Phase 5: Class → Functional component migration (57 components)
- Add Phase 6: API Type Safety (OpenAPI codegen + Zod)
- Document PropTypes strategy (keep for docs, no Zod for props)
- Add detailed migration order by feature area

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@camd camd self-assigned this Jan 24, 2026
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 69.04196% with 391 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.43%. Comparing base (a82c683) to head (6ea6b8a).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
ui/job-view/headerbars/ActiveFilters.jsx 7.46% 61 Missing and 1 partial ⚠️
ui/job-view/App.jsx 74.33% 43 Missing and 5 partials ⚠️
...ermittent-failures/useIntermittentFailuresData.jsx 66.93% 36 Missing and 5 partials ⚠️
ui/job-view/pushes/FuzzyJobFinder.jsx 54.28% 31 Missing and 1 partial ⚠️
ui/hooks/useDebounce.js 0.00% 22 Missing and 2 partials ⚠️
ui/job-view/details/summary/ActionBar.jsx 27.58% 21 Missing ⚠️
ui/job-view/headerbars/NotificationsMenu.jsx 40.90% 13 Missing ⚠️
ui/helpers/router.js 38.88% 11 Missing ⚠️
ui/job-view/headerbars/SecondaryNavBar.jsx 87.91% 10 Missing and 1 partial ⚠️
ui/job-view/details/PinBoard.jsx 83.87% 10 Missing ⚠️
... and 31 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9177      +/-   ##
==========================================
+ Coverage   80.01%   81.43%   +1.42%     
==========================================
  Files         601      604       +3     
  Lines       32715    34024    +1309     
  Branches     3314     3250      -64     
==========================================
+ Hits        26178    27709    +1531     
+ Misses       6371     5937     -434     
- Partials      166      378     +212     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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