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

Use Memo and PureComponent where it was missing #1449

Merged
merged 2 commits into from
Jul 25, 2019

Conversation

eneufeld
Copy link
Member

  • Update functional components to use React.memo
  • Update components to extends React.PureComponent

@coveralls
Copy link

coveralls commented Jul 21, 2019

Coverage Status

Coverage increased (+0.2%) to 83.217% when pulling ef4869f on eneufeld:fix/performance_190721 into 7f9145a on eclipsesource:master.

Copy link
Contributor

@edgarmueller edgarmueller 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! There's a re-definition of areEqual in layout.tsx, is this on purpose?

@@ -51,32 +54,56 @@ export const renderLayoutElements = (
));
};

const areEqual = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this re-defined here?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, the types didn't match. But it would make sense to find a common type between MaterialLayoutType and JsonFormsPropTypes, or maybe extend the JsonFormsPropTypes, I can have a look at that

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, now that you mention it, I think this is also the case for the ExpandPanelRenderer. I'd be great if we could unify all of these.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll merge this one then, let's create a follow-up. Could you take care of that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also this needs to be rebased before I can merge it.

Copy link
Member Author

Choose a reason for hiding this comment

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

rebased and removed the unnecessary areEqual

* Update functional components  to use React.memo
* Update components to extends React.PureComponent
* extended the JsonFormsPropTypes by OwnPropsOfRenderer
@eneufeld
Copy link
Member Author

I rebased and removed the unnecessary areEqual methods

@edgarmueller edgarmueller merged commit 5aeeda6 into eclipsesource:master Jul 25, 2019
@edgarmueller edgarmueller added this to the 2.3.0 milestone Jul 26, 2019
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.

3 participants