Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Removing pure components from gates #1004

Merged

Conversation

jespino
Copy link
Member

@jespino jespino commented Mar 26, 2018

Basically PureComponent is not really needed, because the children prop will be
almost alwais a new object, so will rerender almost every single time, so we
can skip the props comparison.

@jespino jespino requested review from grundleborg and mkraft and removed request for grundleborg March 26, 2018 21:34
@jespino jespino added the 2: Dev Review Requires review by a core commiter label Mar 26, 2018
mkraft
mkraft approved these changes Mar 26, 2018
Copy link
Contributor

@mkraft mkraft left a comment

Choose a reason for hiding this comment

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

I'm just wondering if this change would remove the ability to do something like this where the children are set as a constant in the parent component? If it's a PureComponent I think it would be able to utilize that optimization.

Copy link
Contributor

@mkraft mkraft left a comment

Choose a reason for hiding this comment

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

@jespino
Copy link
Member Author

jespino commented Mar 27, 2018

Yes, you are right but I'm not sure about how often can we use that, because an static component doesn't use any props from the parent, if they are things that we can build from the ComponentDidMount or things like that, it is ok, but more than that, I think will be complicated to maintain as an not-changing object.

@grundleborg grundleborg added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Mar 29, 2018
@jasonblais
Copy link
Contributor

@jespino Can you help update the base branch now that phase 1 permissions is merged?

@jasonblais jasonblais added this to the v4.9.0 milestone Apr 2, 2018
@jespino jespino changed the base branch from advanced-permissions-phase-1 to master April 2, 2018 13:06
@jespino
Copy link
Member Author

jespino commented Apr 2, 2018

Done! :)

@jespino jespino force-pushed the removed-pure-componens-from-gates branch from c3aded2 to ad6baa2 Compare April 2, 2018 17:48
@jespino jespino force-pushed the removed-pure-componens-from-gates branch from ad6baa2 to 99d96fb Compare April 4, 2018 08:52
@jespino
Copy link
Member Author

jespino commented Apr 4, 2018

Rebased and tests passing :)

@GoldUniform GoldUniform merged commit 2a7d87f into mattermost:master Apr 4, 2018
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Apr 4, 2018
@lindalumitchell lindalumitchell added the Tests/Not Needed Does not require new release tests label Apr 5, 2018
hmhealey pushed a commit that referenced this pull request Aug 28, 2020
…1004)

* adding undelete action

* fix lint

* adding undelete

* remove delete_at

* add entities reducers  test for unarchive

* fix actions test

* add post tests

* undeleted to restored

* change undelete to unarchive

* fix tests

* suggested changes

* clean up

* use getConfig
hmhealey pushed a commit that referenced this pull request Mar 17, 2021
…1004)

* adding undelete action

* fix lint

* adding undelete

* remove delete_at

* add entities reducers  test for unarchive

* fix actions test

* add post tests

* undeleted to restored

* change undelete to unarchive

* fix tests

* suggested changes

* clean up

* use getConfig
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Not Needed Does not require new release tests
Projects
None yet
7 participants