fix(core): update

This commit is contained in:
Philipp Kunz 2021-05-19 01:33:58 +00:00
parent 6b381d6115
commit b1aae3e5b9
3 changed files with 2170 additions and 1208 deletions

3358
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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();