Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: optimize bundle (#6666)
Kilu.He74165ace0f61
diff --git a/frontend/appflowy_web_app/index.html b/frontend/appflowy_web_app/index.htmlindex 257f2a42c8..cbb2c55e60 100644--- a/frontend/appflowy_web_app/index.html+++ b/frontend/appflowy_web_app/index.html@@ -68,6 +68,8 @@href="https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap"rel="stylesheet">+ <%- cdnLinks %>+</head><body id="body"><div id="root"></div>diff --git a/frontend/appflowy_web_app/package.json b/frontend/appflowy_web_app/package.jsonindex d9cbcabf93..e2a7ad574a 100644--- a/frontend/appflowy_web_app/package.json+++ b/frontend/appflowy_web_app/package.json@@ -181,6 +181,8 @@"uuid": "^9.0.0","vite": "^5.2.0","vite-plugin-compression2": "^1.0.0",+ "vite-plugin-externals": "^0.6.2",+ "vite-plugin-html": "^3.2.2","vite-plugin-importer": "^0.2.5","vite-plugin-istanbul": "^6.0.2","vite-plugin-svgr": "^3.2.0",diff --git a/frontend/appflowy_web_app/pnpm-lock.yaml b/frontend/appflowy_web_app/pnpm-lock.yamlindex a43e88f3bf..768b5b6d26 100644--- a/frontend/appflowy_web_app/pnpm-lock.yaml+++ b/frontend/appflowy_web_app/pnpm-lock.yaml@@ -472,6 +472,12 @@ devDependencies:vite-plugin-compression2:specifier: ^1.0.0version: 1.0.0+ vite-plugin-externals:+ specifier: ^0.6.2+ version: 0.6.2([email protected])+ vite-plugin-html:+ specifier: ^3.2.2+ version: 3.2.2([email protected])vite-plugin-importer:specifier: ^0.2.5version: 0.2.5@@ -3508,6 +3514,14 @@ packages:magic-string: 0.30.8dev: true+ /@rollup/[email protected]:+ resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==}+ engines: {node: '>= 8.0.0'}+ dependencies:+ estree-walker: 2.0.2+ picomatch: 2.3.1+ dev: true+/@rollup/[email protected]:resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==}engines: {node: '>=14.0.0'}@@ -5514,6 +5528,13 @@ packages:resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==}dev: false+ resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==}+ engines: {node: '>= 10.0'}+ dependencies:+ source-map: 0.6.1+ dev: true+resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}engines: {node: '>=6'}@@ -5666,6 +5687,15 @@ packages:resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}+ resolution: {integrity: sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==}+ engines: {node: '>=0.8'}+ dev: true++ resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==}+ dev: true+resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==}dependencies:@@ -5775,6 +5805,16 @@ packages:tiny-invariant: 1.3.3dev: false+ resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==}+ dependencies:+ boolbase: 1.0.0+ css-what: 6.1.0+ domhandler: 4.3.1+ domutils: 2.8.0+ nth-check: 2.1.1+ dev: true+resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==}dependencies:@@ -6183,6 +6223,14 @@ packages:csstype: 3.1.3dev: false+ resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==}+ dependencies:+ domelementtype: 2.3.0+ domhandler: 4.3.1+ entities: 2.2.0+ dev: true+resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}dependencies:@@ -6203,6 +6251,13 @@ packages:webidl-conversions: 7.0.0dev: true+ resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==}+ engines: {node: '>= 4'}+ dependencies:+ domelementtype: 2.3.0+ dev: true+resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==}engines: {node: '>= 4'}@@ -6210,6 +6265,14 @@ packages:domelementtype: 2.3.0dev: true+ resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==}+ dependencies:+ dom-serializer: 1.4.1+ domelementtype: 2.3.0+ domhandler: 4.3.1+ dev: true+resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==}dependencies:@@ -6225,6 +6288,16 @@ packages:tslib: 2.6.2dev: true+ resolution: {integrity: sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==}+ engines: {node: '>=12'}+ dev: true++ resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==}+ engines: {node: '>=12'}+ dev: true+resolution: {integrity: sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==}dependencies:@@ -6250,6 +6323,14 @@ packages:jsbn: 0.1.1safer-buffer: 2.1.2+ resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==}+ engines: {node: '>=0.10.0'}+ hasBin: true+ dependencies:+ jake: 10.9.2+ dev: true+resolution: {integrity: sha512-5nLE0TWFFpZ80Crhtp4pIp8LXCztjYX41yUcV6b+bKR2PqzjskTMOOlBi1VjBHlvHwS+4gar7kNKOrsbsewEZQ==}@@ -6294,6 +6375,10 @@ packages:strip-ansi: 6.0.1dev: true+ resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==}+ dev: true+resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}engines: {node: '>=0.12'}@@ -6365,6 +6450,10 @@ packages:resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-ooYciCUtfw6/d2w56UVeqHPcoCFAiJdz5XOkYpv/Txl1HMUozpXjz/2RIQgqwKdXNDPSF1W7mJCFse3G+HDyAA==}+ dev: true+resolution: {integrity: sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==}dev: true@@ -6819,6 +6908,12 @@ packages:flat-cache: 3.2.0dev: true+ resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==}+ dependencies:+ minimatch: 5.1.6+ dev: true+resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}engines: {node: '>=8'}@@ -7416,6 +7511,11 @@ packages:space-separated-tokens: 2.0.2dev: false+ resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==}+ hasBin: true+ dev: true+resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==}dependencies:@@ -7448,6 +7548,20 @@ packages:resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}+ resolution: {integrity: sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==}+ engines: {node: '>=12'}+ hasBin: true+ dependencies:+ camel-case: 4.1.2+ clean-css: 5.3.3+ commander: 8.3.0+ he: 1.2.0+ param-case: 3.0.4+ relateurl: 0.2.7+ terser: 5.31.0+ dev: true+resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==}dependencies:@@ -7972,6 +8086,17 @@ packages:'@pkgjs/parseargs': 0.11.0dev: true+ resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==}+ engines: {node: '>=10'}+ hasBin: true+ dependencies:+ async: 3.2.5+ chalk: 4.1.2+ filelist: 1.0.4+ minimatch: 3.1.2+ dev: true+resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==}engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}@@ -8785,6 +8910,12 @@ packages:hasBin: truedev: true+ resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==}+ dependencies:+ sourcemap-codec: 1.4.8+ dev: true+resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==}engines: {node: '>=12'}@@ -8930,6 +9061,13 @@ packages:dependencies:brace-expansion: 1.1.11+ resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}+ engines: {node: '>=10'}+ dependencies:+ brace-expansion: 2.0.1+ dev: true+resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}engines: {node: '>=16 || 14 >=14.17'}@@ -9032,6 +9170,13 @@ packages:engines: {node: '>=v0.6.5'}dev: false+ resolution: {integrity: sha512-RaBPP3+51hPne/OolXxcz89iYvQvKOydaqoePpOgXcrOKZhjVIzmpKZz+Hd/RBO2/zN2q6CNJhQzucVz+u3Jyw==}+ dependencies:+ css-select: 4.3.0+ he: 1.2.0+ dev: true+resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}@@ -9435,6 +9580,10 @@ packages:resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}engines: {node: '>=8'}+ resolution: {integrity: sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==}+ dev: true+resolution: {integrity: sha512-FhJ+YbOSBb9/rIl2ZeE/QHEsWn7PqNYt8ARAY3kIgNGOk13g9FGyIY6JIl/xB/3TFRVoTv5as0l11weORrTekA==}dependencies:@@ -10518,6 +10667,11 @@ packages:unified: 11.0.5dev: false+ resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==}+ engines: {node: '>= 0.10'}+ dev: true+resolution: {integrity: sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==}engines: {node: '>=4'}@@ -11016,6 +11170,11 @@ packages:engines: {node: '>= 8'}dev: true+ resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==}+ deprecated: Please use @jridgewell/sourcemap-codec instead+ dev: true+resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==}dev: false@@ -11979,6 +12138,39 @@ packages:- rollupdev: true+ resolution: {integrity: sha512-R5oVY8xDJjLXLTs2XDYzvYbc/RTZuIwOx2xcFbYf+/VXB6eJuatDgt8jzQ7kZ+IrgwQhe6tU8U2fTyy72C25CQ==}+ engines: {node: ^14.18.0 || >=16.0.0}+ peerDependencies:+ vite: '>=2.0.0'+ dependencies:+ acorn: 8.11.3+ es-module-lexer: 0.4.1+ fs-extra: 10.1.0+ magic-string: 0.25.9+ vite: 5.2.0(@types/[email protected])([email protected])+ dev: true++ resolution: {integrity: sha512-vb9C9kcdzcIo/Oc3CLZVS03dL5pDlOFuhGlZYDCJ840BhWl/0nGeZWf3Qy7NlOayscY4Cm/QRgULCQkEZige5Q==}+ peerDependencies:+ vite: '>=2.0.0'+ dependencies:+ '@rollup/pluginutils': 4.2.1+ colorette: 2.0.20+ connect-history-api-fallback: 1.6.0+ consola: 2.15.3+ dotenv: 16.4.5+ dotenv-expand: 8.0.3+ ejs: 3.1.10+ fast-glob: 3.3.2+ fs-extra: 10.1.0+ html-minifier-terser: 6.1.0+ node-html-parser: 5.4.2+ pathe: 0.2.0+ vite: 5.2.0(@types/[email protected])([email protected])+ dev: true+resolution: {integrity: sha512-6OtqJmVwnfw8+B4OIh7pIdXs+jLkN7g5PIqmZdpgrMYjIFMiZrcMB1zlyUQSTokKGC90KwXviO/lq1hcUBUG3Q==}dependencies:diff --git a/frontend/appflowy_web_app/src/application/services/js-services/http/http_api.ts b/frontend/appflowy_web_app/src/application/services/js-services/http/http_api.tsindex 9cdc21507f..f1e8799d19 100644--- a/frontend/appflowy_web_app/src/application/services/js-services/http/http_api.ts+++ b/frontend/appflowy_web_app/src/application/services/js-services/http/http_api.ts@@ -28,7 +28,6 @@ import {TemplateCreator, TemplateCreatorFormValues, TemplateSummary,UploadTemplatePayload,} from '@/application/template.type';-import { calculateMd5 } from '@/utils/md5';import axios, { AxiosInstance } from 'axios';import dayjs from 'dayjs';@@ -1237,49 +1236,3 @@ export async function uploadImportFile (presignedUrl: string, file: File, onProg});}-export async function uploadFile (file: File, onProgress: (progress: number) => void) {- const url = `/api/import`;-- const fileName = file.name.split('.').slice(0, -1).join('.') || crypto.randomUUID();-- const fileSize = file.size;-- const mimeType = file.type || 'application/octet-stream';- const md5Base64 = await calculateMd5(file);-- const validZipTypes = [- 'application/zip',- 'application/x-zip',- 'application/x-zip-compressed',- 'application/octet-stream',- ];-- if (!validZipTypes.includes(mimeType) && !file.name.toLowerCase().endsWith('.zip')) {- throw new Error('Please select a valid ZIP file.');- }-- const formData = new FormData();-- formData.append(fileName, file, file.name);-- const response = await axiosInstance?.post(url, formData, {- headers: {- 'Content-Type': 'multipart/form-data',- 'X-Content-Length': fileSize.toString(),- 'X-Content-MD5': md5Base64,- },- onUploadProgress: (progressEvent) => {- const { progress = 0 } = progressEvent;-- console.log(`Upload progress: ${progress * 100}%`);- onProgress(progress);- },- });-- if (response?.data.code === 0) {- return;- }-- return Promise.reject(response?.data);-}-diff --git a/frontend/appflowy_web_app/src/application/services/js-services/index.ts b/frontend/appflowy_web_app/src/application/services/js-services/index.tsindex 3d612f7574..7f2a91aa14 100644--- a/frontend/appflowy_web_app/src/application/services/js-services/index.ts+++ b/frontend/appflowy_web_app/src/application/services/js-services/index.ts@@ -474,10 +474,6 @@ export class AFClientService implements AFService {sync.initialize();}- uploadFile (file: File, onProgress: (progress: number) => void) {- return APIService.uploadFile(file, onProgress);- }-async importFile (file: File, onProgress: (progress: number) => void) {const task = await APIService.createImportTask(file);diff --git a/frontend/appflowy_web_app/src/application/services/services.type.ts b/frontend/appflowy_web_app/src/application/services/services.type.tsindex 7a1e7b567f..b4933bd87e 100644--- a/frontend/appflowy_web_app/src/application/services/services.type.ts+++ b/frontend/appflowy_web_app/src/application/services/services.type.ts@@ -67,7 +67,6 @@ export interface AppService {registerDocUpdate: (doc: YDoc, context: {workspaceId: string, objectId: string, collabType: Types}) => void;- uploadFile: (file: File, onProgress: (progress: number) => void) => Promise<void>;importFile: (file: File, onProgress: (progress: number) => void) => Promise<void>;}diff --git a/frontend/appflowy_web_app/src/application/services/tauri-services/index.ts b/frontend/appflowy_web_app/src/application/services/tauri-services/index.tsindex 8787987dbc..740a25eef7 100644--- a/frontend/appflowy_web_app/src/application/services/tauri-services/index.ts+++ b/frontend/appflowy_web_app/src/application/services/tauri-services/index.ts@@ -262,10 +262,6 @@ export class AFClientService implements AFService {throw new Error('Method not implemented.');}- uploadFile (_file: File, _onProgress: (progress: number) => void) {- return Promise.reject('Method not implemented');- }-importFile (_file: File, _onProgress: (progress: number) => void) {return Promise.reject('Method not implemented');}diff --git a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_1.png b/frontend/appflowy_web_app/src/assets/cover/m_cover_image_1.pngdeleted file mode 100644index fb72022287..0000000000Binary files a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_1.png and /dev/null differdiff --git a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_2.png b/frontend/appflowy_web_app/src/assets/cover/m_cover_image_2.pngdeleted file mode 100644index 9ecf02d253..0000000000Binary files a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_2.png and /dev/null differdiff --git a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_3.png b/frontend/appflowy_web_app/src/assets/cover/m_cover_image_3.pngdeleted file mode 100644index 97072b04f4..0000000000Binary files a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_3.png and /dev/null differdiff --git a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_4.png b/frontend/appflowy_web_app/src/assets/cover/m_cover_image_4.pngdeleted file mode 100644index 00d26a0500..0000000000Binary files a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_4.png and /dev/null differdiff --git a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_5.png b/frontend/appflowy_web_app/src/assets/cover/m_cover_image_5.pngdeleted file mode 100644index 3ecc9546c1..0000000000Binary files a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_5.png and /dev/null differdiff --git a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_6.png b/frontend/appflowy_web_app/src/assets/cover/m_cover_image_6.pngdeleted file mode 100644index 0abd2700e8..0000000000Binary files a/frontend/appflowy_web_app/src/assets/cover/m_cover_image_6.png and /dev/null differdiff --git a/frontend/appflowy_web_app/src/assets/north_east.svg b/frontend/appflowy_web_app/src/assets/north_east.svgindex c41ad93878..ecdff0f12d 100644--- a/frontend/appflowy_web_app/src/assets/north_east.svg+++ b/frontend/appflowy_web_app/src/assets/north_east.svg@@ -1,6 +1,8 @@-<svg role="graphics-symbol" viewBox="0 0 13 13"- style="width:0.7em;height:0.7em;display:block;fill:rgba(55, 53, 47, 1);flex-shrink:0;position:absolute;right:-0.2em;bottom:0;stroke:white;stroke-width:1.5"- class="pageLinkIndicator">- <path d="M6.30826 4.43292L1.76184 8.98454C1.76176 8.98462 1.76169 8.9847 1.76161 8.98477C1.76158 8.9848 1.76156 8.98482 1.76154 8.98484C1.46068 9.28584 1.25 9.6914 1.25 10.1565C1.25 10.6117 1.45865 11.0119 1.73417 11.2886C2.01014 11.5658 2.41107 11.7773 2.87078 11.7773C3.34169 11.7773 3.73758 11.5617 4.03477 11.2733L4.03482 11.2734L4.04244 11.2657L8.58864 6.72474V8.667C8.58864 9.51956 9.22729 10.2935 10.1521 10.2935C11.0528 10.2935 11.75 9.54534 11.75 8.66127V2.92671C11.75 2.48722 11.5981 2.06381 11.2838 1.74808C10.9689 1.43182 10.5446 1.27728 10.1006 1.27728H4.36028C3.46161 1.27728 2.72804 1.97749 2.72804 2.86942C2.72804 3.79734 3.51104 4.43292 4.35455 4.43292H6.30826Z"- fill="currentColor" stroke="white" stroke-width="1.5"></path>-</svg>\ No newline at end of file+<svg width="9" height="7" viewBox="0 0 9 7" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd"+ d="M5.14645 1.14645C5.34171 0.951184 5.65829 0.951184 5.85355 1.14645L7.85355 3.14645C8.04882 3.34171 8.04882 3.65829 7.85355 3.85355L5.85355 5.85355C5.65829 6.04882 5.34171 6.04882 5.14645 5.85355C4.95118 5.65829 4.95118 5.34171 5.14645 5.14645L6.29289 4H3.5C3.24668 4 2.85557 4.08011 2.54215 4.30577C2.25423 4.51307 2 4.86296 2 5.5C2 5.77614 1.77614 6 1.5 6C1.22386 6 1 5.77614 1 5.5C1 4.53704 1.41243 3.88693 1.95785 3.49423C2.47777 3.11989 3.08665 3 3.5 3H6.29289L5.14645 1.85355C4.95118 1.65829 4.95118 1.34171 5.14645 1.14645Z"+ fill="currentColor"/>+ <path fill-rule="evenodd" clip-rule="evenodd"+ d="M5.14664 1.85375C4.95138 1.65849 4.95138 1.3419 5.14664 1.14664C5.3419 0.95138 5.65849 0.95138 5.85375 1.14664L7.85375 3.14664C8.04901 3.3419 8.04901 3.65849 7.85375 3.85375L5.85375 5.85375C5.65849 6.04901 5.3419 6.04901 5.14664 5.85375C4.95138 5.65849 4.95138 5.3419 5.14664 5.14664L6.29309 4.0002H3.5002C3.24687 4.0002 2.85576 4.08031 2.54235 4.30596C2.25443 4.51326 2.0002 4.86316 2.0002 5.5002C2.0002 5.77634 1.77634 6.0002 1.5002 6.0002C1.22405 6.0002 1.0002 5.77634 1.0002 5.5002C1.0002 4.53724 1.41263 3.88713 1.95804 3.49443C2.47796 3.12009 3.08685 3.0002 3.5002 3.0002H6.29309L5.14664 1.85375ZM4.40442 2.2002H3.5002C2.95908 2.2002 2.17588 2.35179 1.4906 2.8452C0.739241 3.38618 0.200195 4.27643 0.200195 5.5002C0.200195 6.21816 0.782225 6.8002 1.5002 6.8002C2.21817 6.8002 2.8002 6.21816 2.8002 5.5002C2.8002 5.29081 2.84115 5.17293 2.87431 5.10863C2.90721 5.04483 2.95123 4.99735 3.00979 4.95519C3.07701 4.90679 3.16492 4.8659 3.26382 4.83761C3.36373 4.80903 3.45084 4.8002 3.5002 4.8002H4.40442C4.08237 5.30328 4.14121 5.97969 4.58096 6.41943C5.08864 6.92712 5.91175 6.92712 6.41943 6.41943L8.41943 4.41943C8.92711 3.91175 8.92712 3.08864 8.41943 2.58096L6.41943 0.580957C5.91175 0.0732746 5.08864 0.0732751 4.58096 0.580956C4.14121 1.0207 4.08237 1.69711 4.40442 2.2002Z"+ fill="white"/>+</svg>diff --git a/frontend/appflowy_web_app/src/components/_shared/mobile-topbar/MobileFolder.tsx b/frontend/appflowy_web_app/src/components/_shared/mobile-topbar/MobileFolder.tsxindex 489012a2d9..0d7f4193e1 100644--- a/frontend/appflowy_web_app/src/components/_shared/mobile-topbar/MobileFolder.tsx+++ b/frontend/appflowy_web_app/src/components/_shared/mobile-topbar/MobileFolder.tsx@@ -27,7 +27,6 @@ function MobileFolder ({const [selectedTab, setSelectedTab] = React.useState<ViewTabsKey>(ViewTabsKey.Space);const { t } = useTranslation();- console.log('MobileFolder', selectedTab);return (<AFScrolleroverflowXHiddendiff --git a/frontend/appflowy_web_app/src/components/app/AuthLayout.tsx b/frontend/appflowy_web_app/src/components/app/AuthLayout.tsxindex 4668c821fc..b492fc0e3e 100644--- a/frontend/appflowy_web_app/src/components/app/AuthLayout.tsx+++ b/frontend/appflowy_web_app/src/components/app/AuthLayout.tsx@@ -1,16 +1,15 @@import { AppProvider } from '@/components/app/app.hooks';import MainLayout from '@/components/app/MainLayout';import { getPlatform } from '@/utils/platform';-import React, { memo, Suspense } from 'react';--const MobileMainLayout = React.lazy(() => import('@/components/app/MobileMainLayout'));+import React, { memo } from 'react';+import MobileMainLayout from '@/components/app/MobileMainLayout';export function AuthLayout () {const isMobile = getPlatform().isMobile;return (<AppProvider>- {isMobile ? <Suspense><MobileMainLayout /></Suspense> : <MainLayout />}+ {isMobile ? <MobileMainLayout /> : <MainLayout />}</AppProvider>);}diff --git a/frontend/appflowy_web_app/src/components/app/MobileMainLayout.tsx b/frontend/appflowy_web_app/src/components/app/MobileMainLayout.tsxindex 16ca3ecc94..d49d3e45ba 100644--- a/frontend/appflowy_web_app/src/components/app/MobileMainLayout.tsx+++ b/frontend/appflowy_web_app/src/components/app/MobileMainLayout.tsx@@ -1,5 +1,4 @@import { UIVariant } from '@/application/types';-import MobileTopBar from '@/components/_shared/mobile-topbar/MobileTopBar';import { AFScroller } from '@/components/_shared/scroller';import { useViewErrorStatus } from '@/components/app/app.hooks';import Main from '@/components/app/Main';@@ -9,6 +8,8 @@ import SomethingError from '@/components/error/SomethingError';import React, { useMemo } from 'react';import { ErrorBoundary } from 'react-error-boundary';+const MobileTopBar = React.lazy(() => import('@/components/_shared/mobile-topbar/MobileTopBar'));+function MobileMainLayout () {const { notFound, deleted } = useViewErrorStatus();@@ -27,7 +28,12 @@ function MobileMainLayout () {overflowYHidden={false}className={'appflowy-layout appflowy-mobile-layout flex flex-col appflowy-scroll-container h-full'}>- <MobileTopBar variant={UIVariant.App} />+ <React.Suspense+ fallback={+ <div className={'flex items-center justify-between w-full h-[48px] min-h-[48px] px-4 gap-2'} />}+ >+ <MobileTopBar variant={UIVariant.App} />+ </React.Suspense><ErrorBoundary FallbackComponent={SomethingError}>{main}diff --git a/frontend/appflowy_web_app/src/components/app/favorite/MobileFavorite.tsx b/frontend/appflowy_web_app/src/components/app/favorite/MobileFavorite.tsxindex f7ecaf9819..4f9305972f 100644--- a/frontend/appflowy_web_app/src/components/app/favorite/MobileFavorite.tsx+++ b/frontend/appflowy_web_app/src/components/app/favorite/MobileFavorite.tsx@@ -1,6 +1,6 @@import MobileOutlineWithCover from '@/components/_shared/mobile-outline/MobileOutlineWithCover';import { useAppFavorites, useAppHandlers } from '@/components/app/app.hooks';-import { orderBy } from 'lodash-es';+import orderBy from 'lodash-es/orderBy';import React, { useEffect, useMemo } from 'react';import { useTranslation } from 'react-i18next';diff --git a/frontend/appflowy_web_app/src/components/app/recent/MobileRecent.tsx b/frontend/appflowy_web_app/src/components/app/recent/MobileRecent.tsxindex cc173a405f..bed8cb17a4 100644--- a/frontend/appflowy_web_app/src/components/app/recent/MobileRecent.tsx+++ b/frontend/appflowy_web_app/src/components/app/recent/MobileRecent.tsx@@ -1,7 +1,7 @@import MobileOutlineWithCover from '@/components/_shared/mobile-outline/MobileOutlineWithCover';import { useAppHandlers } from '@/components/app/app.hooks';import { useRecent } from '@/components/app/recent/useRecent';-import { orderBy } from 'lodash-es';+import orderBy from 'lodash-es/orderBy';import React, { useMemo } from 'react';import { useTranslation } from 'react-i18next';diff --git a/frontend/appflowy_web_app/src/components/app/recent/MobileRecentViewCover.tsx b/frontend/appflowy_web_app/src/components/app/recent/MobileRecentViewCover.tsxindex 6a69059a33..1915f25239 100644--- a/frontend/appflowy_web_app/src/components/app/recent/MobileRecentViewCover.tsx+++ b/frontend/appflowy_web_app/src/components/app/recent/MobileRecentViewCover.tsx@@ -1,10 +1,5 @@import { CoverType } from '@/application/types';-import BuiltInImage1 from '@/assets/cover/m_cover_image_1.png';-import BuiltInImage2 from '@/assets/cover/m_cover_image_2.png';-import BuiltInImage3 from '@/assets/cover/m_cover_image_3.png';-import BuiltInImage4 from '@/assets/cover/m_cover_image_4.png';-import BuiltInImage5 from '@/assets/cover/m_cover_image_5.png';-import BuiltInImage6 from '@/assets/cover/m_cover_image_6.png';+import ImageRender from '@/components/_shared/image-render/ImageRender';import { renderColor } from '@/utils/color';import React, { useCallback, useMemo } from 'react';@@ -51,12 +46,12 @@ function MobileRecentViewCover ({ cover }: { cover: { type: string; value: strinconst coverValue = useMemo(() => {if (coverType === 'built_in') {return {- 1: BuiltInImage1,- 2: BuiltInImage2,- 3: BuiltInImage3,- 4: BuiltInImage4,- 5: BuiltInImage5,- 6: BuiltInImage6,+ 1: '/covers/m_cover_image_1.png',+ 2: '/covers/m_cover_image_2.png',+ 3: '/covers/m_cover_image_3.png',+ 4: '/covers/m_cover_image_4.png',+ 5: '/covers/m_cover_image_5.png',+ 6: '/covers/m_cover_image_6.png',}[cover.value];}diff --git a/frontend/appflowy_web_app/src/components/editor/components/leaf/mention/MentionPage.tsx b/frontend/appflowy_web_app/src/components/editor/components/leaf/mention/MentionPage.tsxindex e13ab5a4f1..085ecaf52a 100644--- a/frontend/appflowy_web_app/src/components/editor/components/leaf/mention/MentionPage.tsx+++ b/frontend/appflowy_web_app/src/components/editor/components/leaf/mention/MentionPage.tsx@@ -91,7 +91,7 @@ function MentionPage ({ pageId, blockId, type }: { pageId: string; blockId?: strconst mentionIcon = useMemo(() => {if (pageId === currentViewId && blockId) {- return <MarkIcon className={'text-icon-secondary ml-0.5'} />;+ return <MarkIcon className={'text-icon-primary ml-0.5 opacity-70'} />;}return <>@@ -101,8 +101,8 @@ function MentionPage ({ pageId, blockId, type }: { pageId: string; blockId?: strclassName={'text-text-title ml-0.5'}/>}{type === MentionType.PageRef &&- <span className={`absolute ${icon?.value ? 'right-1 bottom-1' : 'right-0 bottom-0'}`}>- <NorthEast className={'w-3 h-3 text-content-blue-700'} />+ <span className={`absolute -right-0.5 bottom-0`}>+ <NorthEast className={'w-3 h-3 text-content-blue-900'} /></span>}</>;diff --git a/frontend/appflowy_web_app/src/components/view-meta/ViewMetaPreview.tsx b/frontend/appflowy_web_app/src/components/view-meta/ViewMetaPreview.tsxindex 3db0fc218e..aedee548af 100644--- a/frontend/appflowy_web_app/src/components/view-meta/ViewMetaPreview.tsx+++ b/frontend/appflowy_web_app/src/components/view-meta/ViewMetaPreview.tsx@@ -1,9 +1,3 @@-import BuiltInImage1 from '@/assets/cover/m_cover_image_1.png';-import BuiltInImage2 from '@/assets/cover/m_cover_image_2.png';-import BuiltInImage3 from '@/assets/cover/m_cover_image_3.png';-import BuiltInImage4 from '@/assets/cover/m_cover_image_4.png';-import BuiltInImage5 from '@/assets/cover/m_cover_image_5.png';-import BuiltInImage6 from '@/assets/cover/m_cover_image_6.png';import ViewCover from '@/components/view-meta/ViewCover';import { isFlagEmoji } from '@/utils/emoji';import React, { useMemo } from 'react';@@ -42,12 +36,12 @@ export function ViewMetaPreview ({ icon, cover, name }: ViewMetaProps) {const coverValue = useMemo(() => {if (coverType === 'built_in') {return {- 1: BuiltInImage1,- 2: BuiltInImage2,- 3: BuiltInImage3,- 4: BuiltInImage4,- 5: BuiltInImage5,- 6: BuiltInImage6,+ 1: '/covers/m_cover_image_1.png',+ 2: '/covers/m_cover_image_2.png',+ 3: '/covers/m_cover_image_3.png',+ 4: '/covers/m_cover_image_4.png',+ 5: '/covers/m_cover_image_5.png',+ 6: '/covers/m_cover_image_6.png',}[cover?.value as string];}@@ -61,7 +55,10 @@ export function ViewMetaPreview ({ icon, cover, name }: ViewMetaProps) {return (<div className={'flex w-full flex-col items-center'}>- {cover && <ViewCover coverType={coverType} coverValue={coverValue} />}+ {cover && <ViewCover+ coverType={coverType}+ coverValue={coverValue}+ />}<divclassName={`relative mb-6 mt-[52px] max-md:mt-[38px] px-6 w-[964px] min-w-0 max-w-full overflow-visible`}>diff --git a/frontend/appflowy_web_app/vite.config.ts b/frontend/appflowy_web_app/vite.config.tsindex 1ee7367920..22c7170bc3 100644--- a/frontend/appflowy_web_app/vite.config.ts+++ b/frontend/appflowy_web_app/vite.config.ts@@ -6,13 +6,36 @@ import usePluginImport from 'vite-plugin-importer';import { totalBundleSize } from 'vite-plugin-total-bundle-size';import path from 'path';import istanbul from 'vite-plugin-istanbul';+import { createHtmlPlugin } from 'vite-plugin-html';+import { viteExternalsPlugin } from 'vite-plugin-externals';const resourcesPath = path.resolve(__dirname, '../resources');const isDev = process.env.NODE_ENV === 'development';+const isProd = process.env.NODE_ENV === 'production';+// https://vitejs.dev/config/export default defineConfig({plugins: [react(),+ createHtmlPlugin({+ inject: {+ data: {+ injectCdn: isProd,+ cdnLinks: isProd ? `+ <link rel="dns-prefetch" href="//cdn.jsdelivr.net">+ <link rel="preconnect" href="//cdn.jsdelivr.net">++ <script crossorigin src="https://cdn.jsdelivr.net/npm/[email protected]/umd/react.production.min.js"></script>+ <script crossorigin src="https://cdn.jsdelivr.net/npm/[email protected]/umd/react-dom.production.min.js"></script>+ ` : '',+ },+ },+ }),+ isProd ? viteExternalsPlugin({+ react: 'React',+ 'react-dom': 'ReactDOM',++ }) : undefined,svgr({svgrOptions: {prettier: false,@@ -107,7 +130,7 @@ export default defineConfig({target: `esnext`,reportCompressedSize: true,sourcemap: isDev,- rollupOptions: !isDev+ rollupOptions: isProd? {output: {chunkFileNames: 'static/js/[name]-[hash].js',@@ -115,8 +138,8 @@ export default defineConfig({assetFileNames: 'static/[ext]/[name]-[hash].[ext]',manualChunks (id) {if (- id.includes('/react@') ||- id.includes('/react-dom@') ||+ // id.includes('/react@') ||+ // id.includes('/react-dom@') ||id.includes('/react-is@') ||id.includes('/yjs@') ||id.includes('/y-indexeddb@') ||@@ -127,6 +150,8 @@ export default defineConfig({id.includes('/smooth-scroll-into-view-if-needed') ||id.includes('/react-virtualized-auto-sizer') ||id.includes('/react-window')+ || id.includes('/@popperjs')+ || id.includes('/@mui/material/Dialog')) {return 'common';}