Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Display change metrics feature tour. #7661
Display change metrics feature tour. #7661
Changes from 15 commits
2bc796f
d68eaa7
514d7d8
8ea9326
33f7de7
ca64103
ccf78bc
ac7ffb7
1a5c0aa
9584b40
27ead2f
fe8d33b
4348f61
0bf9abb
0eb476d
28c6cfd
492a5b0
78a27c5
fba5794
882d893
0bb67ad
18d095c
e5c9d67
0808bf8
4581d46
9a0ca0f
7e4e26b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 is the point of adding this new hook? I don't see it is required in IB. I understand that you try to encapsulate the logic but extracting it into a separate hook makes sense only when there are multiple components that use it. In this situation we have just one place where we use this hook and there is no potential to have another component that needs this in the future. Let's merge this hook into the
ChangeMetricsLink
component to avoid bloating up our code base with extra files.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.
@eugene-manuilov It wasn't required in IB, it was a suggestion on previous CR, it was originally in
ChangeMetricsLink
, but since it was adding certain number of lines for this logic, it was moved to separate hook - comment for reference - #7661 (comment)Let me know what you think
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.
Ah... okay, then let's keep it as is although that is less appropriate IMO because:
cc @aaemnnosttv
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.
Thanks for your review @eugene-manuilov ! A few thoughts in response to your comments above.
We shouldn't have more files for no reason of course, but we often use more files to keep each of them smaller and easier to understand and extract complexity. I don't think that it only makes sense to extract components/hooks if there is more than one usage of them, there are plenty of instances where we extract parts to keep the overall size and complexity down, e.g.
BannerNotification
components.I find this point a bit hard to see, as I feel that it's harder to understand the component with a large portion of its code only needed for the tour effect which is itself easier to understand in isolation IMO. In the context of the component, we see that it has a named effect about its tour, so you could argue that it's easier to understand in this way.
This is true, but the increase in size is probably only a handful of bytes which isn't a concern. There are likely many other things we could optimize to reduce the overall size of our assets in more impactful ways, so I don't think bundle size is an issue here. We have the compressed size action to help highlight changes to our bundle size which reported didn't show any substantial change here.
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.
This isn't necessary since we can do the same in the one selector as this isn't a common need.
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 realize this is how it was before but we shouldn't be using selectors to make assertions about actions. These should test the effect of the action (state change, request, etc).