You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2022/10/07 17:14:19 UTC

[superset] 10/13: fix: Race conditions with setupExtensions (#21647)

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch 2022.39.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 98fcab48df3dce9898f766ff17dd6548f33c47e1
Author: Geido <60...@users.noreply.github.com>
AuthorDate: Wed Oct 5 12:38:51 2022 +0300

    fix: Race conditions with setupExtensions (#21647)
    
    (cherry picked from commit de444d4de6a917af8f8efe2335fb1a26ac86e6d8)
---
 superset-frontend/src/SqlLab/App.jsx  | 2 ++
 superset-frontend/src/preamble.ts     | 3 ---
 superset-frontend/src/profile/App.tsx | 2 ++
 superset-frontend/src/views/App.tsx   | 2 ++
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/src/SqlLab/App.jsx b/superset-frontend/src/SqlLab/App.jsx
index ce768fee8c..812202eec2 100644
--- a/superset-frontend/src/SqlLab/App.jsx
+++ b/superset-frontend/src/SqlLab/App.jsx
@@ -29,6 +29,7 @@ import {
   isFeatureEnabled,
   FeatureFlag,
 } from 'src/featureFlags';
+import setupExtensions from 'src/setup/setupExtensions';
 import getInitialState from './reducers/getInitialState';
 import rootReducer from './reducers/index';
 import { initEnhancer } from '../reduxUtils';
@@ -45,6 +46,7 @@ import '../assets/stylesheets/reactable-pagination.less';
 import { theme } from '../preamble';
 
 setupApp();
+setupExtensions();
 
 const appContainer = document.getElementById('app');
 const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
diff --git a/superset-frontend/src/preamble.ts b/superset-frontend/src/preamble.ts
index f6ae99b084..73ccb947a7 100644
--- a/superset-frontend/src/preamble.ts
+++ b/superset-frontend/src/preamble.ts
@@ -24,7 +24,6 @@ import { configure, makeApi, supersetTheme } from '@superset-ui/core';
 import { merge } from 'lodash';
 import setupClient from './setup/setupClient';
 import setupColors from './setup/setupColors';
-import setupExtensions from './setup/setupExtensions';
 import setupFormatters from './setup/setupFormatters';
 import setupDashboardComponents from './setup/setupDasboardComponents';
 import { BootstrapUser, User } from './types/bootstrapTypes';
@@ -34,8 +33,6 @@ if (process.env.WEBPACK_MODE === 'development') {
   setHotLoaderConfig({ logLevel: 'debug', trackTailUpdates: false });
 }
 
-setupExtensions();
-
 // eslint-disable-next-line import/no-mutable-exports
 export let bootstrapData: {
   user?: BootstrapUser;
diff --git a/superset-frontend/src/profile/App.tsx b/superset-frontend/src/profile/App.tsx
index 1f2cd144af..3704dcb4b5 100644
--- a/superset-frontend/src/profile/App.tsx
+++ b/superset-frontend/src/profile/App.tsx
@@ -27,10 +27,12 @@ import App from 'src/profile/components/App';
 import messageToastReducer from 'src/components/MessageToasts/reducers';
 import { initEnhancer } from 'src/reduxUtils';
 import setupApp from 'src/setup/setupApp';
+import setupExtensions from 'src/setup/setupExtensions';
 import { theme } from 'src/preamble';
 import ToastContainer from 'src/components/MessageToasts/ToastContainer';
 
 setupApp();
+setupExtensions();
 
 const profileViewContainer = document.getElementById('app');
 const bootstrap = JSON.parse(
diff --git a/superset-frontend/src/views/App.tsx b/superset-frontend/src/views/App.tsx
index f13b9c5501..21a3868491 100644
--- a/superset-frontend/src/views/App.tsx
+++ b/superset-frontend/src/views/App.tsx
@@ -34,12 +34,14 @@ import setupApp from 'src/setup/setupApp';
 import setupPlugins from 'src/setup/setupPlugins';
 import { routes, isFrontendRoute } from 'src/views/routes';
 import { Logger } from 'src/logger/LogUtils';
+import setupExtensions from 'src/setup/setupExtensions';
 import { RootContextProviders } from './RootContextProviders';
 import { ScrollToTop } from './ScrollToTop';
 import QueryProvider from './QueryProvider';
 
 setupApp();
 setupPlugins();
+setupExtensions();
 
 const user = { ...bootstrapData.user };
 const menu = {