Skip to content

Commit

Permalink
fix: Race conditions with setupExtensions (#21647)
Browse files Browse the repository at this point in the history
  • Loading branch information
geido committed Oct 5, 2022
1 parent ebd7536 commit de444d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions superset-frontend/src/SqlLab/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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'));
Expand Down
3 changes: 0 additions & 3 deletions superset-frontend/src/preamble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/src/profile/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/src/views/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit de444d4

Please sign in to comment.