Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
perf(frontend): lazy-load @react-pdf/renderer and drop dead html2pdf.js
Sergey Kozyrenko21d61b37eef8
diff --git a/frontend/package.json b/frontend/package.jsonindex 9430de9a..a98df087 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -64,7 +64,6 @@"graphql": "^16.11.0","graphql-ws": "^6.0.5","highlight.js": "^11.11.1",- "html2pdf.js": "^0.14.0","js-cookie": "^3.0.5","lodash": "^4.18.1","lowlight": "^3.3.0",diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yamlindex e1f3e11c..08dbfdba 100644--- a/frontend/pnpm-lock.yaml+++ b/frontend/pnpm-lock.yaml@@ -146,9 +146,6 @@ importers:highlight.js:specifier: ^11.11.1version: 11.11.1- html2pdf.js:- specifier: ^0.14.0- version: 0.14.0js-cookie:specifier: ^3.0.5version: 3.0.5@@ -2590,15 +2587,9 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==}- '@types/[email protected]':- resolution: {integrity: sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==}-'@types/[email protected]':resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==}- '@types/[email protected]':- resolution: {integrity: sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==}-'@types/[email protected]':resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==}peerDependencies:@@ -2929,10 +2920,6 @@ packages:resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}engines: {node: 18 || 20 || >=22}- resolution: {integrity: sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==}- engines: {node: '>= 0.6.0'}-resolution: {integrity: sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==}engines: {node: '>= 0.4'}@@ -3001,10 +2988,6 @@ packages:resolution: {integrity: sha512-6q8HFp+lOQtcf7wBK+uEenxymVWkGKkjFpCvw5W25cmMwEDU45p1xQFBQv8JDlMMry7eNxyBaR+qxgmTUZkIRQ==}- resolution: {integrity: sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==}- engines: {node: '>=10.0.0'}-resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==}@@ -3153,9 +3136,6 @@ packages:resolution: {integrity: sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==}engines: {node: '>=18'}- resolution: {integrity: sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==}-resolution: {integrity: sha512-Akr82WH1Wfqatyiqpj8HDkO2o2KmJRu1FhKfSNJP3K4IdXwHfEyL7MOb62i1AGQVLtIQM+iCE9CGOtrfhR+mmA==}engines: {node: '>=v18'}@@ -3194,9 +3174,6 @@ packages:resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}engines: {node: '>= 8'}- resolution: {integrity: sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==}-resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==}@@ -3388,9 +3365,6 @@ packages:resolution: {integrity: sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==}- resolution: {integrity: sha512-nolgK9JcaUXMSmW+j1yaSvaEaoXYHwWyGJlkoCTghc97KgGDDSnpoU/PlEnw63Ah+TGKFOyY+X5LnxaWbCSfXg==}-resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==}@@ -3634,9 +3608,6 @@ packages:resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}- resolution: {integrity: sha512-kAqZq1TlgBjZcLr5mcN6NP5Rv4V2f22z00c3g8vRrwkcqjerx7BEhPbOnWCPqaHUl2XWQBJQvOT/FQhdMT7X/Q==}-resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==}@@ -3656,9 +3627,6 @@ packages:resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}engines: {node: ^12.20 || >= 14.13}- resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==}-resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==}engines: {node: '>=16.0.0'}@@ -3944,13 +3912,6 @@ packages:resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==}- resolution: {integrity: sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==}- engines: {node: '>=8.0.0'}-- resolution: {integrity: sha512-yvNJgE/8yru2UeGflkPdjW8YEY+nDH5X7/2WG4uiuSCwYiCp8PZ8EKNiTAa6HxJ1NjC51fZSIEq6xld5CADKBQ==}-resolution: {integrity: sha512-kvL8xYl5QMTh+LwohVN72ciOxC0OEV79IPdJSTwEXok9y9QHebXGdFgrED4sWfiax/ODx++CAMk3hMy4XPJPOw==}@@ -4015,9 +3976,6 @@ packages:resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==}- resolution: {integrity: sha512-DRebOWuqDvxunfkNJAlc3IzWIPD5xVxwUNbHr7xKB8E6aLJxIPfNX3CoMJghcFjpv6RWQsrcJbghtEwSPoJqMA==}-resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==}engines: {node: '>=0.10.0'}@@ -4286,9 +4244,6 @@ packages:resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==}- resolution: {integrity: sha512-YyAXyvnmjTbR4bHQRLzex3CuINCDlQnBqoSYyjJwTP2x9jDLuKDzy7aKUl0hgx3uhcl7xzg32agn5vlie6HIlQ==}-resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}engines: {node: '>=4.0'}@@ -4815,9 +4770,6 @@ packages:resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}- resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==}-resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==}@@ -4880,9 +4832,6 @@ packages:resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}- resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}-resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}@@ -5040,9 +4989,6 @@ packages:resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==}- resolution: {integrity: sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==}-resolution: {integrity: sha512-tBaoDWjPwe0M5pGrum4H0SR6Lyk+BO9oHnp9JbKpGKW2mlraNPgP9BMfsg5pWpwrssARmeqk7YBl2oXutZTaHA==}engines: {node: '>=18'}@@ -5178,9 +5124,6 @@ packages:resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}-resolution: {integrity: sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==}@@ -5279,10 +5222,6 @@ packages:resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==}- resolution: {integrity: sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==}- engines: {node: '>= 0.8.15'}-resolution: {integrity: sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==}engines: {node: '>=18.0.0', npm: '>=8.0.0'}@@ -5432,10 +5371,6 @@ packages:resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}- resolution: {integrity: sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==}- engines: {node: '>=0.1.14'}-resolution: {integrity: sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==}@@ -5526,10 +5461,6 @@ packages:resolution: {integrity: sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==}- resolution: {integrity: sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==}- engines: {node: '>=12.0.0'}-resolution: {integrity: sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw==}@@ -5559,9 +5490,6 @@ packages:engines: {node: '>=10'}hasBin: true- resolution: {integrity: sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==}-resolution: {integrity: sha512-YBGpG4bWsHoPvofT6y/5iqulfXIiIErl5B0LdtHT1mGXDFTAhhRrbUpTvBgYbovr+3cKblya2WAOcpoy90XguA==}engines: {node: '>=16'}@@ -5808,9 +5736,6 @@ packages:resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}- resolution: {integrity: sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==}-resolution: {integrity: sha512-ZFkClGpWyI2WUQjdLJ/BaGuV6AVQiJ3uELGk3OYtP+B6yCO7Cmn9vPFXVJkRaGkOJu3m8bQMgtyzNHixULceQA==}peerDependencies:@@ -8440,13 +8365,8 @@ snapshots:dependencies:undici-types: 6.21.0- '@types/[email protected]': {}-'@types/[email protected]': {}- '@types/[email protected]':- optional: true-'@types/[email protected](@types/[email protected])':dependencies:'@types/react': 19.2.14@@ -8836,8 +8756,6 @@ snapshots:- [email protected]: {}-@@ -8911,18 +8829,6 @@ snapshots:- dependencies:- '@babel/runtime': 7.29.2- '@types/raf': 3.4.3- core-js: 3.49.0- raf: 3.4.1- regenerator-runtime: 0.13.11- rgbcolor: 1.0.1- stackblur-canvas: 2.7.0- svg-pathdata: 6.0.3- optional: true-dependencies:no-case: 3.0.4@@ -9084,9 +8990,6 @@ snapshots:- optional: true-[email protected](@types/[email protected])([email protected]([email protected]))([email protected]):dependencies:'@types/node': 22.19.17@@ -9130,10 +9033,6 @@ snapshots:shebang-command: 2.0.0which: 2.0.2- dependencies:- utrie: 1.0.2-dependencies:boolbase: 1.0.0@@ -9304,10 +9203,6 @@ snapshots:optionalDependencies:'@types/trusted-types': 2.0.7- optionalDependencies:- '@types/trusted-types': 2.0.7-dependencies:dom-serializer: 1.4.1@@ -9676,12 +9571,6 @@ snapshots:- dependencies:- '@types/pako': 2.0.4- iobuffer: 5.4.0- pako: 2.1.0-@@ -9697,8 +9586,6 @@ snapshots:node-domexception: 1.0.0web-streams-polyfill: 3.3.3- [email protected]: {}-dependencies:flat-cache: 4.0.1@@ -10055,17 +9942,6 @@ snapshots:- dependencies:- css-line-break: 2.1.0- text-segmentation: 1.0.3-- dependencies:- dompurify: 3.4.0- html2canvas: 1.4.1- jspdf: 4.2.1-@@ -10113,8 +9989,6 @@ snapshots:dependencies:loose-envify: 1.4.0- [email protected]: {}-dependencies:is-relative: 1.0.0@@ -10386,17 +10260,6 @@ snapshots:optionalDependencies:graceful-fs: 4.2.11- dependencies:- '@babel/runtime': 7.29.2- fast-png: 6.4.0- fflate: 0.8.2- optionalDependencies:- canvg: 3.0.11- core-js: 3.49.0- dompurify: 3.4.0- html2canvas: 1.4.1-dependencies:array-includes: 3.1.9@@ -11113,8 +10976,6 @@ snapshots:- [email protected]: {}-dependencies:dot-case: 3.0.4@@ -11185,9 +11046,6 @@ snapshots:- optional: true-@@ -11318,11 +11176,6 @@ snapshots:dependencies:inherits: 2.0.4- dependencies:- performance-now: 2.1.0- optional: true-dependencies:'@date-fns/tz': 1.4.1@@ -11484,9 +11337,6 @@ snapshots:get-proto: 1.0.1which-builtin-type: 1.2.1- optional: true-@@ -11606,9 +11456,6 @@ snapshots:- optional: true-dependencies:'@types/estree': 1.0.8@@ -11796,9 +11643,6 @@ snapshots:- optional: true-@@ -11918,9 +11762,6 @@ snapshots:- optional: true-dependencies:tslib: 2.8.1@@ -11948,10 +11789,6 @@ snapshots:commander: 2.20.3source-map-support: 0.5.21- dependencies:- utrie: 1.0.2-@@ -12198,10 +12035,6 @@ snapshots:- dependencies:- base64-arraybuffer: 1.0.2-[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]):dependencies:'@radix-ui/react-dialog': 1.1.15(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])diff --git a/frontend/src/lib/report.ts b/frontend/src/lib/report.tsindex 2e86e8a9..0a16e58f 100644--- a/frontend/src/lib/report.ts+++ b/frontend/src/lib/report.ts@@ -225,8 +225,17 @@ export const copyToClipboard = async (text: string): Promise<boolean> => {}};-// Export new PDF generation functions from report-pdf.tsx-export {- generatePDFBlobNew as generatePDFBlob,- generatePDFFromMarkdownNew as generatePDFFromMarkdown,-} from './report-pdf';+// Lazy-load the PDF generator so @react-pdf/renderer (~1.5 MB) is fetched+// only when the user actually triggers a PDF export, not on every page that+// imports report utilities (flow.tsx, flow-report.tsx).+export const generatePDFFromMarkdown = async (content: string, fileName: string): Promise<void> => {+ const { generatePDFFromMarkdownNew } = await import('./report-pdf');++ return generatePDFFromMarkdownNew(content, fileName);+};++export const generatePDFBlob = async (content: string): Promise<Blob> => {+ const { generatePDFBlobNew } = await import('./report-pdf');++ return generatePDFBlobNew(content);+};diff --git a/frontend/vite.config.ts b/frontend/vite.config.tsindex 77d7d523..332d0cab 100644--- a/frontend/vite.config.ts+++ b/frontend/vite.config.ts@@ -64,7 +64,6 @@ export default defineConfig(({ mode }) => {manualChunks: {'apollo-client': ['@apollo/client', 'graphql', 'graphql-ws'],markdown: ['react-markdown', 'rehype-highlight', 'rehype-raw', 'rehype-slug', 'remark-gfm'],- pdf: ['html2pdf.js'],'radix-ui': ['@radix-ui/react-accordion','@radix-ui/react-avatar',