-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Experimental VirtualList Optimization #27115
Conversation
…ops and bind onCellLayout
…nLayout to _onLayout private method
…renderer' into virtuallist-optimize-cellrenderer
|
@cpojer this seems like a more reasonable approach. What can we do to move this along? |
Is there a way to help get this merged? |
This is open for 9 months already. Any way to get some attention to this? |
Is there any reason why this has been left open? |
} | ||
render(): React.Node { | ||
return ( | ||
<ExperimentalVirtualizedListOptContext.Consumer> |
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.
Some thoughts about how we do experimentation with this.
I'm hesitant about this approach because we're wrapping a Context around everyone's sticky header.
I'm thinking we approach this like the component re-factors we've been doing where we create an injection that is up to product teams to include in their bundle. The injection is read then instead of a new prop experimentalVirtualizedListOpt
.
See how we're doing Animated refactor:
- Injection: https://github.com/facebook/react-native/blob/1465c8f3874cdee8c325ab4a4916fda0b3e43bdb/Libraries/Animated/createAnimatedComponentInjection.js
Then in our Bundle initialization we have:
import createAnimatedComponentInjection from 'createAnimatedComponentInjection';
import createAnimatedComponent_EXPERIMENTAL from 'createAnimatedComponent_EXPERIMENTAL';
...
if (<our experiment framework says you're in this test>) {
createAnimatedComponentInjection.inject(
createAnimatedComponent_EXPERIMENTAL,
);
}
So for this case we'd probably read the injection value like so:
if (OUR_INJECTION.useExperimentalThing) {
child.props.onLayout(event, child.props.cellKey, child.props.index);
} else {
child.props.onLayout(event);
}
What do you think about this approach? I'm happy to import and make these changes
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.
What do you think about this approach? I'm happy to import and make these changes
I didn't quite get you, but am happy to go through your PR.
@lunaleaps has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@azizhk What kind of tests do you need help writing for this? |
prevCellKey: prevCellKey, | ||
onUpdateSeparators: this._onUpdateSeparators, | ||
onUnmount: this._onCellUnmount, | ||
extraData: extraData, |
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.
I believe this would be a new prop we're passing through in the "non-experiment" path. Can we update this to ensure we're not changing original behavior?
Summary: This is VirtualList Optimization done by christianbach in facebook#21163 enabled behind a prop: `experimentalVirtualizedListOpt` with backward compatibility. Fixes facebook#20174 based of jasekiw pull request facebook#20208 ## Changelog // TODO: [CATEGORY] [TYPE] - Message Pull Request resolved: facebook#27115 Test Plan: // TODO: Add tests related to backward compatibility. (Will need help) Differential Revision: D30095387 Pulled By: lunaleaps fbshipit-source-id: 1c41e9e52beeb79b56b19dfb12d896a2c4c49529
@azizhk Here is what I meant by using an injection: https://github.com/facebook/react-native/pull/31947/files Somewhere in your bundle initialization, you can enable the experiment by
|
Basically I need to add tests which ensure that we are not re-rendering the rows. So something like re-render the virtual list, don't expect the cells to be rendered again. |
@azizhk's comment on https://github.com/facebook/react-native/pull/31947/files (a demonstration PR)
Mm that's a good point. I think since this is a question of optimizing overall that's a fine tradeoff. We'll want to run an experiment internally.. to be honest I'm not sure I understand the optimization... might have to scan the issue history a bit more closely or if you could give me TL;DR? |
This PR is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days |
This PR was closed because the author hasn't provided the requested feedback after 7 days. |
This is VirtualList Optimization done by @christianbach in #21163 enabled behind a prop:
experimentalVirtualizedListOpt
with backward compatibility.Summary
Fixes #20174 based of @jasekiw pull request #20208
Changelog
// TODO:
[CATEGORY] [TYPE] - Message
Test Plan
// TODO:
Add tests related to backward compatibility. (Will need help)