Skip to content

feat: update react to 19#689

Open
stenin-nikita wants to merge 10 commits into
masterfrom
nikita-stenin.DOCSTOOLS-6222.update-react
Open

feat: update react to 19#689
stenin-nikita wants to merge 10 commits into
masterfrom
nikita-stenin.DOCSTOOLS-6222.update-react

Conversation

@stenin-nikita

@stenin-nikita stenin-nikita commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

React 19 upgrade

The main goal of this PR is the React 19 migration. Everything else is either required by the upgrade itself or bundled in to avoid spinning up separate PRs.

What's included

  • React 19 — bumped react / react-dom to 19, with targeted type fixes in components where the new version tightened signatures (OutsideClick, MiniToc, Feedback, useTimer, useVirtualElementRef, SubscribePopup, etc.).
  • Removed react-popper — the package doesn't support React 19 and wasn't actually used in the code. The unused usePopper hook was removed as well; its exported constants were moved into src/constants.ts.
  • Replaced react-compose — incompatible with React 19. Replaced with a small local compose function in src/utils/index.ts (~20 lines).
  • Switched to the new JSX runtime — "jsx": "react-jsx" in tsconfig. This produces a wide but shallow diff: redundant import React from 'react' statements were removed everywhere they're no longer needed.
  • Storybook upgrade and reorganization:
    • Config moved from demo/.storybook/ to the root .storybook/.
    • All stories moved from demo/src/Components/ to demo/Components/.
    • The separate demo/package.json and demo/package-lock.json were removed (−22,500 lines — that's the deleted lockfile, not real code).
    • tsconfig was split into tsconfig.base.json, tsconfig.lib.json, tsconfig.storybook.json, and tsconfig.test.json — a single shared config no longer covers all build targets.
  • ESLint / CI aligned with the new structure — local .eslintrc.js files in src/ and playwright/, plus updated paths in GitHub Actions.
  • Fixed SonarQube duplication warnings — the DocPage* and SearchSuggest* stories had a lot of duplicated code. Extracted into demo/Components/shared/(hooks, service-link, story-config, use-page-props). No production code touched.
  • Regenerated Playwright screenshots — 3 PNGs updated; the avatar rendering shifted slightly after the upgrades.
  • Small test cleanup to satisfy the import/order rule.

Why the diff is so large

Out of ~28,000 changed lines, ~26,000 are noise:

  • regenerated package-lock.json,
  • deleted demo/package-lock.json (~22.5k lines),
  • file renames from the Storybook move,
  • removal of redundant import React statements after the JSX runtime switch.

Actual production changes in src/ are small and targeted.

Suggested review order

Read these commits in order — the rest can be skimmed:

  1. c731244 feat: update react to 19
  2. d8f1db6 feat: remove unused react-popper
  3. 0e53cc4 refactor: use custom compose function
  4. a7d4320 refactor: use react-jsx in tsconfig
  5. cb51943 feat: update storybook
  6. d2d2fc5 refactor: fix sonar qube errors

@stenin-nikita
stenin-nikita requested review from a team and diplodoc-bot as code owners July 13, 2026 12:14
@stenin-nikita
stenin-nikita requested review from martyanovandrey and reazy015 and removed request for a team July 13, 2026 12:14
@stenin-nikita
stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-6222.update-react branch 2 times, most recently from c8a78c6 to 01d7b70 Compare July 13, 2026 12:22
@yc-ui-bot

Copy link
Copy Markdown
Contributor

Storybook preview is ready.

@yc-ui-bot

Copy link
Copy Markdown
Contributor

Visual Tests Report is ready.

@stenin-nikita
stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-6222.update-react branch from 01d7b70 to 0226f9d Compare July 13, 2026 13:39
@stenin-nikita

Copy link
Copy Markdown
Contributor Author

/update-screenshots

@github-actions

Copy link
Copy Markdown
Contributor

✅ Screenshots have been updated successfully!

@stenin-nikita
stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-6222.update-react branch 3 times, most recently from d2d2fc5 to eae9dd4 Compare July 14, 2026 12:13
@stenin-nikita

Copy link
Copy Markdown
Contributor Author

/update-screenshots

@github-actions

Copy link
Copy Markdown
Contributor

✅ Screenshots have been updated successfully!

@stenin-nikita
stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-6222.update-react branch 2 times, most recently from 24e2757 to d4bf073 Compare July 16, 2026 14:28
@stenin-nikita
stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-6222.update-react branch from d4bf073 to 0a3854b Compare July 16, 2026 14:55
@sonarqubecloud

Copy link
Copy Markdown

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