From d70b620fae564bbbec363fa66ae3749956ee4d44 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Wed, 3 Jun 2020 06:33:39 -0700 Subject: [PATCH] Disable render debouncing Summary: This change kinda reverts D21690494, which broke the layout plugin. The layout plugin broken because it's implementation assumes that if `this.props.setPersisted` state is called, those changes are immediately reflected in `this.props.persistedState`. For that to work it means that a render needs to be triggered immediately and synchronously by React. That is a troublesome assumption (React doesn't actually guarantee this) and very likely to break in the future if implementation details change in React or Redux. However, since this is an assumption here, probably more plugins rely on that behavior, so this diff reverts that change. I'll add it the the component library plan to fundamentally address this. The next diff will re-introduce debouncing, just at a different code point. Reviewed By: jknoxville Differential Revision: D21840282 fbshipit-source-id: af69dbded80aa73dfd6558d7cb0268ea0b1c504a --- desktop/app/src/PluginContainer.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/desktop/app/src/PluginContainer.tsx b/desktop/app/src/PluginContainer.tsx index 363a7bc9d..7f0a42025 100644 --- a/desktop/app/src/PluginContainer.tsx +++ b/desktop/app/src/PluginContainer.tsx @@ -384,12 +384,6 @@ class PluginContainer extends PureComponent { } } -// Let's make sure we reive new props in bursts of 200 ms, rather than continously -const DebouncedPluginContainer = debounceRender(PluginContainer, 100, { - leading: true, - trailing: true, -}); - export default connect( ({ connections: { @@ -462,4 +456,4 @@ export default connect( setStaticView, starPlugin, }, -)(DebouncedPluginContainer); +)(PluginContainer);