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

feat: improve artwork lists performance (attempt 1) #8782

Merged
merged 5 commits into from
May 30, 2023

Conversation

dimatretyak
Copy link
Contributor

@dimatretyak dimatretyak commented May 30, 2023

This PR resolves []

Notion Card: https://www.notion.so/artsy/Selecting-unselecting-lists-in-the-sheet-can-feel-a-bit-sluggish-Takes-a-second-or-two-to-settle-b63ab6d694dc4f8e94ccefda22386b84

Description

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

  • improve artwork lists performance - dimatretyak

Need help with something? Have a look at our docs, or get in touch with us.

@dimatretyak dimatretyak self-assigned this May 30, 2023
@dimatretyak dimatretyak changed the title feat: improve artwork lists performance feat: improve artwork lists performance (approach №1) May 30, 2023
@dimatretyak dimatretyak changed the title feat: improve artwork lists performance (approach №1) feat: improve artwork lists performance (approach 1) May 30, 2023
</Join>
</Flex>
</TouchableOpacity>
)
}

export const ArtworkListItem = memo(Item)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

re-render the component only when the props have changed

@dimatretyak dimatretyak changed the title feat: improve artwork lists performance (approach 1) feat: improve artwork lists performance (attempt 1) May 30, 2023
@dimatretyak dimatretyak marked this pull request as ready for review May 30, 2023 16:23
anandaroop
anandaroop previously approved these changes May 30, 2023
Copy link
Member

@anandaroop anandaroop left a comment

Choose a reason for hiding this comment

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

Looks good, just a TS question below…

@@ -12,9 +13,13 @@ interface ArtworkListsProps {
me: ArtworkLists_me$key | null
}

type ArtworkList =
| NonNullable<ArtworkLists_me$data["savedArtworksArtworkList"]>
| ExtractNodeType<ArtworkLists_me$data["savedArtworksArtworkList"]>
Copy link
Member

@anandaroop anandaroop May 30, 2023

Choose a reason for hiding this comment

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

I'm unclear about what this type is representing. Is L18 L17 not sufficient?

(The ExtractNodeType utility seems to be meant for use with collections only?)

Copy link
Contributor Author

@dimatretyak dimatretyak May 30, 2023

Choose a reason for hiding this comment

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

Is L18 not sufficient

it will be enough, but it seems to me it would be more correct to use the type of "Saved Artworks" and Custom Artwork lists

my bad, i forgot to update some code

Copy link
Contributor Author

@dimatretyak dimatretyak May 30, 2023

Choose a reason for hiding this comment

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

The ExtractNodeType utility seems to be meant for use with collections only

yes, for cases when the query has edges -> node. For example

{
  someConnection {
    edges {
      node {
        ...
      }
    }
  }
}

Copy link
Contributor Author

@dimatretyak dimatretyak May 30, 2023

Choose a reason for hiding this comment

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

Done: c7f2a0d

Copy link
Member

@anandaroop anandaroop left a comment

Choose a reason for hiding this comment

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

👍🏽

@dimatretyak dimatretyak merged commit 51b69f2 into main May 30, 2023
@dimatretyak dimatretyak deleted the dimatretyak/feat/improve-artwork-lists-performance branch May 30, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants