Skip to content

Conversation

@poteto
Copy link
Member

@poteto poteto commented Jan 23, 2025

Removes useResourceEffect.

Stack created with Sapling. Best reviewed with ReviewStack.

@react-sizebot
Copy link

react-sizebot commented Jan 23, 2025

Comparing: 0461c0d8a49730d1c8ebca2071d9bb7adfc8ac92...67aaa9290d7cbda049a903d472e76a576d1e2f2e

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 = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.03% 515.48 kB 515.62 kB +0.04% 92.04 kB 92.07 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 +0.03% 558.52 kB 558.66 kB +0.04% 99.27 kB 99.31 kB
facebook-www/ReactDOM-prod.classic.js = 636.79 kB 636.61 kB +0.13% 111.92 kB 112.06 kB
facebook-www/ReactDOM-prod.modern.js = 627.11 kB 626.93 kB +0.12% 110.34 kB 110.48 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react/cjs/react.production.js +1.07% 17.00 kB 17.18 kB +1.47% 4.42 kB 4.49 kB
oss-stable/react/cjs/react.production.js +1.07% 17.02 kB 17.21 kB +1.46% 4.45 kB 4.52 kB
oss-experimental/react/cjs/react.production.js +0.72% 18.42 kB 18.56 kB +1.07% 4.77 kB 4.82 kB
oss-stable-semver/react/cjs/react.development.js +0.36% 56.16 kB 56.37 kB +0.43% 12.50 kB 12.55 kB
oss-stable/react/cjs/react.development.js +0.36% 56.19 kB 56.39 kB +0.43% 12.52 kB 12.58 kB
oss-experimental/react/cjs/react.development.js +0.32% 46.19 kB 46.33 kB +0.42% 10.54 kB 10.58 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.production.js = 28.72 kB 28.29 kB = 5.64 kB 5.60 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.production.js = 28.72 kB 28.29 kB = 5.64 kB 5.60 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.production.js = 28.72 kB 28.29 kB = 5.64 kB 5.60 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.development.js = 32.24 kB 31.74 kB = 5.77 kB 5.73 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.development.js = 32.24 kB 31.74 kB = 5.77 kB 5.73 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.development.js = 32.24 kB 31.74 kB = 5.77 kB 5.73 kB

Generated by 🚫 dangerJS against 1c72a28

poteto added a commit that referenced this pull request Feb 11, 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.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32203).
* #32206
* #32205
* #32204
* __->__ #32203
github-actions bot pushed a commit that referenced this pull request Feb 11, 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.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32203).
* #32206
* #32205
* #32204
* __->__ #32203

DiffTrain build for [899e3d1](899e3d1)
github-actions bot pushed a commit that referenced this pull request Feb 11, 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.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32203).
* #32206
* #32205
* #32204
* __->__ #32203

DiffTrain build for [899e3d1](899e3d1)
poteto added a commit that referenced this pull request Feb 11, 2025
Rename the flag in preparation for the overload.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32204).
* #32206
* #32205
* __->__ #32204
Merges the useResourceEffect API into useEffect while keeping the underlying implementation the same. useResourceEffect will be removed in the next diff.

To fork between behavior we rely on a `typeof` check for the updater or destroy function in addition to the CRUD feature flag. This does now have to be checked every time (instead of inlined statically like before due to them being different hooks) which will incur some non-zero amount (possibly negligble) of overhead for every effect.
Removes useResourceEffect.
github-actions bot pushed a commit that referenced this pull request Feb 11, 2025
Rename the flag in preparation for the overload.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32204).
* #32206
* #32205
* __->__ #32204

DiffTrain build for [0461c0d](0461c0d)
github-actions bot pushed a commit that referenced this pull request Feb 11, 2025
Rename the flag in preparation for the overload.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32204).
* #32206
* #32205
* __->__ #32204

DiffTrain build for [0461c0d](0461c0d)
poteto added a commit that referenced this pull request Feb 11, 2025
Merges the useResourceEffect API into useEffect while keeping the
underlying implementation the same. useResourceEffect will be removed in
the next diff.

To fork between behavior we rely on a `typeof` check for the updater or
destroy function in addition to the CRUD feature flag. This does now
have to be checked every time (instead of inlined statically like before
due to them being different hooks) which will incur some non-zero amount
(possibly negligble) of overhead for every effect.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32205).
* #32206
* __->__ #32205
@poteto poteto merged commit a69b80d into main Feb 11, 2025
192 of 340 checks passed
@poteto poteto deleted the pr32206 branch February 11, 2025 19:19
github-actions bot pushed a commit that referenced this pull request Feb 11, 2025
Removes useResourceEffect.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32206).
* __->__ #32206
* #32205

DiffTrain build for [a69b80d](a69b80d)
github-actions bot pushed a commit that referenced this pull request Feb 11, 2025
Removes useResourceEffect.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32206).
* __->__ #32206
* #32205

DiffTrain build for [a69b80d](a69b80d)
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.

5 participants