fix(core): update
This commit is contained in:
		| @@ -46,8 +46,12 @@ export class SmartSSR { | |||||||
|       console.log(`${urlArg}: ${msg.text()}`); |       console.log(`${urlArg}: ${msg.text()}`); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     page.on('load', async (...args) => { |     const renderTimeMeasurement = new plugins.smarttime.HrtMeasurement(); | ||||||
|       await plugins.smartdelay.delayFor(5000); |     renderTimeMeasurement.start(); | ||||||
|  |     await page.goto(urlArg, { | ||||||
|  |       waitUntil: 'networkidle2', | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     let screenshotBuffer: Buffer; |     let screenshotBuffer: Buffer; | ||||||
|  |  | ||||||
|     if (this.options.debug) { |     if (this.options.debug) { | ||||||
| @@ -61,19 +65,7 @@ export class SmartSSR { | |||||||
|     const renderedPageString = pageContent; |     const renderedPageString = pageContent; | ||||||
|     resultDeferred.resolve(renderedPageString); |     resultDeferred.resolve(renderedPageString); | ||||||
|  |  | ||||||
|       if (this.options.debug) { |  | ||||||
|         plugins.smartfile.memory.toFsSync( |  | ||||||
|           renderedPageString, |  | ||||||
|           plugins.path.join(paths.noGitDir, 'test.html') |  | ||||||
|         ); |  | ||||||
|         const fs = await import('fs'); |  | ||||||
|         fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.png'), screenshotBuffer); |  | ||||||
|       } |  | ||||||
|     }); |  | ||||||
|  |  | ||||||
|     const renderTimeMeasurement = new plugins.smarttime.HrtMeasurement(); |  | ||||||
|     renderTimeMeasurement.start(); |  | ||||||
|     await page.goto(urlArg); |  | ||||||
|     const result = await resultDeferred.promise; |     const result = await resultDeferred.promise; | ||||||
|     renderTimeMeasurement.stop(); |     renderTimeMeasurement.stop(); | ||||||
|  |  | ||||||
| @@ -87,6 +79,17 @@ export class SmartSSR { | |||||||
|     console.log( |     console.log( | ||||||
|       `The rendering alone took ${renderTimeMeasurement.milliSeconds} milliseconds for ${urlArg}` |       `The rendering alone took ${renderTimeMeasurement.milliSeconds} milliseconds for ${urlArg}` | ||||||
|     ); |     ); | ||||||
|  |  | ||||||
|  |     // debug | ||||||
|  |     if (this.options.debug) { | ||||||
|  |       plugins.smartfile.memory.toFsSync( | ||||||
|  |         renderedPageString, | ||||||
|  |         plugins.path.join(paths.noGitDir, 'test.html') | ||||||
|  |       ); | ||||||
|  |       const fs = await import('fs'); | ||||||
|  |       fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.png'), screenshotBuffer); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     return result; |     return result; | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -56,9 +56,6 @@ export function serializeFunction(rootNode) { | |||||||
|           if (childNode.tagName === 'STYLE') { |           if (childNode.tagName === 'STYLE') { | ||||||
|             childNode.textContent = prependCss(nodeUUID, childNode.textContent); |             childNode.textContent = prependCss(nodeUUID, childNode.textContent); | ||||||
|           } else { |           } else { | ||||||
|             if (nodeArg.tagName?.includes('ARTICLEGRID')) { |  | ||||||
|               console.log('hello ' + childNode.id); |  | ||||||
|             } |  | ||||||
|             serializeNode(childNode, logThis); |             serializeNode(childNode, logThis); | ||||||
|           } |           } | ||||||
|           noteForAppending.push(childNode); |           noteForAppending.push(childNode); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user