Skip to content

Migrate to React 18#298

Open
mirekys wants to merge 4 commits intoinveniosoftware:masterfrom
oarepo:mirekys/react-18-migration
Open

Migrate to React 18#298
mirekys wants to merge 4 commits intoinveniosoftware:masterfrom
oarepo:mirekys/react-18-migration

Conversation

@mirekys
Copy link
Copy Markdown

@mirekys mirekys commented Apr 24, 2026

❤️ Thank you for your contribution!

Description

Migrate react-searchkit from React 16 to React 18 following RFC inveniosoftware/rfcs#112.

  • Upgrades peer dependencies
  • Replaces enzyme adapter for React18 suppoort
  • Removes explicit React imports (update-react-imports codemod)
  • Migrates render-only class components to functions (pure-component codemod)
  • Updates demo entry points to createRoot (update-react-imports codemod)
  • Applies formatting for React 18
  • Switches CI to unified workflows from https://github.com/inveniosoftware/workflows
  • Bumped Node - now supporting v22, 24, (26?)

Prerequisites

To make React 18 linting work, you need to link a local clone of eslint-config-invenio:

gh repo clone inveniosoftware/eslint-config-invenio
gh pr checkout 20
cd eslint-config-invenio
npm link

In this repo:

npm link @inveniosoftware/eslint-config-invenio
  • All demos works as before without changes
  • All tests pass
  • npm audit down to just 2 moderate severity vulnerabilities (due to webpack-dev-server - didn't manage to solve that one)

Requires:

Part of: inveniosoftware/rfcs#112

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

  • I'm aware of the code of conduct.
  • I've created logical separate commits and followed the commit message format.
  • I've added relevant test cases.
  • I've added relevant documentation.
  • I've marked translation strings.
  • I've identified the copyright holder(s) and updated copyright headers for touched files (>15 lines contributions).
  • I've NOT included third-party code (copy/pasted source code or new dependencies).
    • If you have added third-party code (copy/pasted or new dependencies), please reach out to an architect on Discord.

Frontend

  • I've followed the CSS/JS and React guidelines.
  • I've followed the web accessibility guidelines.
  • I've followed the user interface guidelines.

mirekys added 2 commits April 24, 2026 18:18
* Upgrade React peer dependencies from ^16.13.0
  to ^18.3.0
* Replace enzyme-adapter-react-16 with
  @cfaester/enzyme-adapter-react-18, update test setup
* Remove explicit React imports - new JSX transform
* Migrate pure class components to function components
* Replace legacy ReactDOM.render in demos with
  createRoot().render
* Move Bootstrap side effects from constructor to
  componentDidMount for StrictMode compatibility
* Update minimum Node.js engine requirement from >=14.0.0
  to >=18.0.0
* Update ESLint configuration to React 18
* Related: inveniosoftware/rfcs#112
Apply consistent formatting across source files following
updated ESLint React 18 configuration.

Refs inveniosoftware/rfcs#112
@mirekys mirekys marked this pull request as draft April 24, 2026 17:39
@mirekys mirekys marked this pull request as ready for review April 28, 2026 15:48
@mirekys mirekys added this to v14 Apr 28, 2026
mirekys added 2 commits April 29, 2026 15:05
* Switches CI to inveniosoftware/workflows JS test workflow
  for consistency across packages

* Removes unused devDependencies (cheerio, coveralls, expect)

* Adds npm overrides for supply chain security
  and Node 22+ compatibility

* Adds MessagePort and MessageChannel to test polyfills
  for React 18 act() scheduling in JSDOM

* Removes redundant `expect` import (provided by Jest)
@mirekys mirekys force-pushed the mirekys/react-18-migration branch from 9f8bd52 to d55223b Compare April 29, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant