fix(core): update
This commit is contained in:
parent
c8fc842869
commit
a5151b6c89
25
package-lock.json
generated
25
package-lock.json
generated
@ -326,7 +326,6 @@
|
|||||||
"version": "3.0.12",
|
"version": "3.0.12",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.12.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.12.tgz",
|
||||||
"integrity": "sha512-NoMt1NUhNqcF5y7fCTHoC3d/+MobzgNUg6yHbSGxFRaentQzCrMPNahQIVLbrAStf03LUUBePUjSRdPYucP1gw==",
|
"integrity": "sha512-NoMt1NUhNqcF5y7fCTHoC3d/+MobzgNUg6yHbSGxFRaentQzCrMPNahQIVLbrAStf03LUUBePUjSRdPYucP1gw==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@types/cron": "^1.7.1",
|
"@types/cron": "^1.7.1",
|
||||||
@ -385,10 +384,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/cron": {
|
"@types/cron": {
|
||||||
"version": "1.7.1",
|
"version": "1.7.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.2.tgz",
|
||||||
"integrity": "sha512-48brwgU18DqA0mQX1As5OcJEo1yNjaXMM6Mk4r8K1dOzLJRQ37FE/kCivKx7ClKEHfhX2FdcxKzJ1B744a+V3A==",
|
"integrity": "sha512-AEpNLRcsVSc5AdseJKNHpz0d4e8+ow+abTaC0fKDbAU86rF1evoFF0oC2fV9FdqtfVXkG2LKshpLTJCFOpyvTg==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"moment": ">=2.14.0"
|
"moment": ">=2.14.0"
|
||||||
@ -427,8 +425,7 @@
|
|||||||
"@types/luxon": {
|
"@types/luxon": {
|
||||||
"version": "1.21.0",
|
"version": "1.21.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.21.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.21.0.tgz",
|
||||||
"integrity": "sha512-Zhrf65tpjOlVIYrUhX9eu1VzRo8iixQDLFPbfqFxPpG4pBTNNPZ2BFhYE0IAsDfW9GWg+RcrUqiLwrGJH4rq4w==",
|
"integrity": "sha512-Zhrf65tpjOlVIYrUhX9eu1VzRo8iixQDLFPbfqFxPpG4pBTNNPZ2BFhYE0IAsDfW9GWg+RcrUqiLwrGJH4rq4w=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"@types/mime-types": {
|
"@types/mime-types": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
@ -750,7 +747,6 @@
|
|||||||
"version": "1.8.2",
|
"version": "1.8.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.8.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.8.2.tgz",
|
||||||
"integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==",
|
"integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"moment-timezone": "^0.5.x"
|
"moment-timezone": "^0.5.x"
|
||||||
}
|
}
|
||||||
@ -1113,8 +1109,7 @@
|
|||||||
"luxon": {
|
"luxon": {
|
||||||
"version": "1.22.0",
|
"version": "1.22.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.22.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.22.0.tgz",
|
||||||
"integrity": "sha512-3sLvlfbFo+AxVEY3IqxymbumtnlgBwjDExxK60W3d+trrUzErNAz/PfvPT+mva+vEUrdIodeCOs7fB6zHtRSrw==",
|
"integrity": "sha512-3sLvlfbFo+AxVEY3IqxymbumtnlgBwjDExxK60W3d+trrUzErNAz/PfvPT+mva+vEUrdIodeCOs7fB6zHtRSrw=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"make-error": {
|
"make-error": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
@ -1190,14 +1185,12 @@
|
|||||||
"moment": {
|
"moment": {
|
||||||
"version": "2.24.0",
|
"version": "2.24.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/moment/-/moment-2.24.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/moment/-/moment-2.24.0.tgz",
|
||||||
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
|
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"moment-timezone": {
|
"moment-timezone": {
|
||||||
"version": "0.5.27",
|
"version": "0.5.28",
|
||||||
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.27.tgz",
|
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.28.tgz",
|
||||||
"integrity": "sha512-EIKQs7h5sAsjhPCqN6ggx6cEbs94GK050254TIJySD1bzoM5JTYDwAU1IoVOeTOL6Gm27kYJ51/uuvq1kIlrbw==",
|
"integrity": "sha512-TDJkZvAyKIVWg5EtVqRzU97w0Rb0YVbfpqyjgu6GwXCAohVRqwZjf4fOzDE6p1Ch98Sro/8hQQi65WDXW5STPw==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"moment": ">= 2.9.0"
|
"moment": ">= 2.9.0"
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,8 @@
|
|||||||
"@pushrocks/smartdelay": "^2.0.6",
|
"@pushrocks/smartdelay": "^2.0.6",
|
||||||
"@pushrocks/smartfile": "^7.0.8",
|
"@pushrocks/smartfile": "^7.0.8",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartpuppeteer": "^1.0.15"
|
"@pushrocks/smartpuppeteer": "^1.0.15",
|
||||||
|
"@pushrocks/smarttime": "^3.0.12"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
@ -22,6 +22,8 @@ export class SmartSSR {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async renderPage(urlArg: string) {
|
public async renderPage(urlArg: string) {
|
||||||
|
const overallTimeMeasurement = new plugins.smarttime.HrtMeasurement();
|
||||||
|
overallTimeMeasurement.start();
|
||||||
const resultDeferred = plugins.smartpromise.defer<string>();
|
const resultDeferred = plugins.smartpromise.defer<string>();
|
||||||
const context = await this.browser.createIncognitoBrowserContext();
|
const context = await this.browser.createIncognitoBrowserContext();
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
@ -41,11 +43,18 @@ export class SmartSSR {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const renderTimeMeasurement = new plugins.smarttime.HrtMeasurement();
|
||||||
|
renderTimeMeasurement.start();
|
||||||
await page.goto(urlArg);
|
await page.goto(urlArg);
|
||||||
const result = await resultDeferred.promise;
|
const result = await resultDeferred.promise;
|
||||||
page.close().then(async () => {
|
renderTimeMeasurement.stop();
|
||||||
await context.close();
|
|
||||||
});
|
// lets clean up async
|
||||||
|
context.close();
|
||||||
|
|
||||||
|
overallTimeMeasurement.stop();
|
||||||
|
console.log(`Overall it took ${overallTimeMeasurement.milliSeconds} milliseconds to render ${urlArg}`);
|
||||||
|
console.log(`The rendering alone took ${renderTimeMeasurement.milliSeconds} milliseconds for ${urlArg}`)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,5 +8,6 @@ import * as smartdelay from '@pushrocks/smartdelay';
|
|||||||
import * as smartfile from '@pushrocks/smartfile';
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
import * as smartpuppeteer from '@pushrocks/smartpuppeteer';
|
import * as smartpuppeteer from '@pushrocks/smartpuppeteer';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
import * as smarttime from '@pushrocks/smarttime';
|
||||||
|
|
||||||
export { smartdelay, smartfile, smartpuppeteer, smartpromise };
|
export { smartdelay, smartfile, smartpuppeteer, smartpromise, smarttime };
|
||||||
|
Loading…
Reference in New Issue
Block a user