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

Remove useMutableSource #27011

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

noahlemen
Copy link
Member

@noahlemen noahlemen commented Jun 26, 2023

Summary

This PR cleans up useMutableSource. This has been blocked by a remaining dependency internally at Meta, but that has now been deleted.

How did you test this change?

yarn flow
yarn lint
yarn test --prod

Recoil has transitioned to useSyncExternalStore. useMutableSource is no longer used in WWW and can safely be removed once the internal GKs are cleaned up.
@react-sizebot
Copy link

react-sizebot commented Jun 26, 2023

Comparing: 6aacd3f...ab5ef42

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.min.js = 164.56 kB 164.02 kB = 51.83 kB 51.64 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 171.97 kB 171.44 kB = 54.06 kB 53.86 kB
facebook-www/ReactDOM-prod.classic.js = 571.74 kB 566.36 kB = 100.83 kB 99.86 kB
facebook-www/ReactDOM-prod.modern.js = 555.52 kB 550.16 kB = 98.02 kB 97.01 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.development.js = 23.66 kB 23.11 kB = 6.33 kB 6.27 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.development.js = 23.66 kB 23.11 kB = 6.33 kB 6.27 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.development.js = 23.66 kB 23.11 kB = 6.33 kB 6.27 kB
facebook-www/React-profiling.classic.js = 22.20 kB 21.62 kB = 5.51 kB 5.38 kB
facebook-www/React-profiling.modern.js = 21.91 kB 21.33 kB = 5.43 kB 5.31 kB
facebook-react-native/react/cjs/React-profiling.js = 21.64 kB 21.06 kB = 5.40 kB 5.27 kB
facebook-www/React-prod.classic.js = 21.60 kB 21.02 kB = 5.38 kB 5.26 kB
facebook-react-native/react/cjs/React-prod.js = 21.33 kB 20.75 kB = 5.35 kB 5.22 kB
facebook-www/React-prod.modern.js = 21.30 kB 20.72 kB = 5.31 kB 5.18 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-art/umd/react-art.production.min.js = 135.53 kB 135.25 kB = 42.31 kB 42.22 kB
oss-stable-semver/react-server/cjs/react-server.development.js = 146.57 kB 146.27 kB = 36.53 kB 36.45 kB
oss-stable/react-server/cjs/react-server.development.js = 146.57 kB 146.27 kB = 36.53 kB 36.45 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-prod.js = 296.99 kB 296.37 kB = 52.81 kB 52.68 kB
oss-stable/react-art/umd/react-art.production.min.js = 131.73 kB 131.45 kB = 41.18 kB 41.11 kB
oss-stable-semver/react-art/umd/react-art.production.min.js = 131.67 kB 131.40 kB = 41.16 kB 41.08 kB
oss-experimental/react-server/cjs/react-server.production.min.js = 25.45 kB 25.39 kB = 8.67 kB 8.64 kB
oss-stable-semver/react-server/cjs/react-server.production.min.js = 25.02 kB 24.97 kB = 8.51 kB 8.49 kB
oss-stable/react-server/cjs/react-server.production.min.js = 25.02 kB 24.97 kB = 8.51 kB 8.49 kB
oss-experimental/react-server/cjs/react-server.development.js = 147.75 kB 147.39 kB = 36.82 kB 36.71 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js = 1,325.47 kB 1,322.17 kB = 293.75 kB 293.20 kB
oss-experimental/react-dom/cjs/react-dom.development.js = 1,307.42 kB 1,304.11 kB = 289.42 kB 288.85 kB
oss-experimental/react-dom/umd/react-dom.development.js = 1,370.64 kB 1,367.16 kB = 292.33 kB 291.76 kB
oss-experimental/react-art/umd/react-art.development.js = 939.36 kB 936.96 kB = 198.24 kB 197.98 kB
react-native/implementations/ReactNativeRenderer-dev.js = 875.22 kB 872.96 kB = 191.30 kB 191.01 kB
oss-stable/react-dom/cjs/react-dom.development.js = 1,263.17 kB 1,259.87 kB = 279.84 kB 279.25 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js = 1,263.15 kB 1,259.84 kB = 279.81 kB 279.22 kB
oss-stable/react-art/umd/react-art.development.js = 916.29 kB 913.89 kB = 193.91 kB 193.63 kB
oss-stable-semver/react-art/umd/react-art.development.js = 916.26 kB 913.86 kB = 193.88 kB 193.60 kB
react-native/implementations/ReactFabric-dev.js = 859.56 kB 857.30 kB = 186.92 kB 186.63 kB
oss-stable/react-dom/umd/react-dom.development.js = 1,324.33 kB 1,320.85 kB = 282.81 kB 282.23 kB
oss-stable-semver/react-dom/umd/react-dom.development.js = 1,324.31 kB 1,320.83 kB = 282.78 kB 282.20 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js = 103.19 kB 102.91 kB = 31.69 kB 31.59 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js = 103.07 kB 102.79 kB = 31.65 kB 31.56 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js = 103.01 kB 102.74 kB = 31.62 kB 31.53 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js = 103.58 kB 103.30 kB = 32.13 kB 32.04 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js = 103.45 kB 103.18 kB = 32.06 kB 31.98 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js = 103.40 kB 103.13 kB = 32.03 kB 31.95 kB
oss-experimental/react-art/cjs/react-art.development.js = 823.49 kB 821.22 kB = 179.20 kB 178.95 kB
oss-experimental/react-art/cjs/react-art.production.min.js = 98.26 kB 97.99 kB = 30.15 kB 30.06 kB
oss-stable/react-art/cjs/react-art.development.js = 801.50 kB 799.24 kB = 174.86 kB 174.59 kB
oss-stable-semver/react-art/cjs/react-art.development.js = 801.48 kB 799.21 kB = 174.84 kB 174.57 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js = 794.79 kB 792.53 kB = 172.48 kB 172.17 kB
oss-stable/react-art/cjs/react-art.production.min.js = 94.43 kB 94.16 kB = 29.03 kB 28.95 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js = 94.38 kB 94.11 kB = 29.00 kB 28.92 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js = 783.25 kB 780.99 kB = 171.26 kB 170.98 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js = 782.88 kB 780.62 kB = 171.18 kB 170.90 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js = 782.86 kB 780.59 kB = 171.15 kB 170.87 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js = 820.46 kB 818.06 kB = 173.04 kB 172.78 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js = 820.07 kB 817.67 kB = 172.94 kB 172.68 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js = 820.05 kB 817.65 kB = 172.92 kB 172.65 kB
oss-experimental/react-dom/cjs/react-dom.profiling.min.js = 181.61 kB 181.08 kB = 56.46 kB 56.27 kB
oss-experimental/react-dom/umd/react-dom.profiling.min.js = 180.80 kB 180.26 kB = 56.68 kB 56.48 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.production.min.js = 178.19 kB 177.65 kB = 56.40 kB 56.18 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js = 174.19 kB 173.65 kB = 54.26 kB 54.06 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.min.js = 174.11 kB 173.58 kB = 54.24 kB 54.03 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 171.97 kB 171.44 kB = 54.06 kB 53.86 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js = 173.46 kB 172.91 kB = 54.57 kB 54.35 kB
oss-stable-semver/react-dom/umd/react-dom.profiling.min.js = 173.38 kB 172.83 kB = 54.54 kB 54.33 kB
oss-experimental/react-dom/umd/react-dom.production.min.js = 171.81 kB 171.27 kB = 54.35 kB 54.16 kB
oss-stable/react-dom/cjs/react-dom.production.min.js = 164.56 kB 164.02 kB = 51.83 kB 51.64 kB
oss-stable-semver/react-dom/cjs/react-dom.production.min.js = 164.48 kB 163.94 kB = 51.80 kB 51.61 kB
oss-stable/react-dom/umd/react-dom.production.min.js = 164.47 kB 163.93 kB = 52.18 kB 51.98 kB
oss-stable-semver/react-dom/umd/react-dom.production.min.js = 164.39 kB 163.85 kB = 52.16 kB 51.95 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js = 922.46 kB 919.26 kB = 197.39 kB 196.87 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js = 898.98 kB 895.78 kB = 192.70 kB 192.15 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js = 898.96 kB 895.76 kB = 192.67 kB 192.12 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js = 124.16 kB 123.58 kB = 37.35 kB 37.17 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js = 119.96 kB 119.38 kB = 36.11 kB 35.92 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.min.js = 119.94 kB 119.35 kB = 36.08 kB 35.90 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js = 115.14 kB 114.56 kB = 35.15 kB 34.96 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js = 110.95 kB 110.36 kB = 33.89 kB 33.70 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js = 110.92 kB 110.34 kB = 33.87 kB 33.68 kB
facebook-www/React-dev.classic.js = 127.76 kB 126.78 kB = 33.70 kB 33.50 kB
facebook-www/React-dev.modern.js = 126.66 kB 125.69 kB = 33.45 kB 33.25 kB
facebook-react-native/react/cjs/React-dev.js = 120.04 kB 119.07 kB = 31.60 kB 31.39 kB
facebook-www/ReactDOM-profiling.classic.js = 602.30 kB 596.92 kB = 105.27 kB 104.31 kB
facebook-www/ReactDOM-profiling.modern.js = 586.01 kB 580.64 kB = 102.46 kB 101.48 kB
facebook-www/ReactDOMTesting-prod.classic.js = 586.56 kB 581.18 kB = 104.54 kB 103.56 kB
facebook-www/ReactDOMTesting-prod.modern.js = 572.06 kB 566.70 kB = 102.08 kB 101.11 kB
facebook-www/ReactDOM-prod.classic.js = 571.74 kB 566.36 kB = 100.83 kB 99.86 kB
facebook-www/ReactDOM-prod.modern.js = 555.52 kB 550.16 kB = 98.02 kB 97.01 kB
facebook-www/ReactDOMTesting-dev.classic.js = 1,461.46 kB 1,446.58 kB = 316.25 kB 312.82 kB
facebook-www/ReactDOM-dev.classic.js = 1,443.12 kB 1,428.24 kB = 311.83 kB 308.35 kB
facebook-www/ReactDOMTesting-dev.modern.js = 1,433.57 kB 1,418.69 kB = 310.72 kB 307.23 kB
facebook-www/ReactDOM-dev.modern.js = 1,415.22 kB 1,400.34 kB = 306.25 kB 302.82 kB
react-native/implementations/ReactNativeRenderer-profiling.fb.js = 365.62 kB 361.06 kB = 64.32 kB 63.52 kB
facebook-www/ReactART-prod.classic.js = 349.89 kB 345.50 kB = 59.53 kB 58.79 kB
react-native/implementations/ReactFabric-profiling.fb.js = 356.79 kB 352.23 kB = 62.58 kB 61.77 kB
facebook-www/ReactART-prod.modern.js = 338.89 kB 334.50 kB = 57.62 kB 56.87 kB
react-native/implementations/ReactNativeRenderer-prod.fb.js = 338.21 kB 333.65 kB = 60.05 kB 59.26 kB
react-native/implementations/ReactFabric-prod.fb.js = 329.38 kB 324.82 kB = 58.33 kB 57.56 kB
facebook-www/ReactART-dev.classic.js = 923.47 kB 910.14 kB = 196.78 kB 193.81 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js = 912.85 kB 899.54 kB = 198.73 kB 195.72 kB
facebook-www/ReactART-dev.modern.js = 912.27 kB 898.94 kB = 194.48 kB 191.54 kB
react-native/implementations/ReactFabric-dev.fb.js = 897.20 kB 883.88 kB = 194.24 kB 191.28 kB
facebook-www/ReactTestRenderer-dev.classic.js = 812.16 kB 798.83 kB = 175.98 kB 173.03 kB
facebook-www/ReactTestRenderer-dev.modern.js = 812.16 kB 798.83 kB = 175.98 kB 173.03 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.production.min.js = 7.26 kB 7.13 kB = 2.69 kB 2.66 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.production.min.js = 7.26 kB 7.13 kB = 2.69 kB 2.66 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.production.min.js = 7.26 kB 7.13 kB = 2.69 kB 2.66 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.development.js = 23.66 kB 23.11 kB = 6.33 kB 6.27 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.development.js = 23.66 kB 23.11 kB = 6.33 kB 6.27 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.development.js = 23.66 kB 23.11 kB = 6.33 kB 6.27 kB
facebook-www/React-profiling.classic.js = 22.20 kB 21.62 kB = 5.51 kB 5.38 kB
facebook-www/React-profiling.modern.js = 21.91 kB 21.33 kB = 5.43 kB 5.31 kB
facebook-react-native/react/cjs/React-profiling.js = 21.64 kB 21.06 kB = 5.40 kB 5.27 kB
facebook-www/React-prod.classic.js = 21.60 kB 21.02 kB = 5.38 kB 5.26 kB
facebook-react-native/react/cjs/React-prod.js = 21.33 kB 20.75 kB = 5.35 kB 5.22 kB
facebook-www/React-prod.modern.js = 21.30 kB 20.72 kB = 5.31 kB 5.18 kB

Generated by 🚫 dangerJS against ab5ef42

@@ -299,8 +299,8 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
// time it takes to show the final state, which is what they are actually
// waiting for.
//
// For those exceptions where entanglement is semantically important, like
// useMutableSource, we should ensure that there is no partial work at the
Copy link
Member

Choose a reason for hiding this comment

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

@acdlite are there remaining cases of this? Maybe the replacement, useSyncExternalStore or can this block be removed?

// at runtime. We should instead inject the version number as part of the build
// process, and use the ReactVersions.js module as the single source of truth.
export default '18.2.0';
export default '18.3.0-PLACEHOLDER';
Copy link
Member

Choose a reason for hiding this comment

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

revert, this is an annoying artifact of the build process that it overrides this file…

@@ -622,10 +622,6 @@ export function markRootPinged(root: FiberRoot, pingedLanes: Lanes) {
root.pingedLanes |= root.suspendedLanes & pingedLanes;
}

export function markRootMutableRead(root: FiberRoot, updateLane: Lane) {
root.mutableReadLanes |= updateLane & root.pendingLanes;
Copy link
Member

Choose a reason for hiding this comment

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

Can you grep for mutableReadLanes, I think it can be removed from the fiber too.

@noahlemen noahlemen marked this pull request as ready for review June 26, 2023 19:47
@noahlemen noahlemen merged commit 80d9a40 into facebook:main Jun 27, 2023
36 checks passed
@noahlemen noahlemen deleted the noahlemen/remove-mutable-source branch June 27, 2023 16:45
github-actions bot pushed a commit that referenced this pull request Jun 27, 2023
## Summary

This PR cleans up `useMutableSource`. This has been blocked by a
remaining dependency internally at Meta, but that has now been deleted.

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

## How did you test this change?

```
yarn flow
yarn lint
yarn test --prod
```

<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->

DiffTrain build for [80d9a40](80d9a40)
@merouanezouaid
Copy link

RIP ⚰️

EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
## Summary

This PR cleans up `useMutableSource`. This has been blocked by a
remaining dependency internally at Meta, but that has now been deleted.

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

## How did you test this change?

```
yarn flow
yarn lint
yarn test --prod
```

<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
## Summary

This PR cleans up `useMutableSource`. This has been blocked by a
remaining dependency internally at Meta, but that has now been deleted.

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

## How did you test this change?

```
yarn flow
yarn lint
yarn test --prod
```

<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->

DiffTrain build for commit 80d9a40.
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.

None yet

6 participants