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

refactor: Upgrade react and react-dom to v16.8 and refactor Avatar #1171

Merged
merged 6 commits into from
May 7, 2019

Conversation

j3tan
Copy link
Contributor

@j3tan j3tan commented May 2, 2019

BREAKING CHANGE: peerDep React requirement have been bumped higher

@j3tan j3tan requested a review from a team May 2, 2019 17:58
@boxcla
Copy link

boxcla commented May 2, 2019

Verified that @j3tan has signed the CLA. Thanks for the pull request!

@j3tan j3tan requested a review from a team as a code owner May 3, 2019 18:45
@@ -73,12 +73,7 @@ class Assignees extends React.Component<Props> {
/>
}
>
<AssigneeStatus
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for whatever reason, the data-testid in the wrapper.find was returning both this top level function and the nested div causing 2x the number of objects returned. moving the data-testid into the child component fixes that without impacting usage

@@ -164,10 +164,6 @@ describe('elements/content-sidebar/ContentSidebar', () => {
});

test('should set the state with the file and view and then call fetchMetadata', () => {
wrapper = getWrapper();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unnecessary due to beforeEach, also was causing a random failure

Copy link
Contributor

@jstoffan jstoffan left a comment

Choose a reason for hiding this comment

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

I think the use of hooks in Avatar is a reasonable basic example of the feature. The additional arbitrary complexity and boilerplate introduced into the tests isn't very palatable, though.

Finally, chore commits don't mix very well with breaking changes, since that scope doesn't usually trigger new releases. Consider using feat, refactor, etc., instead.

package.json Outdated
@@ -175,7 +175,7 @@
"deepmerge": "^2.1.1",
"draft-js": "^0.10.1",
"enzyme": "3.8.0",
"enzyme-adapter-react-16": "^1.10.0",
"enzyme-adapter-react-16": "1.12.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be pinned to this specific version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not fixed, can change this to ^

avatar = <UnknownUserAvatar className="avatar-icon" />;
// Reset hasImageErrored state when avatarUrl changes
useEffect(() => {
if (hasImageErrored) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this check necessary or should we just reset setHasImageErrored to false whenever the url changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. since this only fires when url changes, there should be no downside to just calling this always

@j3tan
Copy link
Contributor Author

j3tan commented May 3, 2019

Finally, chore commits don't mix very well with breaking changes, since that scope doesn't usually trigger new releases. Consider using feat, refactor, etc., instead.

yeah, actually just copied the previous react upgrade PR message, but I can update to refactor

@j3tan j3tan changed the title chore: upgrade react and react-dom to v16.8 (#761) refactor: upgrade react and react-dom to v16.8 (#761) May 3, 2019
@j3tan j3tan changed the title refactor: upgrade react and react-dom to v16.8 (#761) refactor: Upgrade react and react-dom to v16.8 and refactor Avatar May 3, 2019
@j3tan j3tan force-pushed the ugprade-react-v16.8 branch from 8d1ad15 to 24c141e Compare May 3, 2019 22:28
@@ -175,7 +175,7 @@
"deepmerge": "^2.1.1",
"draft-js": "^0.10.1",
"enzyme": "3.8.0",
"enzyme-adapter-react-16": "^1.10.0",
"enzyme-adapter-react-16": "^1.12.1",
"enzyme-to-json": "^3.3.4",
"eslint": "^4.19.1",

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@j3tan j3tan May 6, 2019

Choose a reason for hiding this comment

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

yes, we will be adding this plugin. I'll discuss it at the next FTL meeting but it'll be an update to @box/frontend

Copy link
Contributor

@jstoffan jstoffan left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for taking the time to work this out, @j3tan.

@j3tan j3tan merged commit 7dd1bdf into box:master May 7, 2019
@j3tan j3tan deleted the ugprade-react-v16.8 branch May 7, 2019 01:03
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.

4 participants