Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
602fa2b7ff | |||
b1aae3e5b9 | |||
6b381d6115 | |||
25006901d9 | |||
ee613836d1 | |||
4b53173618 | |||
46a0220273 | |||
46a6c903e1 | |||
134151eb70 | |||
ac1c3ac53d | |||
09c23d04f4 | |||
3f359cb58c | |||
a85eb48343 | |||
7c851b5ed2 |
3366
package-lock.json
generated
3366
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartssr",
|
||||
"version": "1.0.18",
|
||||
"version": "1.0.25",
|
||||
"private": false,
|
||||
"description": "a smart server side renderer supporting shadow dom",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -14,18 +14,18 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tstest": "^1.0.52",
|
||||
"@gitzone/tstest": "^1.0.54",
|
||||
"@pushrocks/smartserve": "^1.1.41",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@pushrocks/tapbundle": "^3.2.14",
|
||||
"@types/node": "^14.14.20",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartdelay": "^2.0.10",
|
||||
"@pushrocks/smartfile": "^8.0.8",
|
||||
"@pushrocks/smartpromise": "^3.1.3",
|
||||
"@pushrocks/smartpuppeteer": "^1.0.19",
|
||||
"@pushrocks/smartfile": "^8.0.10",
|
||||
"@pushrocks/smartpromise": "^3.1.5",
|
||||
"@pushrocks/smartpuppeteer": "^1.0.21",
|
||||
"@pushrocks/smarttime": "^3.0.38"
|
||||
},
|
||||
"files": [
|
||||
|
@ -13,13 +13,11 @@ tap.test('should start the smartssr instance', async () => {
|
||||
await testSSRInstance.start();
|
||||
});
|
||||
|
||||
tap.skip.test('should render central.eu', async (tools) => {
|
||||
await testSSRInstance.renderPage(
|
||||
'https://central.eu/article/5e76873b9cf69b7bf6bc78bc/Introducing%3A%20central.eu'
|
||||
);
|
||||
tap.test('should render central.eu', async (tools) => {
|
||||
await testSSRInstance.renderPage('https://in.work');
|
||||
});
|
||||
|
||||
tap.test('should render lossless.com', async () => {
|
||||
tap.skip.test('should render lossless.com', async () => {
|
||||
await testSSRInstance.renderPage('https://lossless.com');
|
||||
});
|
||||
|
||||
|
@ -43,6 +43,17 @@ export class SmartSSR {
|
||||
const resultDeferred = plugins.smartpromise.defer<string>();
|
||||
const context = await this.browser.getNewIncognitoContext();
|
||||
const page = await context.newPage();
|
||||
|
||||
// lets protext against left open tabs
|
||||
plugins.smartdelay.delayFor(30000).then(() => {
|
||||
if (!page.isClosed) {
|
||||
page.close();
|
||||
context.close();
|
||||
throw new Error(`failed to render ${urlArg}`);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
page.on('console', (msg) => {
|
||||
console.log(`${urlArg}: ${msg.text()}`);
|
||||
});
|
||||
@ -51,6 +62,7 @@ export class SmartSSR {
|
||||
renderTimeMeasurement.start();
|
||||
await page.goto(urlArg, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let screenshotBuffer: Buffer;
|
||||
@ -70,7 +82,8 @@ export class SmartSSR {
|
||||
renderTimeMeasurement.stop();
|
||||
|
||||
// lets clean up async
|
||||
context.close();
|
||||
await page.close();
|
||||
await context.close();
|
||||
|
||||
overallTimeMeasurement.stop();
|
||||
console.log(
|
||||
|
@ -69,6 +69,9 @@ export function serializeFunction(rootNode) {
|
||||
noteForAppending.push(childNode);
|
||||
}
|
||||
});
|
||||
while (nodeArg.firstChild) {
|
||||
nodeArg.removeChild(nodeArg.firstChild);
|
||||
}
|
||||
noteForAppending.forEach((childNode) => {
|
||||
nodeArg.append(childNode);
|
||||
});
|
||||
|
Reference in New Issue
Block a user