Skip to content

MM-70684 Update GitHub plugin for React 19 in Mattermost v12 - #1061

Open
cpoile wants to merge 1 commit into
masterfrom
MM-70684-update-to-v12
Open

MM-70684 Update GitHub plugin for React 19 in Mattermost v12#1061
cpoile wants to merge 1 commit into
masterfrom
MM-70684-update-to-v12

Conversation

@cpoile

@cpoile cpoile commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the GitHub plugin startup crash on Mattermost v12 / React 19. The plugin already used the host's React, but dependencies could bundle React 18's JSX runtime. That older runtime accesses React internals such as ReactCurrentOwner that are no longer available in React 19, causing the plugin bundle to fail during startup.

Externalizes react/jsx-runtime and react/jsx-dev-runtime to ReactJSXRuntime and ReactJSXDevRuntime, keeping JSX helpers aligned with the host's React. Also maps react-dom/client to the host's ReactDOM, requires Mattermost 12.0.0, and sets the debug build to development mode. Requires the host exports from mattermost/mattermost#38489.

Replaces react-markdown's removed linkTarget prop with a custom link renderer, preserving links opening in a new tab and fixing an existing tooltip-rendering failure.

Ticket Link

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

Release Note

Updated the GitHub plugin for React 19 in Mattermost v12, fixing a startup crash caused by a bundled older JSX runtime. Raised the minimum supported Mattermost version to 12.0.0 and fixed Markdown tooltip rendering.

Change Impact: 🟡 Medium

Reasoning: The changes affect plugin startup, Webpack dependency mapping, and Markdown link rendering. The scope is limited to the plugin, but compatibility depends on Mattermost v12 host exports.

Regression Risk: Medium. Incorrect external mappings or link rendering can cause startup failures or user-facing rendering issues.

QA Recommendation: Perform focused manual QA on plugin startup, debug builds, Markdown links, tooltips, and Mattermost v12 compatibility. Skipping manual QA has moderate risk.

Generated by CodeRabbitAI

@cpoile
cpoile requested a review from a team as a code owner September 11, 2026 19:36
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Essentials

Run ID: 6ee7864b-cc1c-4cef-95d7-b65167280227

📥 Commits

Reviewing files that changed from the base of the PR and between c10f09b and 9895d49.

📒 Files selected for processing (5)
  • README.md
  • plugin.json
  • webapp/package.json
  • webapp/src/components/link_tooltip/link_tooltip.jsx
  • webapp/webpack.config.js

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The plugin now requires Mattermost 12.0.0, externalizes React 19 runtime modules, uses development mode for debug builds, documents compatibility requirements, and renders Markdown links with secure new-tab attributes.

Changes

React 19 compatibility and link handling

Layer / File(s) Summary
React 19 runtime compatibility
plugin.json, webapp/webpack.config.js, webapp/package.json, README.md
The plugin requires Mattermost 12.0.0. Webpack externalizes React runtime modules. The debug script uses development mode. The README documents the required configuration and rebuild steps.
Markdown link rendering
webapp/src/components/link_tooltip/link_tooltip.jsx
Markdown links use a custom anchor renderer that preserves URL and title values, opens links in a new tab, and sets noopener noreferrer.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: avasconcelos114, nang2049

Merge Risk: ⚪ Minimal · up to 9895d

The compatibility and Markdown changes introduce no confirmed merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the GitHub plugin update for React 19 compatibility in Mattermost v12, which matches the main changes in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch MM-70684-update-to-v12

A rabbit hops through React’s bright runtime,
JSX paths now bloom beneath the moon.
Links leap safely to a fresh new tab,
While webpack follows the proper map.
Mattermost guards the garden gate,
And docs record the build-time state.

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

)}
<div className='markdown-text mt-1 mb-1'>
<ReactMarkdown linkTarget='_blank'>{description}</ReactMarkdown>
<ReactMarkdown

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The installed react-markdown v9 removed linkTarget. Passing it throws when a tooltip renders a description.

The replacement uses its supported components.a API to preserve opening links in a new tab.

This is a pre-existing dependency bug, uncovered during testing—not a React 19 requirement.

@cpoile cpoile added the 2: Dev Review Requires review by a core committer label Sep 11, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant