Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
46a0220273 | |||
46a6c903e1 | |||
134151eb70 | |||
ac1c3ac53d | |||
09c23d04f4 | |||
3f359cb58c | |||
a85eb48343 | |||
7c851b5ed2 | |||
bcd69059f8 | |||
acba539a6f |
@ -26,16 +26,28 @@ mirror:
|
|||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
audit:
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --production --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
auditDevDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command npm config set registry https://registry.npmjs.org
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command npm audit --audit-level=high
|
- npmci command npm audit --audit-level=high --only=dev
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartssr",
|
"name": "@pushrocks/smartssr",
|
||||||
"version": "1.0.17",
|
"version": "1.0.22",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -2127,9 +2127,9 @@
|
|||||||
"integrity": "sha512-KENdm++8uuzxDz1cbUbXtz6InfReP28TYC5zxRgRtwsXh7ZWUkSA+/82IbO97PcSCAfIpg7dwj77G6KGSsTKEQ=="
|
"integrity": "sha512-KENdm++8uuzxDz1cbUbXtz6InfReP28TYC5zxRgRtwsXh7ZWUkSA+/82IbO97PcSCAfIpg7dwj77G6KGSsTKEQ=="
|
||||||
},
|
},
|
||||||
"@pushrocks/smartpuppeteer": {
|
"@pushrocks/smartpuppeteer": {
|
||||||
"version": "1.0.19",
|
"version": "1.0.21",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpuppeteer/-/smartpuppeteer-1.0.19.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpuppeteer/-/smartpuppeteer-1.0.21.tgz",
|
||||||
"integrity": "sha512-URD2QcXP95YZeaY4qQjddjNOCzE+VzIFHsavfyoxzlRmlnpF3y1+r2rbTwuoFcoZW+M0/4j0alISm7reUfhL9A==",
|
"integrity": "sha512-uTONNTNIIswX5UOPt3VYv/7gIDTdkdNqIhR1DpnKlemOVyVLOT7D0eZPuTGXDgtNjHdTyQ6ywc54/gEBGXTNwg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartenv": "^4.0.16",
|
"@pushrocks/smartenv": "^4.0.16",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartssr",
|
"name": "@pushrocks/smartssr",
|
||||||
"version": "1.0.17",
|
"version": "1.0.22",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a smart server side renderer supporting shadow dom",
|
"description": "a smart server side renderer supporting shadow dom",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -25,7 +25,7 @@
|
|||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartfile": "^8.0.8",
|
"@pushrocks/smartfile": "^8.0.8",
|
||||||
"@pushrocks/smartpromise": "^3.1.3",
|
"@pushrocks/smartpromise": "^3.1.3",
|
||||||
"@pushrocks/smartpuppeteer": "^1.0.19",
|
"@pushrocks/smartpuppeteer": "^1.0.21",
|
||||||
"@pushrocks/smarttime": "^3.0.38"
|
"@pushrocks/smarttime": "^3.0.38"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -51,6 +51,7 @@ export class SmartSSR {
|
|||||||
renderTimeMeasurement.start();
|
renderTimeMeasurement.start();
|
||||||
await page.goto(urlArg, {
|
await page.goto(urlArg, {
|
||||||
waitUntil: 'networkidle2',
|
waitUntil: 'networkidle2',
|
||||||
|
timeout: 30000
|
||||||
});
|
});
|
||||||
|
|
||||||
let screenshotBuffer: Buffer;
|
let screenshotBuffer: Buffer;
|
||||||
@ -66,12 +67,11 @@ export class SmartSSR {
|
|||||||
const renderedPageString = pageContent;
|
const renderedPageString = pageContent;
|
||||||
resultDeferred.resolve(renderedPageString);
|
resultDeferred.resolve(renderedPageString);
|
||||||
|
|
||||||
|
|
||||||
const result = await resultDeferred.promise;
|
const result = await resultDeferred.promise;
|
||||||
renderTimeMeasurement.stop();
|
renderTimeMeasurement.stop();
|
||||||
|
|
||||||
// lets clean up async
|
// lets clean up async
|
||||||
context.close();
|
await context.close();
|
||||||
|
|
||||||
overallTimeMeasurement.stop();
|
overallTimeMeasurement.stop();
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -47,11 +47,12 @@ export function serializeFunction(rootNode) {
|
|||||||
slotsForMove.push(slot);
|
slotsForMove.push(slot);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
for (const slot of slotsForMove) {
|
for (const slot of slotsForMove) {
|
||||||
const slottedLightNodesForMove = [];
|
const slottedLightNodesForMove = [];
|
||||||
slot.assignedNodes().forEach((lightNode) => slottedLightNodesForMove.push(lightNode));
|
slot.assignedNodes().forEach((lightNode) => slottedLightNodesForMove.push(lightNode));
|
||||||
slottedLightNodesForMove.forEach((lightNode) => slot.parentNode.insertBefore(lightNode, slot));
|
slottedLightNodesForMove.forEach((lightNode) =>
|
||||||
|
slot.parentNode.insertBefore(lightNode, slot)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// lets modify the css
|
// lets modify the css
|
||||||
|
Reference in New Issue
Block a user