Compare commits

..

4 Commits

Author SHA1 Message Date
042caeeeb5 1.0.27 2021-05-19 15:21:48 +00:00
6ddfaffbff fix(core): update 2021-05-19 15:21:47 +00:00
567507c88b 1.0.26 2021-05-19 11:32:13 +00:00
35f7bdd984 fix(core): update 2021-05-19 11:32:12 +00:00
4 changed files with 43 additions and 8 deletions

30
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartssr",
"version": "1.0.25",
"version": "1.0.27",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1375,6 +1375,12 @@
"@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": {
"version": "4.2.4",
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-4.2.4.tgz",
@ -2861,6 +2867,14 @@
"@pushrocks/smartparam": "^1.1.6",
"@pushrocks/smartpromise": "^3.0.6",
"@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=="
},
"@types/node": {
"version": "14.14.20",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.14.20.tgz",
"integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A=="
"version": "15.3.0",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-15.3.0.tgz",
"integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ=="
},
"@types/parcel-bundler": {
"version": "1.12.3",
@ -11005,6 +11019,14 @@
"@types/sax": "^1.2.1",
"arg": "^4.1.3",
"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": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartssr",
"version": "1.0.25",
"version": "1.0.27",
"private": false,
"description": "a smart server side renderer supporting shadow dom",
"main": "dist_ts/index.js",
@ -10,14 +10,14 @@
"scripts": {
"test": "(tstest test/ --web)",
"build": "(tsbuild --web)",
"format": "(gitzone format)"
"serve": "tsrun scripts/serve.ts"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.54",
"@pushrocks/smartserve": "^1.1.41",
"@pushrocks/tapbundle": "^3.2.14",
"@types/node": "^14.14.20",
"@types/node": "^15.3.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
},

View File

@ -14,7 +14,7 @@ tap.test('should start the smartssr instance', async () => {
});
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 () => {
@ -23,6 +23,7 @@ tap.skip.test('should render lossless.com', async () => {
tap.skip.test('should render https://lossless.gmbh', async () => {
const renderedPage = await testSSRInstance.renderPage('https://lossless.gmbh');
console.log(renderedPage);
});
tap.test('should stop the smartssr instance', async () => {

View File

@ -39,6 +39,8 @@ export function serializeFunction(rootNode) {
const nodeUUID = uuidv4();
nodeArg.classList.add(nodeUUID);
// find all slots
const slots = nodeArg.shadowRoot.querySelectorAll('slot');
// handle slot element
@ -59,6 +61,16 @@ export function serializeFunction(rootNode) {
const childNodes = nodeArg.shadowRoot.childNodes;
// tslint:disable-next-line: prefer-for-of
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) => {
if (childNode instanceof HTMLElement) {
if (childNode.tagName === 'STYLE') {