-
Notifications
You must be signed in to change notification settings - Fork 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
Refactor the componentDidUpdate method for ReportActionCompose #4768
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
01d5c3d
Refactor the componentDidUpdate for ReportActionCompose
mountiny 56dfcf0
Refactor and return early
mountiny 57ec194
Refactor componentDidUpdate in ReportScreen as well and update comments
mountiny 9eb84c0
Remove redundant comment
mountiny a27e869
Update the comment to give better description and reason for the change
mountiny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
NAB, I know this was probably added since you noticed that the style doesn't match what I asked for in another comment. But since this change doesn't have anything to do with the current change I wonder if a better way to handle this would be to:
if
blocks to see which are not using early returns and fix themI'm not asking you to do it since we don't really have any rules or conventions about this. Some feel like it's fine to fix things that are wrong when you see them and others (like me) prefer to keep only material changes in PRs so that context is preserved and no one needs to ask why something was done. I don't think there is a "right way", so mostly just sharing this perspective.
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 really appreciate you sharing this with me. This helps me a lot 🙇 I do agree it is not ideal to add changes and fixes to PR where it might be unrelated and uncalled for. I haven't realized it now, but I will definitely try to keep this on mind for future! It will make for clearer and easier to follow issues and PR for sure 🙌
I agree with you on the proposed process how to handle such a change, although as you stated, I think before creating such an investigation issue, we should make sure we update the Styling guidelines accordingly. That way if we fix this bad smell throughout the codebase we will have lesser chances of introducing it again.
Do you think this is work of being added to the styling guide, or it is too nitty-gritty 👀 ?
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.
FWIW how I view "adjacent style changes" (completely just made that up) like this are to weigh the "pros vs cons" of how bad it might be to have to revert or quickly fix if this breaks something unexpectedly.
I agree this seems like a pretty low risk change so probably fine to leave. But this mean you should be on the look out for any messages in #api-errors, #qa, or new GHs from Success that mention anything about weirdness about the report pages.
If you're not willing to be on "high alert" and fix something like that then I'd say only make the change you intended to make and leave the "adjacent style change" alone and spin up a new GH to fix it so that it's properly tested in it's own PR.
I don't think there is a need for a style guide rule or anything since there will be nuances to every PR where sometimes it makes sense to change all "adjacent style changes" and other times it might not make the most sense.
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.
@bondydaa Thank you very much for your 2 cents here! Glad to have another perspective on this 💯
I will keep an eye on those channels! Thanks for the heads up. I think in this case there should not be high risk 🤞 since the logic stays the same, but I totally see what you mean. Even with minor styling changes, we should make sure all the flows are working and no edge case has been omitted 👍
Regarding the styling guide, I see your point. Eventually, informing more and more engineers about this style approach, we might get more of them using it in their code and PR reviews consequently making it standard the organic way.