Skip to content

[WIP] Reduce lowcoder-sdk initial bundle size #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix appEditor showing while loading issue
  • Loading branch information
raheeliftikhar5 committed Mar 27, 2024
commit 103152ddef9ef8e9c4475e6441d1a065f53f3a08
12 changes: 6 additions & 6 deletions client/packages/lowcoder-sdk-webpack-bundle/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = {
output: {
path: path.resolve(__dirname, 'dist'),
// publicPath: "https://sdk.lowcoder.cloud/",
publicPath: "/",
publicPath: "https://webviewer.lowcoder.cloud/",
filename: '[name].bundle.js',
clean: true,
},
Expand All @@ -113,11 +113,11 @@ module.exports = {
path: path.resolve(__dirname, 'bundle'),
filename: 'bundle.js'
}),
new CopyPlugin({
patterns: [
"./index.html",
],
}),
// new CopyPlugin({
// patterns: [
// "./index.html",
// ],
// }),
isVisualizerEnabled && new BundleAnalyzerPlugin()
],
optimization: {
Expand Down
15 changes: 8 additions & 7 deletions client/packages/lowcoder/src/comps/comps/rootComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ function RootView(props: RootViewProps) {
};
}, [editorState, propertySectionState]);

if (!editorState) {
if (isModuleRoot) {
return <ModuleLoading />;
}
return <EditorSkeletonView />;
}
// if (!editorState) {
// if (isModuleRoot) {
// return <ModuleLoading />;
// }
// return <EditorSkeletonView />;
// }
if(!editorState) return <ModuleLoading />;

return (
<div {...divProps}>
Expand All @@ -125,7 +126,7 @@ function RootView(props: RootViewProps) {
{Object.keys(comp.children.queries.children).map((key) => (
<div key={key}>{comp.children.queries.children[key].getView()}</div>
))}
<Suspense fallback={<EditorSkeletonView />}>
<Suspense fallback={null}>
<EditorView uiComp={comp.children.ui} preloadComp={comp.children.preload} />
</Suspense>
</EditorContext.Provider>
Expand Down
4 changes: 2 additions & 2 deletions client/packages/lowcoder/src/pages/editor/AppEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default function AppEditor() {
return (
<ErrorBoundary>
{showAppSnapshot ? (
<Suspense fallback={<EditorSkeletonView />}>
<Suspense fallback={null}>
<AppSnapshot
currentAppInfo={{
...appInfo,
Expand All @@ -145,7 +145,7 @@ export default function AppEditor() {
/>
</Suspense>
) : (
<Suspense fallback={<EditorSkeletonView />}>
<Suspense fallback={null}>
<AppEditorInternalView
appInfo={appInfo}
readOnly={readOnly}
Expand Down