soapbox.tsx: load some components async, reduce bundle size

This commit is contained in:
Alex Gleason
2023-10-07 18:18:50 -05:00
parent 74817c40b7
commit 63b98bff4d

View File

@ -13,11 +13,8 @@ import { loadInstance } from 'soapbox/actions/instance';
import { fetchMe } from 'soapbox/actions/me';
import { loadSoapboxConfig } from 'soapbox/actions/soapbox';
import * as BuildConfig from 'soapbox/build-config';
import GdprBanner from 'soapbox/components/gdpr-banner';
import Helmet from 'soapbox/components/helmet';
import LoadingScreen from 'soapbox/components/loading-screen';
import { StatProvider } from 'soapbox/contexts/stat-context';
import EmbeddedStatus from 'soapbox/features/embedded-status';
import {
ModalContainer,
OnboardingWizard,
@ -42,9 +39,13 @@ import { generateThemeCss } from 'soapbox/utils/theme';
import { checkOnboardingStatus } from '../actions/onboarding';
import { preload } from '../actions/preload';
import ErrorBoundary from '../components/error-boundary';
import UI from '../features/ui';
import { store } from '../store';
const GdprBanner = React.lazy(() => import('soapbox/components/gdpr-banner'));
const Helmet = React.lazy(() => import('soapbox/components/helmet'));
const EmbeddedStatus = React.lazy(() => import('soapbox/features/embedded-status'));
const UI = React.lazy(() => import('soapbox/features/ui'));
// Configure global functions for developers
createGlobals(store);