-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Add enableShallowPropDiffing feature flag #29664
Add enableShallowPropDiffing feature flag #29664
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Comparing: 1df34bd...3a1eb45 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With enableShallowPropDiffing hardcoded to true
If those test fail, then we need to make sure there is a testing variant that runs then, so we can add the @gate !enableShallowPropDiffing
to disable those tests when this flag is on. As it stands, none of the tests seem to be running with this flag enabled, so there's no coverage for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment
aa86496
to
f7a28af
Compare
@dmytrorykun sorry I wasn't clear, just adding the gate pragma isn't sufficient. The issue is that there are no test variants running with the feature flag enabled. If you hardcode it to true, you'll see this test failure: This shows that one of the tests you gated actually passes when the flag is enabled (which we fail for, gate tests must fail if the condition isn't met). This doesn't fail on the PR, because the test is not running when this flag is enabled. I can help creating a test variant that runs when the variant is enabled. |
PR for xplat test variants: #29734 |
## Overview We didn't have any tests that ran in persistent mode with the xplat feature flags (for either variant). As a result, invalid test gating like in #29664 were not caught. This PR adds test flavors for `ReactFeatureFlag-native-fb.js` in both variants.
…leShallowPropDiffing is set to true.
be05d6f
to
3a1eb45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for waiting for the tests to be fixed.
## Summary We currently do deep diffing for object props, and also use custom differs, if they are defined, for props with custom attribute config. The idea is to simply do a `===` comparison instead of all that work. We will do less computation on the JS side, but send more data to native. The hypothesis is that this change should be neutral in terms of performance. If that's the case, we'll be able to get rid of custom differs, and be one step closer to deleting view configs. This PR adds the `enableShallowPropDiffing` feature flag to support this experiment. ## How did you test this change? With `enableShallowPropDiffing` hardcoded to `true`: ``` yarn test packages/react-native-renderer ``` This fails on the following test cases: - should use the diff attribute - should do deep diffs of Objects by default - should skip deeply-nested changed functions Which makes sense with this change. These test cases should be deleted if the experiment is shipped. DiffTrain build for [eb259b5](eb259b5)
## Summary We currently do deep diffing for object props, and also use custom differs, if they are defined, for props with custom attribute config. The idea is to simply do a `===` comparison instead of all that work. We will do less computation on the JS side, but send more data to native. The hypothesis is that this change should be neutral in terms of performance. If that's the case, we'll be able to get rid of custom differs, and be one step closer to deleting view configs. This PR adds the `enableShallowPropDiffing` feature flag to support this experiment. ## How did you test this change? With `enableShallowPropDiffing` hardcoded to `true`: ``` yarn test packages/react-native-renderer ``` This fails on the following test cases: - should use the diff attribute - should do deep diffs of Objects by default - should skip deeply-nested changed functions Which makes sense with this change. These test cases should be deleted if the experiment is shipped. DiffTrain build for commit eb259b5.
Summary
We currently do deep diffing for object props, and also use custom differs, if they are defined, for props with custom attribute config.
The idea is to simply do a
===
comparison instead of all that work. We will do less computation on the JS side, but send more data to native.The hypothesis is that this change should be neutral in terms of performance. If that's the case, we'll be able to get rid of custom differs, and be one step closer to deleting view configs.
This PR adds the
enableShallowPropDiffing
feature flag to support this experiment.How did you test this change?
With
enableShallowPropDiffing
hardcoded totrue
:This fails on the following test cases:
Which makes sense with this change. These test cases should be deleted if the experiment is shipped.