Skip to content

Update Gitlab React version#672

Merged
nang2049 merged 2 commits into
masterfrom
MM-67213-react-18
May 18, 2026
Merged

Update Gitlab React version#672
nang2049 merged 2 commits into
masterfrom
MM-67213-react-18

Conversation

@nang2049
Copy link
Copy Markdown
Contributor

@nang2049 nang2049 commented May 15, 2026

Summary

Update react and relevant libraries to match react 18.

Ticket Link

https://mattermost.atlassian.net/browse/MM-67213

QA

just a basic regression test

Review Change Stack

Change Impact: 🟠 Medium

Reasoning: Upgrading React and related UI/state libraries to React 18, replacing react-custom-scrollbars with react-custom-scrollbars-2, adjusting Babel config, and tightening plugin type signatures affect multiple cross-cutting areas (build, types, UI components) but do not touch authentication, persistence, or core business logic.
Regression Risk: Moderate — runtime behavior and component lifecycle differences under React 18, type-signature changes for plugin registrations, and dependency swaps can introduce UI regressions or build/test failures, though most changes are localized to the webapp.
** QA Recommendation:** Run targeted manual UI regression tests for critical flows (modals, RHS/sidebar behavior, scroll behaviour), run full webapp build and test suite; do not skip manual QA for UI-critical paths.
Generated by CodeRabbitAI

Review Change Stack

@nang2049 nang2049 requested a review from a team as a code owner May 15, 2026 09:18
@nang2049 nang2049 requested review from avasconcelos114 and ogi-m May 15, 2026 09:19
@nang2049 nang2049 added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels May 15, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6c9501ab-2f3b-4672-95b2-c5192b2c2a9c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a13c0d and bcb703c.

⛔ Files ignored due to path filters (1)
  • webapp/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • webapp/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • webapp/package.json

📝 Walkthrough

Walkthrough

Upgrades React and related dependencies to 18.2.0, refactors Babel config to automatic JSX runtime and parameterized presets, tightens PluginRegistry types, migrates scrollbars package, updates react-bootstrap Modal props, and applies minor class-field terminator fixes.

Changes

React 18 Migration

Layer / File(s) Summary
Dependency and build configuration
webapp/package.json, webapp/babel.config.js
React and tooling upgraded to React 18.2.0 and modern dev tooling; Babel refactored with a presets(modules) helper, React preset set to runtime: 'automatic', and plugins simplified.
PluginRegistry type tightening
webapp/src/types/mattermost-webapp/index.d.ts
Component registration method parameter types changed from React.ReactNode/React.ElementType to React.ComponentType<any> for sidebar/header/popover/tooltip/dropdown/root registrations.
React Bootstrap Modal API updates
webapp/src/components/modals/attach_comment_to_issue/attach_comment_to_issue_modal.tsx, webapp/src/components/modals/create_issue/create_issue_modal.tsx
Modal sizing prop updated from deprecated bsSize='large' to size='lg'.
Scrollbars package migration
webapp/src/components/sidebar_right/index.tsx
Import switched to named Scrollbars from react-custom-scrollbars-2 instead of default from react-custom-scrollbars.
Code style normalization
webapp/src/client/client.ts, webapp/src/components/rhs_sidebar/rhs_sidebar.tsx, webapp/src/hooks/index.ts
Added terminating }; to several async arrow-function class fields to normalize syntax.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 React eighteen hops on stage with flair,
Babel trims and types tighten with care,
Modals resize, scrollbars find new ground,
Semicolons finish their quiet round,
The rabbit applauds the tidy affair.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'Update Gitlab React version' is vague and generic. While it mentions React version updates, it does not clarify that this is a React 18 migration involving significant dependency upgrades (react-redux, react-bootstrap, testing libraries, etc.), nor does it specify the scope is within a webapp directory. The title uses non-descriptive language that lacks specificity. Consider a more descriptive title such as 'Upgrade React to v18 and update related dependencies' or 'Migrate webapp to React 18 with library updates' to better convey the scope and significance of the changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
webapp/package.json (1)

25-31: ⚡ Quick win

Consider upgrading to React 18.3.1 if preparing for React 19 migration.

React 18.3.1 (latest in the 18 line) is functionally identical to 18.2.0 but introduces deprecation warnings for patterns that will no longer be supported in React 19 (e.g., findDOMNode, legacy context, string refs). An upgrade is not necessary for bug fixes or performance improvements, but worthwhile if your team plans to eventually migrate to React 19. Note that React 18 has reached end-of-life.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webapp/package.json` around lines 25 - 31, The package.json currently pins
"react": "18.2.0"; update the React dependency to "18.3.1" to align with the
latest 18.x release in preparation for React 19 migration. Edit the "react"
entry in package.json (alongside "react-dom") to use version "18.3.1", run your
package manager to update lockfile (npm install / yarn install / pnpm install),
and run the test/build suite to verify there are no deprecation warnings or
breakages before merging.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webapp/package.json`:
- Around line 78-79: The package.json currently pins "jest": "29.7.0" and
"jest-environment-jsdom": "29.7.0"; verify the project's supported Node.js
runtime and either (A) if we must support older Node versions, keep Jest 29 and
document the Node constraint by adding an "engines" entry in package.json that
lists supported Node versions (e.g., ">=14 <=18") or (B) if Node 18+ is
acceptable, upgrade to Jest 30 and the corresponding jsdom version, then run and
update JSDOM-dependent tests to accommodate stricter DOM spec compliance and
removed matcher aliases (focus changes in tests referencing
jest-environment-jsdom and any deprecated matchers).

---

Nitpick comments:
In `@webapp/package.json`:
- Around line 25-31: The package.json currently pins "react": "18.2.0"; update
the React dependency to "18.3.1" to align with the latest 18.x release in
preparation for React 19 migration. Edit the "react" entry in package.json
(alongside "react-dom") to use version "18.3.1", run your package manager to
update lockfile (npm install / yarn install / pnpm install), and run the
test/build suite to verify there are no deprecation warnings or breakages before
merging.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6ccb58e9-42a5-4ca3-a816-15f19911d487

📥 Commits

Reviewing files that changed from the base of the PR and between 696fae5 and 8a13c0d.

⛔ Files ignored due to path filters (1)
  • webapp/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • webapp/.babelrc
  • webapp/babel.config.js
  • webapp/package.json
  • webapp/src/client/client.ts
  • webapp/src/components/modals/attach_comment_to_issue/attach_comment_to_issue_modal.tsx
  • webapp/src/components/modals/create_issue/create_issue_modal.tsx
  • webapp/src/components/rhs_sidebar/rhs_sidebar.tsx
  • webapp/src/components/sidebar_right/index.tsx
  • webapp/src/hooks/index.ts
  • webapp/src/types/mattermost-webapp/index.d.ts
💤 Files with no reviewable changes (1)
  • webapp/.babelrc

Comment thread webapp/package.json Outdated
Copy link
Copy Markdown
Contributor

@avasconcelos114 avasconcelos114 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Only note (totally non-blocking as it kind of doesn't apply yet) is that we might want to just add react testing library too so we can start adding tests for the components as we continue developing the plugin

@nang2049
Copy link
Copy Markdown
Contributor Author

Thanks @avasconcelos114 its already in the dev deps :)

@nang2049
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nang2049
Copy link
Copy Markdown
Contributor Author

@codereabbitai approve

@nang2049
Copy link
Copy Markdown
Contributor Author

@coderabbitai approve

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Comments resolved and changes approved.

@nang2049 nang2049 merged commit 7701f67 into master May 18, 2026
17 checks passed
@nang2049 nang2049 deleted the MM-67213-react-18 branch May 18, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants