perf(ee): code-split the Settings page away (#24993)

This commit is contained in:
Ivan Akulov 2023-07-10 15:51:15 +02:00 committed by GitHub
parent 10b1081b7a
commit b6dbe65e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View File

@ -47,7 +47,7 @@ import UserProfile from "pages/UserProfile";
import { getCurrentUser } from "actions/authActions";
import { getCurrentUserLoading } from "selectors/usersSelectors";
import Setup from "pages/setup";
import Settings from "@appsmith/pages/AdminSettings";
import SettingsLoader from "pages/Settings/loader";
import SignupSuccess from "pages/setup/SignupSuccess";
import type { ERROR_CODES } from "@appsmith/constants/ApiConstants";
import TemplatesListLoader from "pages/Templates/loader";
@ -101,7 +101,7 @@ export function Routes() {
}
/>
<SentryRoute
component={Settings}
component={SettingsLoader}
exact
path={ADMIN_SETTINGS_CATEGORY_PATH}
/>

View File

@ -0,0 +1,22 @@
import React from "react";
import PageLoadingBar from "pages/common/PageLoadingBar";
import { retryPromise } from "utils/AppsmithUtils";
const Page = React.lazy(() =>
retryPromise(
() =>
import(
/* webpackChunkName: "settings" */ "@appsmith/pages/AdminSettings/index"
),
),
);
const AdminSettingsLoader = (props: any) => {
return (
<React.Suspense fallback={<PageLoadingBar />}>
<Page {...props} />
</React.Suspense>
);
};
export default AdminSettingsLoader;