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",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.12.tgz",
|
||||
"integrity": "sha512-NoMt1NUhNqcF5y7fCTHoC3d/+MobzgNUg6yHbSGxFRaentQzCrMPNahQIVLbrAStf03LUUBePUjSRdPYucP1gw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@types/cron": "^1.7.1",
|
||||
@ -385,10 +384,9 @@
|
||||
}
|
||||
},
|
||||
"@types/cron": {
|
||||
"version": "1.7.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.1.tgz",
|
||||
"integrity": "sha512-48brwgU18DqA0mQX1As5OcJEo1yNjaXMM6Mk4r8K1dOzLJRQ37FE/kCivKx7ClKEHfhX2FdcxKzJ1B744a+V3A==",
|
||||
"dev": true,
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.2.tgz",
|
||||
"integrity": "sha512-AEpNLRcsVSc5AdseJKNHpz0d4e8+ow+abTaC0fKDbAU86rF1evoFF0oC2fV9FdqtfVXkG2LKshpLTJCFOpyvTg==",
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"moment": ">=2.14.0"
|
||||
@ -427,8 +425,7 @@
|
||||
"@types/luxon": {
|
||||
"version": "1.21.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.21.0.tgz",
|
||||
"integrity": "sha512-Zhrf65tpjOlVIYrUhX9eu1VzRo8iixQDLFPbfqFxPpG4pBTNNPZ2BFhYE0IAsDfW9GWg+RcrUqiLwrGJH4rq4w==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Zhrf65tpjOlVIYrUhX9eu1VzRo8iixQDLFPbfqFxPpG4pBTNNPZ2BFhYE0IAsDfW9GWg+RcrUqiLwrGJH4rq4w=="
|
||||
},
|
||||
"@types/mime-types": {
|
||||
"version": "2.1.0",
|
||||
@ -750,7 +747,6 @@
|
||||
"version": "1.8.2",
|
||||
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.8.2.tgz",
|
||||
"integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"moment-timezone": "^0.5.x"
|
||||
}
|
||||
@ -1113,8 +1109,7 @@
|
||||
"luxon": {
|
||||
"version": "1.22.0",
|
||||
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.22.0.tgz",
|
||||
"integrity": "sha512-3sLvlfbFo+AxVEY3IqxymbumtnlgBwjDExxK60W3d+trrUzErNAz/PfvPT+mva+vEUrdIodeCOs7fB6zHtRSrw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-3sLvlfbFo+AxVEY3IqxymbumtnlgBwjDExxK60W3d+trrUzErNAz/PfvPT+mva+vEUrdIodeCOs7fB6zHtRSrw=="
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.5",
|
||||
@ -1190,14 +1185,12 @@
|
||||
"moment": {
|
||||
"version": "2.24.0",
|
||||
"resolved": "https://verdaccio.lossless.one/moment/-/moment-2.24.0.tgz",
|
||||
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
|
||||
},
|
||||
"moment-timezone": {
|
||||
"version": "0.5.27",
|
||||
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.27.tgz",
|
||||
"integrity": "sha512-EIKQs7h5sAsjhPCqN6ggx6cEbs94GK050254TIJySD1bzoM5JTYDwAU1IoVOeTOL6Gm27kYJ51/uuvq1kIlrbw==",
|
||||
"dev": true,
|
||||
"version": "0.5.28",
|
||||
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.28.tgz",
|
||||
"integrity": "sha512-TDJkZvAyKIVWg5EtVqRzU97w0Rb0YVbfpqyjgu6GwXCAohVRqwZjf4fOzDE6p1Ch98Sro/8hQQi65WDXW5STPw==",
|
||||
"requires": {
|
||||
"moment": ">= 2.9.0"
|
||||
}
|
||||
|
@ -24,7 +24,8 @@
|
||||
"@pushrocks/smartdelay": "^2.0.6",
|
||||
"@pushrocks/smartfile": "^7.0.8",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartpuppeteer": "^1.0.15"
|
||||
"@pushrocks/smartpuppeteer": "^1.0.15",
|
||||
"@pushrocks/smarttime": "^3.0.12"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
@ -22,6 +22,8 @@ export class SmartSSR {
|
||||
}
|
||||
|
||||
public async renderPage(urlArg: string) {
|
||||
const overallTimeMeasurement = new plugins.smarttime.HrtMeasurement();
|
||||
overallTimeMeasurement.start();
|
||||
const resultDeferred = plugins.smartpromise.defer<string>();
|
||||
const context = await this.browser.createIncognitoBrowserContext();
|
||||
const page = await context.newPage();
|
||||
@ -41,11 +43,18 @@ export class SmartSSR {
|
||||
);
|
||||
});
|
||||
|
||||
const renderTimeMeasurement = new plugins.smarttime.HrtMeasurement();
|
||||
renderTimeMeasurement.start();
|
||||
await page.goto(urlArg);
|
||||
const result = await resultDeferred.promise;
|
||||
page.close().then(async () => {
|
||||
await context.close();
|
||||
});
|
||||
renderTimeMeasurement.stop();
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
@ -8,5 +8,6 @@ import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartpuppeteer from '@pushrocks/smartpuppeteer';
|
||||
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