Skip to content

chore: React 17 compatibility adjustments#55

Draft
bosun-ai[bot] wants to merge 48 commits intoalphafrom
bosun/d8994d49-dabb-4129-8027-789494dec548-spectrum-demo
Draft

chore: React 17 compatibility adjustments#55
bosun-ai[bot] wants to merge 48 commits intoalphafrom
bosun/d8994d49-dabb-4129-8027-789494dec548-spectrum-demo

Conversation

@bosun-ai
Copy link

@bosun-ai bosun-ai bot commented Dec 21, 2025

Summary

  • Upgrade work continues for moving the app from React 16.8.6 to 17.0.2, including lockfile refreshes and compatibility adjustments.
  • This patch focuses on wiring changes to accommodate React 17’s event delegation updates and cleaning up legacy hot reloading hooks, plus adds CI coverage for regression tests.

Dependency updates

  • react and react-dom remain pinned at 17.0.2, with react-hot-loader held at the latest v4 and @hot-loader/react-dom added for compatibility. No additional package upgrades were necessary for this set of changes.
  • yarn.lock was regenerated after reinstalling with nvm use && yarn install. Note: web-push@3.6.7 now expects Node ≥16, so future installs may require raising the Node version if that dependency stays.

Runtime and event handling updates

  • Global keyboard shortcuts (src/components/gallery/browser.js, src/views/threadSlider/index.js): listeners now use the capture phase to preserve behavior after React 17’s document-level delegation changes; cleanup timing now relies on useLayoutEffect so the title bar resets synchronously.
  • Status banner (src/views/status/index.js): online/offline/visibilitychange handlers are registered in capture mode and consistently removed on unmount to keep network state updates reliable.
  • Community feeds scroll restoration (src/views/community/components/communityFeeds.js): useRef now tracks the latest tab so the asynchronous cleanup invoked by React 17 stores the correct scroll key.
  • Store hot reloading (src/store/index.js) and hot-routes shim have been removed; the app now imports src/routes directly, simplifying the bundle after the upgrade removed reliance on react-hot-loader internals.

Tooling & CI

  • Added .github/workflows/regression-tests.yml to run the regression suite on pushes and pull requests using Node 12 and Yarn 1.22.22. ⚠️ Heads-up: web-push@3.6.7 requires Node ≥16, so this workflow may need a Node version bump once that dependency is exercised in CI.

Testing

  • Not run locally (per instructions). The new regression-tests GitHub Action is expected to validate via yarn test:regression.

Reviewer checklist

  • Confirm regression workflow uses an appropriate Node version for web-push@3.6.7 when tests execute.
  • Smoke test global keyboard shortcuts (gallery, thread slider) to ensure capture-phase listeners behave as expected.
  • Verify community feed scroll restoration across tab switches after navigating away and back.

This pull request is created by bosun, a code maintenance automation platform. For more information, visit bosun.ai.

@bosun-ai bosun-ai bot changed the title chore: prepare react 17 upgrade chore: WIP react 17 upgrade prep Dec 21, 2025
@bosun-ai bosun-ai bot changed the title chore: WIP react 17 upgrade prep chore: React 17 compatibility adjustments Dec 21, 2025
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.

0 participants