Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
042caeeeb5 | |||
6ddfaffbff | |||
567507c88b | |||
35f7bdd984 |
30
package-lock.json
generated
30
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartssr",
|
"name": "@pushrocks/smartssr",
|
||||||
"version": "1.0.25",
|
"version": "1.0.27",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1375,6 +1375,12 @@
|
|||||||
"@pushrocks/smartlog-interfaces": "^2.0.20"
|
"@pushrocks/smartlog-interfaces": "^2.0.20"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/node": {
|
||||||
|
"version": "14.17.0",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.17.0.tgz",
|
||||||
|
"integrity": "sha512-w8VZUN/f7SSbvVReb9SWp6cJFevxb4/nkG65yLAya//98WgocKm5PLDAtSs5CtJJJM+kHmJjO/6mmYW4MHShZA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.2.4",
|
"version": "4.2.4",
|
||||||
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-4.2.4.tgz",
|
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-4.2.4.tgz",
|
||||||
@ -2861,6 +2867,14 @@
|
|||||||
"@pushrocks/smartparam": "^1.1.6",
|
"@pushrocks/smartparam": "^1.1.6",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@types/node": "^14.0.14"
|
"@types/node": "^14.0.14"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": {
|
||||||
|
"version": "14.17.0",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.17.0.tgz",
|
||||||
|
"integrity": "sha512-w8VZUN/f7SSbvVReb9SWp6cJFevxb4/nkG65yLAya//98WgocKm5PLDAtSs5CtJJJM+kHmJjO/6mmYW4MHShZA==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3179,9 +3193,9 @@
|
|||||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "14.14.20",
|
"version": "15.3.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.14.20.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-15.3.0.tgz",
|
||||||
"integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A=="
|
"integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ=="
|
||||||
},
|
},
|
||||||
"@types/parcel-bundler": {
|
"@types/parcel-bundler": {
|
||||||
"version": "1.12.3",
|
"version": "1.12.3",
|
||||||
@ -11005,6 +11019,14 @@
|
|||||||
"@types/sax": "^1.2.1",
|
"@types/sax": "^1.2.1",
|
||||||
"arg": "^4.1.3",
|
"arg": "^4.1.3",
|
||||||
"sax": "^1.2.4"
|
"sax": "^1.2.4"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": {
|
||||||
|
"version": "14.17.0",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.17.0.tgz",
|
||||||
|
"integrity": "sha512-w8VZUN/f7SSbvVReb9SWp6cJFevxb4/nkG65yLAya//98WgocKm5PLDAtSs5CtJJJM+kHmJjO/6mmYW4MHShZA==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"smartchai": {
|
"smartchai": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartssr",
|
"name": "@pushrocks/smartssr",
|
||||||
"version": "1.0.25",
|
"version": "1.0.27",
|
||||||
"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",
|
||||||
@ -10,14 +10,14 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --web)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild --web)",
|
"build": "(tsbuild --web)",
|
||||||
"format": "(gitzone format)"
|
"serve": "tsrun scripts/serve.ts"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tstest": "^1.0.54",
|
"@gitzone/tstest": "^1.0.54",
|
||||||
"@pushrocks/smartserve": "^1.1.41",
|
"@pushrocks/smartserve": "^1.1.41",
|
||||||
"@pushrocks/tapbundle": "^3.2.14",
|
"@pushrocks/tapbundle": "^3.2.14",
|
||||||
"@types/node": "^14.14.20",
|
"@types/node": "^15.3.0",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
|
@ -14,7 +14,7 @@ tap.test('should start the smartssr instance', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should render central.eu', async (tools) => {
|
tap.test('should render central.eu', async (tools) => {
|
||||||
await testSSRInstance.renderPage('https://in.work');
|
await testSSRInstance.renderPage('https://lossless.com');
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.skip.test('should render lossless.com', async () => {
|
tap.skip.test('should render lossless.com', async () => {
|
||||||
@ -23,6 +23,7 @@ tap.skip.test('should render lossless.com', async () => {
|
|||||||
|
|
||||||
tap.skip.test('should render https://lossless.gmbh', async () => {
|
tap.skip.test('should render https://lossless.gmbh', async () => {
|
||||||
const renderedPage = await testSSRInstance.renderPage('https://lossless.gmbh');
|
const renderedPage = await testSSRInstance.renderPage('https://lossless.gmbh');
|
||||||
|
console.log(renderedPage);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should stop the smartssr instance', async () => {
|
tap.test('should stop the smartssr instance', async () => {
|
||||||
|
@ -39,6 +39,8 @@ export function serializeFunction(rootNode) {
|
|||||||
const nodeUUID = uuidv4();
|
const nodeUUID = uuidv4();
|
||||||
|
|
||||||
nodeArg.classList.add(nodeUUID);
|
nodeArg.classList.add(nodeUUID);
|
||||||
|
|
||||||
|
// find all slots
|
||||||
const slots = nodeArg.shadowRoot.querySelectorAll('slot');
|
const slots = nodeArg.shadowRoot.querySelectorAll('slot');
|
||||||
|
|
||||||
// handle slot element
|
// handle slot element
|
||||||
@ -59,6 +61,16 @@ export function serializeFunction(rootNode) {
|
|||||||
const childNodes = nodeArg.shadowRoot.childNodes;
|
const childNodes = nodeArg.shadowRoot.childNodes;
|
||||||
// tslint:disable-next-line: prefer-for-of
|
// tslint:disable-next-line: prefer-for-of
|
||||||
const noteForAppending: HTMLElement[] = [];
|
const noteForAppending: HTMLElement[] = [];
|
||||||
|
|
||||||
|
// lets care about static css first
|
||||||
|
if ((nodeArg.constructor as any).styles && (nodeArg.constructor as any).styles instanceof Array) {
|
||||||
|
for (const objectArg of (nodeArg.constructor as any).styles) {
|
||||||
|
const styleTag = document.createElement('style');
|
||||||
|
styleTag.textContent = prependCss(nodeUUID, objectArg.cssText);
|
||||||
|
noteForAppending.push(styleTag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
childNodes.forEach((childNode) => {
|
childNodes.forEach((childNode) => {
|
||||||
if (childNode instanceof HTMLElement) {
|
if (childNode instanceof HTMLElement) {
|
||||||
if (childNode.tagName === 'STYLE') {
|
if (childNode.tagName === 'STYLE') {
|
||||||
|
Reference in New Issue
Block a user