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 unstable_changedBits #20953

Merged
merged 1 commit into from Mar 19, 2021
Merged

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Mar 8, 2021

We added this unstable feature a few years ago, as a way to opt out of context updates, but it didn't prove useful in practice.

We have other proposals for how to address the same problem, like context selectors.

Since it was prefixed with unstable_, we should be able to remove it without consequence. The hook API already warned if you used it.

Even if someone is using it somewhere, it's meant to be an optimization only, so if they are using the API properly, it should not have any semantic impact.

We added this unstable feature a few years ago, as a way to opt out of
context updates, but it didn't prove useful in practice.

We have other proposals for how to address the same problem, like
context selectors.

Since it was prefixed with `unstable_`, we should be able to remove it
without consequence. The hook API already warned if you used it.

Even if someone is using it somewhere, it's meant to be an optimization
only, so if they are using the API properly, it should not have any
semantic impact.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 8, 2021
@@ -590,227 +561,6 @@ describe('ReactNewContext', () => {
]);
});

it('can skip consumers with bitmask', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These have corresponding tests in the context selectors PR

@sizebot
Copy link

sizebot commented Mar 8, 2021

Comparing: 5fe091c...efad8ac

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 = 123.31 kB 123.06 kB = 39.68 kB 39.58 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 129.90 kB 129.60 kB = 41.70 kB 41.57 kB
facebook-www/ReactDOM-prod.classic.js = 414.59 kB 413.17 kB = 76.58 kB 76.29 kB
facebook-www/ReactDOM-prod.modern.js = 402.93 kB 401.51 kB = 74.69 kB 74.39 kB
facebook-www/ReactDOMForked-prod.classic.js = 414.60 kB 413.18 kB = 76.59 kB 76.29 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 123.31 kB 123.06 kB = 39.68 kB 39.58 kB
facebook-www/ReactDOMTesting-dev.classic.js = 978.86 kB 976.83 kB = 219.96 kB 219.48 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-profiling.js = 254.01 kB 253.48 kB = 46.59 kB 46.44 kB
oss-stable/react-dom/umd/react-dom.production.min.js = 123.23 kB 122.97 kB = 40.32 kB 40.19 kB
facebook-www/ReactDOMTesting-dev.modern.js = 949.78 kB 947.75 kB = 213.81 kB 213.33 kB
facebook-www/ReactDOMTesting-prod.classic.js = 401.28 kB 400.42 kB = 75.82 kB 75.66 kB
oss-experimental/react-dom/umd/react-dom.profiling.min.js = 136.04 kB 135.75 kB = 44.29 kB 44.18 kB
oss-experimental/react-dom/cjs/react-dom.profiling.min.js = 136.39 kB 136.10 kB = 43.68 kB 43.54 kB
oss-stable/react-art/umd/react-art.production.min.js = 113.27 kB 113.02 kB = 35.28 kB 35.15 kB
facebook-www/ReactDOMTesting-prod.modern.js = 387.68 kB 386.82 kB = 73.56 kB 73.38 kB
facebook-www/ReactDOMForked-dev.classic.js = 1,072.21 kB 1,069.78 kB = 237.13 kB 236.53 kB
facebook-www/ReactDOM-dev.classic.js = 1,072.20 kB 1,069.77 kB = 237.38 kB 236.78 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-prod.js = 241.47 kB 240.92 kB = 44.34 kB 44.21 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 129.90 kB 129.60 kB = 41.70 kB 41.57 kB
oss-experimental/react-dom/umd/react-dom.production.min.js = 129.73 kB 129.43 kB = 42.38 kB 42.22 kB
facebook-www/ReactDOMForked-dev.modern.js = 1,045.95 kB 1,043.52 kB = 231.95 kB 231.35 kB
facebook-www/ReactDOM-dev.modern.js = 1,045.94 kB 1,043.51 kB = 232.21 kB 231.61 kB
oss-experimental/react-art/umd/react-art.production.min.js = 118.17 kB 117.86 kB = 36.81 kB 36.68 kB
oss-experimental/react-art/umd/react-art.development.js = 745.94 kB 743.99 kB = 158.74 kB 158.21 kB
oss-stable/react-art/umd/react-art.development.js = 701.28 kB 699.41 kB = 149.67 kB 149.19 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js = 702.79 kB 700.90 kB = 150.35 kB 149.86 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js = 91.87 kB 91.62 kB = 28.43 kB 28.32 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js = 657.65 kB 655.83 kB = 141.22 kB 140.79 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js = 720.97 kB 718.94 kB = 156.35 kB 155.85 kB
react-native/implementations/ReactNativeRenderer-dev.js = 715.41 kB 713.38 kB = 155.41 kB 154.88 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js = 87.53 kB 87.28 kB = 27.19 kB 27.07 kB
react-native/implementations/ReactFabric-dev.fb.js = 702.67 kB 700.64 kB = 151.57 kB 151.07 kB
react-native/implementations/ReactFabric-dev.js = 697.09 kB 695.06 kB = 150.71 kB 150.20 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js = 640.63 kB 638.75 kB = 135.50 kB 135.03 kB
oss-experimental/react-art/cjs/react-art.development.js = 642.86 kB 640.97 kB = 140.13 kB 139.64 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js = 657.48 kB 655.53 kB = 138.91 kB 138.41 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js = 610.26 kB 608.45 kB = 133.87 kB 133.42 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js = 99.38 kB 99.09 kB = 30.76 kB 30.62 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js = 626.27 kB 624.38 kB = 137.26 kB 136.78 kB
oss-stable/react-art/cjs/react-art.development.js = 600.38 kB 598.56 kB = 131.48 kB 131.05 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js = 80.34 kB 80.09 kB = 25.08 kB 25.00 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js = 80.52 kB 80.27 kB = 25.37 kB 25.25 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js = 92.89 kB 92.59 kB = 28.81 kB 28.67 kB
facebook-www/ReactTestRenderer-dev.modern.js = 634.47 kB 632.44 kB = 136.42 kB 135.91 kB
facebook-www/ReactTestRenderer-dev.classic.js = 634.46 kB 632.43 kB = 136.41 kB 135.90 kB
oss-stable/react-art/cjs/react-art.production.min.js = 77.45 kB 77.20 kB = 24.16 kB 24.09 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js = 621.62 kB 619.59 kB = 134.96 kB 134.45 kB
facebook-www/ReactDOMForked-profiling.classic.js = 434.52 kB 433.10 kB = 80.07 kB 79.76 kB
facebook-www/ReactDOM-profiling.classic.js = 434.51 kB 433.09 kB = 80.07 kB 79.76 kB
oss-experimental/react-cache/cjs/react-cache.development.js = 8.41 kB 8.38 kB = 2.82 kB 2.81 kB
oss-stable/react-cache/cjs/react-cache.development.js = 8.41 kB 8.38 kB = 2.82 kB 2.81 kB
facebook-www/ReactDOMForked-profiling.modern.js = 422.81 kB 421.39 kB = 78.22 kB 77.92 kB
facebook-www/ReactDOM-profiling.modern.js = 422.80 kB 421.38 kB = 78.22 kB 77.92 kB
facebook-www/ReactART-dev.classic.js = 714.51 kB 712.08 kB = 151.76 kB 151.19 kB
facebook-www/ReactDOMForked-prod.classic.js = 414.60 kB 413.18 kB = 76.59 kB 76.29 kB
facebook-www/ReactDOM-prod.classic.js = 414.59 kB 413.17 kB = 76.58 kB 76.29 kB
facebook-www/ReactART-dev.modern.js = 704.22 kB 701.79 kB = 149.67 kB 149.10 kB
facebook-www/ReactDOMForked-prod.modern.js = 402.94 kB 401.52 kB = 74.70 kB 74.40 kB
facebook-www/ReactDOM-prod.modern.js = 402.93 kB 401.51 kB = 74.69 kB 74.39 kB
oss-experimental/react/umd/react.profiling.min.js = 14.34 kB 14.29 kB = 5.30 kB 5.28 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js = 82.94 kB 82.63 kB = 26.28 kB 26.10 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js = 82.76 kB 82.46 kB = 25.90 kB 25.75 kB
oss-experimental/react-art/cjs/react-art.production.min.js = 82.29 kB 81.98 kB = 25.66 kB 25.51 kB
oss-stable/react/umd/react.profiling.min.js = 13.29 kB 13.24 kB = 5.00 kB 4.98 kB
oss-experimental/react/umd/react.production.min.js = 12.12 kB 12.07 kB = 4.75 kB 4.72 kB
oss-stable/react/umd/react.production.min.js = 11.07 kB 11.02 kB = 4.46 kB 4.43 kB
facebook-www/ReactART-prod.classic.js = 267.92 kB 266.50 kB = 47.52 kB 47.20 kB
facebook-www/ReactART-prod.modern.js = 260.56 kB 259.14 kB = 46.24 kB 45.94 kB
oss-experimental/react/cjs/react.production.min.js = 7.59 kB 7.54 kB = 2.95 kB 2.93 kB
oss-experimental/react/cjs/react-unstable-shared-subset.development.js = 67.64 kB 67.15 kB = 18.40 kB 18.26 kB
oss-stable/react/cjs/react.production.min.js = 6.44 kB 6.39 kB = 2.66 kB 2.63 kB
oss-experimental/react/umd/react.development.js = 107.04 kB 106.17 kB = 26.47 kB 26.27 kB
oss-stable/react/umd/react.development.js = 104.77 kB 103.91 kB = 26.06 kB 25.89 kB
facebook-www/React-dev.classic.js = 99.65 kB 98.65 kB = 24.23 kB 24.04 kB
facebook-www/React-dev.modern.js = 98.63 kB 97.63 kB = 24.00 kB 23.81 kB
facebook-react-native/react/cjs/React-dev.js = 89.61 kB 88.61 kB = 21.49 kB 21.28 kB
oss-experimental/react/cjs/react.development.js = 74.55 kB 73.71 kB = 19.94 kB 19.77 kB
facebook-www/React-prod.classic.js = 17.09 kB 16.90 kB = 4.43 kB 4.37 kB
facebook-www/React-profiling.classic.js = 17.09 kB 16.90 kB = 4.43 kB 4.37 kB
facebook-www/React-prod.modern.js = 16.95 kB 16.75 kB = 4.38 kB 4.32 kB
facebook-www/React-profiling.modern.js = 16.95 kB 16.75 kB = 4.38 kB 4.32 kB
oss-stable/react/cjs/react.development.js = 72.40 kB 71.55 kB = 19.54 kB 19.35 kB
facebook-react-native/react/cjs/React-prod.js = 16.79 kB 16.59 kB = 4.31 kB 4.25 kB
facebook-react-native/react/cjs/React-profiling.js = 16.79 kB 16.59 kB = 4.31 kB 4.25 kB

Generated by 🚫 dangerJS against efad8ac

@acdlite acdlite force-pushed the remove-changedbits branch 4 times, most recently from 6c4d404 to efad8ac Compare March 8, 2021 20:07
Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

Let's do it?

@acdlite acdlite merged commit 6d3ecb7 into facebook:master Mar 19, 2021
@gaearon gaearon deleted the remove-changedbits branch March 20, 2021 02:11
@gaearon gaearon restored the remove-changedbits branch March 20, 2021 02:11
@gaearon gaearon deleted the remove-changedbits branch March 20, 2021 02:11
@gaearon gaearon restored the remove-changedbits branch March 20, 2021 02:11
zhengjitf pushed a commit to zhengjitf/react that referenced this pull request Mar 23, 2021
We added this unstable feature a few years ago, as a way to opt out of
context updates, but it didn't prove useful in practice.

We have other proposals for how to address the same problem, like
context selectors.

Since it was prefixed with `unstable_`, we should be able to remove it
without consequence. The hook API already warned if you used it.

Even if someone is using it somewhere, it's meant to be an optimization
only, so if they are using the API properly, it should not have any
semantic impact.
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Mar 23, 2021
Summary:
This sync includes the following changes:
- **[6d3ecb70d](facebook/react@6d3ecb70d )**: Remove unstable_changedBits ([#20953](facebook/react#20953)) //<Andrew Clark>//
- **[754e30728](facebook/react@754e30728 )**: Delete immediateQueueCallbackNode ([#20980](facebook/react#20980)) //<Andrew Clark>//
- **[be5a2e231](facebook/react@be5a2e231 )**: Land enableSyncMicrotasks ([#20979](facebook/react#20979)) //<Andrew Clark>//
- **[f6bc9c824](facebook/react@f6bc9c824 )**: [Fizz] Expose maxBoundarySize as an option ([#21029](facebook/react#21029)) //<Sebastian Markbåge>//
- **[154b85213](facebook/react@154b85213 )**: [Fizz] Expose a method to explicitly start writing to a Node stream ([#21028](facebook/react#21028)) //<Sebastian Markbåge>//
- **[cf485e6f6](facebook/react@cf485e6f6 )**: [Fizz] Expose a method to abort a pending request ([#21027](facebook/react#21027)) //<Sebastian Markbåge>//
- **[3fb11eed9](facebook/react@3fb11eed9 )**: React Native: Touch Instrumentation Interface ([#21024](facebook/react#21024)) //<Timothy Yung>//
- **[825c3021f](facebook/react@825c3021f )**: Don't delete trailing mismatches during hydration at the root ([#21021](facebook/react#21021)) //<Sebastian Markbåge>//
- **[1d1e49cfa](facebook/react@1d1e49cfa )**: [Fizz] Assign an ID to the first DOM element in a fallback or insert a dummy (and testing infra) ([#21020](facebook/react#21020)) //<Sebastian Markbåge>//
- **[466b26c92](facebook/react@466b26c92 )**: Store commit durations on HostRoot for DevTools access ([#20983](facebook/react#20983)) //<Brian Vaughn>//
- **[89acfa639](facebook/react@89acfa639 )**: Fix native event batching in concurrent mode ([#21010](facebook/react#21010)) //<Ricky>//
- **[0203b6567](facebook/react@0203b6567 )**: chore: update react-reconciler README ([#21016](facebook/react#21016)) //<susiwen8>//

Changelog:
[General][Changed] - React Native sync for revisions c9f6d0a...6d3ecb7

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross, kacieb

Differential Revision: D27231625

fbshipit-source-id: 89c0c0662e69044ae8890486a693013bee6005dd
koto pushed a commit to koto/react that referenced this pull request Jun 15, 2021
We added this unstable feature a few years ago, as a way to opt out of
context updates, but it didn't prove useful in practice.

We have other proposals for how to address the same problem, like
context selectors.

Since it was prefixed with `unstable_`, we should be able to remove it
without consequence. The hook API already warned if you used it.

Even if someone is using it somewhere, it's meant to be an optimization
only, so if they are using the API properly, it should not have any
semantic impact.
@gaearon gaearon mentioned this pull request Mar 29, 2022
@edriang
Copy link

edriang commented Apr 11, 2022

Hey there! The use-context-selection used the unstable_changedBits argument to provide a way to "selectively" update views consuming parts of a major state-tree (Context).

I completely understand the feature was marked as unstable and thereby there were risk for it to be removed.

This comment is just to ask/check if there is a 1:1 replacement I could use/explore to support a similar behavior and integrate in the mentioned library (?)

Otherwise, I think I'll update the library Readme to make it clear this won't work for React >= 18, and probably suggest opting for https://github.com/dai-shi/use-context-selector instead

Thanks in advance for any help!

@gaearon
Copy link
Collaborator

gaearon commented Apr 11, 2022

Sorry, there is no 1:1 replacement. There's been initial work on #20646, but it is currently paused.

JinMuGo added a commit to 42ForYou/RFS that referenced this pull request Mar 17, 2024
JinMuGo added a commit to 42ForYou/RFS that referenced this pull request Mar 17, 2024
* FY-215/perf(changedBits): remove

changedBits 삭제

facebook/react#20953

* FY-215/refactor: remove threadcount

* FY-215/refactor: remove rendererSigil

* FY-215/refactor: project

* FY-215/refactor: remain observedBits
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.

None yet

5 participants