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

[6.7] Fix: Prevent some needless re-rendering in high-level components (#31958) #32359

Merged
merged 1 commit into from
Mar 5, 2019

Conversation

w33ble
Copy link
Contributor

@w33ble w33ble commented Mar 2, 2019

Backports the following commits to 6.7:

…stic#31958)

In an effort to remove the workpad renaming lag in elastic#25070, I started hunting down and fixing re-renders that happened with the name change. 

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering
@w33ble w33ble added the backport label Mar 2, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@w33ble w33ble merged commit 72c7595 into elastic:6.7 Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants