From 6e7f83218149e0fc45089b5f118976771baafc99 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 16 Apr 2026 11:10:35 +0530 Subject: [PATCH] chore: remove react-pdf dependency and add pdfjs-dist for PDF handling --- surfsense_web/.npmrc | 1 - surfsense_web/package.json | 2 +- surfsense_web/pnpm-lock.yaml | 75 +++++++----------------------------- 3 files changed, 15 insertions(+), 63 deletions(-) delete mode 100644 surfsense_web/.npmrc diff --git a/surfsense_web/.npmrc b/surfsense_web/.npmrc deleted file mode 100644 index 150cdf725..000000000 --- a/surfsense_web/.npmrc +++ /dev/null @@ -1 +0,0 @@ -public-hoist-pattern[]=pdfjs-dist diff --git a/surfsense_web/package.json b/surfsense_web/package.json index 96ef62445..1b0b65a88 100644 --- a/surfsense_web/package.json +++ b/surfsense_web/package.json @@ -109,6 +109,7 @@ "next": "^16.1.0", "next-intl": "^4.6.1", "next-themes": "^0.4.6", + "pdfjs-dist": "^5.6.205", "pg": "^8.16.3", "platejs": "^52.0.17", "postgres": "^3.4.7", @@ -123,7 +124,6 @@ "react-dropzone": "^14.3.8", "react-hook-form": "^7.61.1", "react-json-view-lite": "^2.4.1", - "react-pdf": "^10.4.1", "react-syntax-highlighter": "^15.6.1", "react-wrap-balancer": "^1.1.1", "rehype-katex": "^7.0.1", diff --git a/surfsense_web/pnpm-lock.yaml b/surfsense_web/pnpm-lock.yaml index dff59c29d..b43a4903d 100644 --- a/surfsense_web/pnpm-lock.yaml +++ b/surfsense_web/pnpm-lock.yaml @@ -272,6 +272,9 @@ importers: next-themes: specifier: ^0.4.6 version: 0.4.6(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + pdfjs-dist: + specifier: ^5.6.205 + version: 5.6.205 pg: specifier: ^8.16.3 version: 8.18.0 @@ -314,9 +317,6 @@ importers: react-json-view-lite: specifier: ^2.4.1 version: 2.5.0(react@19.2.4) - react-pdf: - specifier: ^10.4.1 - version: 10.4.1(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) react-syntax-highlighter: specifier: ^15.6.1 version: 15.6.6(react@19.2.4) @@ -6744,12 +6744,6 @@ packages: magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} - make-cancellable-promise@2.0.0: - resolution: {integrity: sha512-3SEQqTpV9oqVsIWqAcmDuaNeo7yBO3tqPtqGRcKkEo0lrzD3wqbKG9mkxO65KoOgXqj+zH2phJ2LiAsdzlogSw==} - - make-event-props@2.0.0: - resolution: {integrity: sha512-G/hncXrl4Qt7mauJEXSg3AcdYzmpkIITTNl5I+rH9sog5Yw0kK6vseJjCaPfOXqOqQuPUP89Rkhfz5kPS8ijtw==} - markdown-extensions@2.0.0: resolution: {integrity: sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==} engines: {node: '>=16'} @@ -6831,14 +6825,6 @@ packages: mediabunny@1.39.2: resolution: {integrity: sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg==} - merge-refs@2.0.0: - resolution: {integrity: sha512-3+B21mYK2IqUWnd2EivABLT7ueDhb0b8/dGK8LoFQPrU61YITeCMn14F7y7qZafWNZhUEKb24cJdiT5Wxs3prg==} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -7105,6 +7091,9 @@ packages: encoding: optional: true + node-readable-to-web-readable-stream@0.4.2: + resolution: {integrity: sha512-/cMZNI34v//jUTrI+UIo4ieHAB5EZRY/+7OmXZgBxaWBMcW2tGdceIw06RFxWxrKZ5Jp3sI2i5TsRo+CBhtVLQ==} + node-releases@2.0.27: resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} @@ -7246,9 +7235,9 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - pdfjs-dist@5.4.296: - resolution: {integrity: sha512-DlOzet0HO7OEnmUmB6wWGJrrdvbyJKftI1bhMitK7O2N8W2gc757yyYBbINy9IDafXAV9wmKr9t7xsTaNKRG5Q==} - engines: {node: '>=20.16.0 || >=22.3.0'} + pdfjs-dist@5.6.205: + resolution: {integrity: sha512-tlUj+2IDa7G1SbvBNN74UHRLJybZDWYom+k6p5KIZl7huBvsA4APi6mKL+zCxd3tLjN5hOOEE9Tv7VdzO88pfg==} + engines: {node: '>=20.19.0 || >=22.13.0 || >=24'} performance-now@2.1.0: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} @@ -7543,16 +7532,6 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - react-pdf@10.4.1: - resolution: {integrity: sha512-kS/35staVCBqS29verTQJQZXw7RfsRCPO3fdJoW1KXylcv7A9dw6DZ3vJXC2w+bIBgLw5FN4pOFvKSQtkQhPfA==} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - react-remove-scroll-bar@2.3.8: resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==} engines: {node: '>=10'} @@ -8455,9 +8434,6 @@ packages: yaml: optional: true - warning@4.0.3: - resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==} - web-namespaces@2.0.1: resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} @@ -15366,10 +15342,6 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 - make-cancellable-promise@2.0.0: {} - - make-event-props@2.0.0: {} - markdown-extensions@2.0.0: {} markdown-table@3.0.4: {} @@ -15564,10 +15536,6 @@ snapshots: '@types/dom-mediacapture-transform': 0.1.11 '@types/dom-webcodecs': 0.1.13 - merge-refs@2.0.0(@types/react@19.2.14): - optionalDependencies: - '@types/react': 19.2.14 - merge-stream@2.0.0: {} merge2@1.4.1: {} @@ -15976,6 +15944,9 @@ snapshots: dependencies: whatwg-url: 5.0.0 + node-readable-to-web-readable-stream@0.4.2: + optional: true + node-releases@2.0.27: {} npm-run-path@4.0.1: @@ -16138,9 +16109,10 @@ snapshots: path-type@4.0.0: {} - pdfjs-dist@5.4.296: + pdfjs-dist@5.6.205: optionalDependencies: '@napi-rs/canvas': 0.1.97 + node-readable-to-web-readable-stream: 0.4.2 performance-now@2.1.0: {} @@ -16523,21 +16495,6 @@ snapshots: react: 19.2.4 react-dom: 19.2.4(react@19.2.4) - react-pdf@10.4.1(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4): - dependencies: - clsx: 2.1.1 - dequal: 2.0.3 - make-cancellable-promise: 2.0.0 - make-event-props: 2.0.0 - merge-refs: 2.0.0(@types/react@19.2.14) - pdfjs-dist: 5.4.296 - react: 19.2.4 - react-dom: 19.2.4(react@19.2.4) - tiny-invariant: 1.3.1 - warning: 4.0.3 - optionalDependencies: - '@types/react': 19.2.14 - react-remove-scroll-bar@2.3.8(@types/react@19.2.14)(react@19.2.4): dependencies: react: 19.2.4 @@ -17658,10 +17615,6 @@ snapshots: lightningcss: 1.31.1 tsx: 4.21.0 - warning@4.0.3: - dependencies: - loose-envify: 1.4.0 - web-namespaces@2.0.1: {} web-vitals@5.1.0: {}