Skip to content

Remove the findDOMNode usage from ContextMenu #5588

Merged
canova merged 2 commits intofirefox-devtools:mainfrom
canova:finddomnode-contextmenu
Sep 3, 2025
Merged

Remove the findDOMNode usage from ContextMenu #5588
canova merged 2 commits intofirefox-devtools:mainfrom
canova:finddomnode-contextmenu

Conversation

@canova
Copy link
Member

@canova canova commented Sep 3, 2025

findDOMNode is deprecated in react 18 and it's removed from version 19. It's one of the blockers of the React 19 upgrade for us right now. There are a few more findDOMNode usages, but I expect to look at them next.

It looks like there 2 more places where we use findDOMNode:

  • withSize higher order component
  • CSSTransition component that's from the react-transition-group package (internally).

"Hide whitespace" option in github would make it easier to review the snapshot tests as we only wrap the component with a div.

Production / Deploy preview

@canova canova requested a review from mstange September 3, 2025 21:58
@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.77%. Comparing base (d956b46) to head (84d1c38).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5588      +/-   ##
==========================================
- Coverage   85.78%   85.77%   -0.01%     
==========================================
  Files         309      309              
  Lines       30403    30391      -12     
  Branches     8370     8367       -3     
==========================================
- Hits        26080    26068      -12     
  Misses       3902     3902              
  Partials      421      421              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 30 to 31
this._contextMenuWrapper.addEventListener(
'mousedown',
Copy link
Contributor

@mstange mstange Sep 3, 2025

Choose a reason for hiding this comment

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

Since we now have our own element anyway, couldn't we just use <div onMouseDown={this._onMouseDown}>?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, lol, yes exactly :D It makes perfect sense as it makes it a lot cleaner! Changed it.

@canova canova force-pushed the finddomnode-contextmenu branch from d027f86 to 84d1c38 Compare September 3, 2025 22:07
@canova canova merged commit cc2349c into firefox-devtools:main Sep 3, 2025
15 checks passed
This was referenced Sep 4, 2025
canova added a commit that referenced this pull request Sep 5, 2025
Changes:

[Markus Stange] Some path fixes (#5581)
[depfu[bot]] Update all Yarn dependencies (2025-09-03) (#5585)
[Nazım Can Altınova] Remove the findDOMNode usage from ContextMenu
(#5588)
[Markus Stange] Replace @fetch-mock/jest with plain fetch-mock (#5575)
[Ryan Hunt] Replace zee-worker.js with compression streams API (#5584)
[Markus Stange] Remove unused FilterNavigatorBar animations (#5591)
[Markus Stange] Use different ports for start-prod and start-examples
(#5592)
[Markus Stange] Remove SharedArrayBuffer workaround (#5596)
[Jeff Muizelaar] Make time after responseEnd have a more accurate name
(#5582)
[Ryan Hunt] Move compression and decompression to a worker (#5597)
[Markus Stange] Remove Flow and no-TypeScript settings from
.vscode/settings.json (#5601)
[Markus Stange] Simplify the eslint command in package.json so that
eslint.config.mjs is the only place you need to look if you want to know
if a file is being checked (#5600)
[Markus Stange] Fix search filtering (#5599)
[Nazım Can Altınova] 🔃 Sync: l10n -> main (September 5, 2025) (#5603)

And thanks to our localizers:

de: mstange
tr: Fernando Javier
tr: Rua
tr: Selim Şumlu
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.

2 participants