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

Bump RLV and remove invariant #284

Merged
merged 4 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]

- Reduce number of render item calls

- https://github.com/Shopify/flash-list/pull/253

- Upgrade recyclerlistview to v3.2.0-beta.2
- https://github.com/Shopify/flash-list/pull/284

## [0.4.1] - 2022-03-29

- Crash fix for android activity switching (#256)
Expand Down
3 changes: 1 addition & 2 deletions fixture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"react-native-gesture-handler": "^2.3.2",
"react-native-reanimated": "^2.4.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.13.1",
"recyclerlistview": "3.1.0-alpha.9"
"react-native-screens": "^3.13.1"
},
"devDependencies": {
"babel-jest": "^27.5.1",
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"jestSetup.js"
],
"dependencies": {
"invariant": "^2.2.4",
"recyclerlistview": "3.1.0-alpha.9"
"recyclerlistview": "3.2.0-beta.2"
}
}
9 changes: 2 additions & 7 deletions src/__tests__/FlashList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("FlashList", () => {
expect(autoLayoutView.props.onBlankAreaEvent).not.toBeUndefined();
});

it("calls render item only when data of the items has changed", (done) => {
it("calls render item only when data of the items has changed", () => {
const renderItemMock = jest.fn(({ item }) => {
return <Text>{item}</Text>;
});
Expand All @@ -132,12 +132,7 @@ describe("FlashList", () => {
flashList.setProps({ numColumns: 2 });
// render item should be called 0 times because only layout of items would have changed
expect(renderItemMock).toHaveBeenCalledTimes(0);

// There's some async operation happening inside the scroll component causing jest to throw errors
// This is a workaround to silence it.
requestAnimationFrame(() => {
done();
});
flashList.unmount();
Copy link
Collaborator Author

@naqvitalha naqvitalha Apr 4, 2022

Choose a reason for hiding this comment

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

Jest isn't doing unmount on its own. In real world async operations will stop as soon as component unmounts. This test was breaking intermittently so I fixed it.

});

it("keeps component mounted based on prepareForLayoutAnimationRender being called", () => {
Expand Down