From 3d8a2b859e567224e412f2e5e8dbb5fa83ba1d97 Mon Sep 17 00:00:00 2001 From: Jianchao Yang Date: Mon, 30 Mar 2020 09:31:46 -0700 Subject: [PATCH] Build: fix hot reload for charts (#9400) * Fix hot reload for charts * Override tsc options for plugins Plugins will sometimes have their own `tsconfig.json`, which will interfere with the dev server config if configured inappropriately. This change makes sure `tsc` (and `ts-loader`) always compiles to `esnext` modules, so we don't get "Uncaught ReferenceError: exports is not defined" error. --- superset-frontend/src/chart/ChartRenderer.jsx | 6 +++++- .../src/dashboard/components/gridComponents/Chart.jsx | 3 ++- superset-frontend/src/preamble.js | 5 +++++ superset-frontend/tsconfig.json | 2 ++ superset-frontend/webpack.config.js | 9 +++++++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/chart/ChartRenderer.jsx b/superset-frontend/src/chart/ChartRenderer.jsx index 2adfd33a8..a5cb33255 100644 --- a/superset-frontend/src/chart/ChartRenderer.jsx +++ b/superset-frontend/src/chart/ChartRenderer.jsx @@ -94,7 +94,8 @@ class ChartRenderer extends React.Component { nextProps.height !== this.props.height || nextProps.width !== this.props.width || nextProps.triggerRender || - nextProps.formData.color_scheme !== this.props.formData.color_scheme + nextProps.formData.color_scheme !== this.props.formData.color_scheme || + nextProps.cacheBusterProp !== this.props.cacheBusterProp ) { return true; } @@ -198,6 +199,9 @@ class ChartRenderer extends React.Component { return (