Skip to content

[refactor] clean up describeNativeComponentFrame#69

Open
everettbu wants to merge 1 commit into
mainfrom
rh/cleanup-frame-meths
Open

[refactor] clean up describeNativeComponentFrame#69
everettbu wants to merge 1 commit into
mainfrom
rh/cleanup-frame-meths

Conversation

@everettbu

@everettbu everettbu commented Dec 12, 2025

Copy link
Copy Markdown

Mirror of facebook/react#31781
Original author: rickhanlonii


We only need one of these methods now, I chose to keep describeFunctionComponentFrame because that makes sense as saying what the caller is describing instead of how, but I could flip if desired.

@everettbu everettbu added CLA Signed React Core Team Opened by a member of the React Core Team labels Dec 12, 2025
@greptile-apps

greptile-apps Bot commented Dec 12, 2025

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

Consolidated describeNativeComponentFrame into describeFunctionComponentFrame by renaming the base implementation and removing the wrapper functions. Both describeFunctionComponentFrame and describeClassComponentFrame now call the renamed base function directly with the construct parameter.

  • Renamed describeNativeComponentFramedescribeFunctionComponentFrame in both files
  • Updated describeClassComponentFrame to call describeFunctionComponentFrame(ctor, true) directly
  • Removed the intermediate wrapper describeFunctionComponentFrame that was calling describeNativeComponentFrame(fn, false)
  • Updated describeUnknownElementTypeFrameInDEV in ReactComponentStackFrame.js to use the renamed function

This refactoring simplifies the code by eliminating unnecessary indirection while maintaining the same functionality. The change is safe as all external consumers import describeFunctionComponentFrame and describeClassComponentFrame, not the internal describeNativeComponentFrame.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The refactoring is a straightforward rename and consolidation with no behavioral changes. All external consumers already import the public API functions (describeFunctionComponentFrame and describeClassComponentFrame), and the internal implementation name change has no external impact. The logic remains identical - only the function names and call structure have been simplified.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/react-devtools-shared/src/backend/shared/DevToolsComponentStackFrame.js 5/5 Renamed describeNativeComponentFrame to describeFunctionComponentFrame and collapsed wrapper function
packages/shared/ReactComponentStackFrame.js 5/5 Renamed describeNativeComponentFrame to describeFunctionComponentFrame and collapsed wrapper function

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants