Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[crud] Narrow resource type #32203

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[crud] Narrow resource type #32203

wants to merge 1 commit into from

Conversation

poteto
Copy link
Member

@poteto poteto commented Jan 23, 2025

Small refactor to the resource type to narrow it to an arbitrary object or void/null instead of the top type. This makes the overload on useEffect simpler since the return type of create is no longer widened to the top type when we merge their definitions.

Stack created with Sapling. Best reviewed with ReviewStack.

@react-sizebot
Copy link

react-sizebot commented Jan 23, 2025

Comparing: de1eaa2...3470cd1

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.68 kB 6.68 kB +0.05% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 514.24 kB 514.24 kB = 91.73 kB 91.74 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 557.28 kB 557.28 kB = 98.97 kB 98.97 kB
facebook-www/ReactDOM-prod.classic.js = 595.79 kB 595.70 kB = 104.85 kB 104.83 kB
facebook-www/ReactDOM-prod.modern.js = 586.21 kB 586.12 kB = 103.30 kB 103.28 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 1e059a3

Small refactor to the `resource` type to narrow it to an arbitrary object or void/null instead of the top type. This makes the overload on useEffect simpler since the return type of create is no longer widened to the top type when we merge their definitions.
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.

3 participants