Skip to content

Comments

Refactor: Use centralized hasOwnProperty utility functions#35864

Open
behnammodi wants to merge 1 commit intofacebook:mainfrom
behnammodi:refactor/use-hasOwnProperty-utility
Open

Refactor: Use centralized hasOwnProperty utility functions#35864
behnammodi wants to merge 1 commit intofacebook:mainfrom
behnammodi:refactor/use-hasOwnProperty-utility

Conversation

@behnammodi
Copy link
Contributor

Summary

Overview

This PR refactors property checking throughout the codebase to use centralized hasOwnProperty utility functions instead of directly accessing Object.prototype.hasOwnProperty.

Changes

  • compiler/packages/babel-plugin-react-compiler/src/Utils/ComponentDeclaration.ts: Import hasOwnProperty from ./utils
  • compiler/packages/babel-plugin-react-compiler/src/Utils/HookDeclaration.ts: Import hasOwnProperty from ./utils
  • packages/react-devtools-shared/src/devtools/views/utils.js: Import hasOwnProperty from shared/hasOwnProperty instead of defining locally

How did you test this change?

yarn test --prod

@meta-cla meta-cla bot added the CLA Signed label Feb 22, 2026
@behnammodi behnammodi force-pushed the refactor/use-hasOwnProperty-utility branch from b406759 to 2434b99 Compare February 22, 2026 17:19
@react-sizebot
Copy link

Comparing: ab18f33...2434b99

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 611.80 kB 611.80 kB = 108.11 kB 108.12 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB +0.05% 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 677.73 kB 677.73 kB = 119.08 kB 119.08 kB
facebook-www/ReactDOM-prod.classic.js = 698.45 kB 698.45 kB = 122.76 kB 122.76 kB
facebook-www/ReactDOM-prod.modern.js = 688.77 kB 688.77 kB = 121.15 kB 121.15 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 2434b99

@behnammodi behnammodi marked this pull request as ready for review February 22, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants