Compare commits

..

2 Commits

Author SHA1 Message Date
602fa2b7ff 1.0.25 2021-05-19 01:33:59 +00:00
b1aae3e5b9 fix(core): update 2021-05-19 01:33:58 +00:00
3 changed files with 2172 additions and 1210 deletions

3360
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartssr",
"version": "1.0.24",
"version": "1.0.25",
"private": false,
"description": "a smart server side renderer supporting shadow dom",
"main": "dist_ts/index.js",
@ -14,17 +14,17 @@
},
"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/smartfile": "^8.0.10",
"@pushrocks/smartpromise": "^3.1.5",
"@pushrocks/smartpuppeteer": "^1.0.21",
"@pushrocks/smarttime": "^3.0.38"
},

View File

@ -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()}`);
});
@ -71,6 +82,7 @@ export class SmartSSR {
renderTimeMeasurement.stop();
// lets clean up async
await page.close();
await context.close();
overallTimeMeasurement.stop();