From 31897581d3b11cbe59d100c2d334574ec03d0fd5 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Wed, 26 Apr 2023 21:43:56 +0100 Subject: [PATCH] Desktop: Resolves #8028: Remove custom PDF viewer to reduce application size --- .../app-desktop/gui/NoteEditor/NoteEditor.tsx | 2 +- packages/app-desktop/package.json | 1 - .../app-desktop/tools/copyApplicationAssets.js | 16 ++++++++-------- packages/lib/models/Setting.ts | 2 +- packages/pdf-viewer/package.json | 12 ++++++------ yarn.lock | 3 +-- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/packages/app-desktop/gui/NoteEditor/NoteEditor.tsx b/packages/app-desktop/gui/NoteEditor/NoteEditor.tsx index 123f735a8..1b38b21a0 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteEditor.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteEditor.tsx @@ -631,7 +631,7 @@ const mapStateToProps = (state: AppState) => { ], whenClauseContext)[0], contentMaxWidth: state.settings['style.editor.contentMaxWidth'], isSafeMode: state.settings.isSafeMode, - useCustomPdfViewer: state.settings.useCustomPdfViewer, + useCustomPdfViewer: false, // state.settings.useCustomPdfViewer, }; }; diff --git a/packages/app-desktop/package.json b/packages/app-desktop/package.json index 369f7c269..fdc88f668 100644 --- a/packages/app-desktop/package.json +++ b/packages/app-desktop/package.json @@ -138,7 +138,6 @@ "@fortawesome/fontawesome-free": "5.15.4", "@joeattardi/emoji-button": "4.6.4", "@joplin/lib": "~2.11", - "@joplin/pdf-viewer": "~2.11", "@joplin/renderer": "~2.11", "async-mutex": "0.4.0", "codemirror": "5.65.9", diff --git a/packages/app-desktop/tools/copyApplicationAssets.js b/packages/app-desktop/tools/copyApplicationAssets.js index 47dc2b86a..0336282fd 100644 --- a/packages/app-desktop/tools/copyApplicationAssets.js +++ b/packages/app-desktop/tools/copyApplicationAssets.js @@ -72,10 +72,10 @@ async function main() { src: langSourceDir, dest: `${buildLibDir}/tinymce/langs`, }, - { - src: resolve(__dirname, '../../pdf-viewer/dist'), - dest: `${buildLibDir}/@joplin/pdf-viewer`, - }, + // { + // src: resolve(__dirname, '../../pdf-viewer/dist'), + // dest: `${buildLibDir}/@joplin/pdf-viewer`, + // }, ]; const files = [ @@ -93,10 +93,10 @@ async function main() { src: resolve(__dirname, '../../lib/services/plugins/sandboxProxy.js'), dest: `${buildLibDir}/@joplin/lib/services/plugins/sandboxProxy.js`, }, - { - src: resolve(__dirname, '../../pdf-viewer/index.html'), - dest: `${buildLibDir}/@joplin/pdf-viewer/index.html`, - }, + // { + // src: resolve(__dirname, '../../pdf-viewer/index.html'), + // dest: `${buildLibDir}/@joplin/pdf-viewer/index.html`, + // }, ]; // First we delete all the destination directories, then we copy the files. diff --git a/packages/lib/models/Setting.ts b/packages/lib/models/Setting.ts index 8e9037b0f..173f3d0d6 100644 --- a/packages/lib/models/Setting.ts +++ b/packages/lib/models/Setting.ts @@ -1395,7 +1395,7 @@ class Setting extends BaseModel { useCustomPdfViewer: { value: false, type: SettingItemType.Bool, - public: true, + public: false, advanced: true, appTypes: [AppType.Desktop], label: () => 'Use custom PDF viewer (Beta)', diff --git a/packages/pdf-viewer/package.json b/packages/pdf-viewer/package.json index 412be6d28..794e01798 100644 --- a/packages/pdf-viewer/package.json +++ b/packages/pdf-viewer/package.json @@ -9,12 +9,12 @@ "access": "restricted" }, "scripts": { - "tsc": "tsc --project tsconfig.json", - "watch": "webpack --watch --config webpack.config.js --mode=development", - "build": "webpack --config webpack.config.js --mode=production", - "test": "jest", - "test-ci": "yarn test", - "postinstall": "yarn build" + "tsc_DISABLED": "tsc --project tsconfig.json", + "watch_DISABLED": "webpack --watch --config webpack.config.js --mode=development", + "build_DISABLED": "webpack --config webpack.config.js --mode=production", + "test_DISABLED": "jest", + "test-ci_DISABLED": "yarn test", + "postinstall_DISABLED": "yarn build" }, "author": "Joplin", "license": "AGPL-3.0-or-later", diff --git a/yarn.lock b/yarn.lock index e9eb898f4..3a31c6c14 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4839,7 +4839,6 @@ __metadata: "@fortawesome/fontawesome-free": 5.15.4 "@joeattardi/emoji-button": 4.6.4 "@joplin/lib": ~2.11 - "@joplin/pdf-viewer": ~2.11 "@joplin/renderer": ~2.11 "@joplin/tools": ~2.11 "@testing-library/react-hooks": 8.0.1 @@ -5144,7 +5143,7 @@ __metadata: languageName: unknown linkType: soft -"@joplin/pdf-viewer@workspace:packages/pdf-viewer, @joplin/pdf-viewer@~2.11": +"@joplin/pdf-viewer@workspace:packages/pdf-viewer": version: 0.0.0-use.local resolution: "@joplin/pdf-viewer@workspace:packages/pdf-viewer" dependencies: