Skip to content

Commit 43bf2fe

Browse files
committed
process lazy import
1 parent 2d78d22 commit 43bf2fe

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

client/packages/lowcoder/src/pages/editor/editorSkeletonView.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
import Header from "pages/common/header";
2-
import React from "react";
2+
import React, {lazy} from "react";
33
import {
44
Body,
55
EditorContainer,
66
Height100Div,
7-
LeftPanel,
8-
MiddlePanel,
97
} from "pages/common/styledComponent";
108
import { getPanelStatus, getEditorModeStatus, getPanelStyle } from "util/localStorageUtil";
11-
import { BottomSkeleton } from "pages/editor/bottom/BottomContent";
12-
import RightPanel from "pages/editor/right/RightPanel";
9+
// import { BottomSkeleton } from "pages/editor/bottom/BottomContent";
10+
// import RightPanel from "pages/editor/right/RightPanel";
1311
import _ from "lodash";
12+
1413
import styled from "styled-components";
1514
import { default as Skeleton } from "antd/es/skeleton";
1615
import { default as Spin } from "antd/es/spin";
1716
import { useTemplateViewMode, useUserViewMode } from "util/hooks";
1817
import { ProductLoading } from "components/ProductLoading";
1918
import { default as LoadingOutlined } from "@ant-design/icons/LoadingOutlined";
2019

20+
const BottomSkeleton = lazy(() => import("pages/editor/bottom/BottomContent").then(module => ({default: module.BottomSkeleton})));
21+
const RightPanel = lazy(() => import('pages/editor/right/RightPanel'));
22+
const LeftPanel = lazy(() => import("pages/common/styledComponent").then(module =>({default: module.LeftPanel})));
23+
const MiddlePanel = lazy(() => import("pages/common/styledComponent").then(module =>({default: module.MiddlePanel})));
24+
2125
const StyledSkeleton = styled(Skeleton)`
2226
padding: 16px;
2327
`;

client/packages/lowcoder/src/pages/editor/editorView.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
ScrollBar,
1818
} from "lowcoder-design";
1919
import { useTemplateViewMode } from "util/hooks";
20-
import Header, {
20+
import {
2121
type PanelStatus,
2222
type TogglePanel,
2323
type EditorModeStatus,
@@ -55,7 +55,17 @@ import { isAggregationApp } from "util/appUtils";
5555
import EditorSkeletonView from "./editorSkeletonView";
5656
import { getCommonSettings } from "@lowcoder-ee/redux/selectors/commonSettingSelectors";
5757
import { isEqual, noop } from "lodash";
58-
import { BottomSkeleton } from "./bottom/BottomContent";
58+
// import { BottomSkeleton } from "./bottom/BottomContent";
59+
60+
const Header = lazy(
61+
() => import("pages/common/header")
62+
.then(module => ({default: module.default}))
63+
);
64+
65+
const BottomSkeleton = lazy(
66+
() => import("pages/editor/bottom/BottomContent")
67+
.then(module => ({default: module.BottomSkeleton}))
68+
);
5969

6070
const LeftContent = lazy(
6171
() => import('./LeftContent')

0 commit comments

Comments
 (0)