Compare commits

..

2 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
4 changed files with 10 additions and 8 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartssr", "name": "@pushrocks/smartssr",
"version": "1.0.26", "version": "1.0.27",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartssr", "name": "@pushrocks/smartssr",
"version": "1.0.26", "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,7 +10,7 @@
"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",

View File

@ -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 () => {

View File

@ -63,11 +63,13 @@ export function serializeFunction(rootNode) {
const noteForAppending: HTMLElement[] = []; const noteForAppending: HTMLElement[] = [];
// lets care about static css first // lets care about static css first
if ((nodeArg.constructor as any).styles?.cssText) { 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'); const styleTag = document.createElement('style');
styleTag.textContent = prependCss(nodeUUID, (nodeArg.constructor as any).styles.cssText); styleTag.textContent = prependCss(nodeUUID, objectArg.cssText);
noteForAppending.push(styleTag); noteForAppending.push(styleTag);
} }
}
childNodes.forEach((childNode) => { childNodes.forEach((childNode) => {
if (childNode instanceof HTMLElement) { if (childNode instanceof HTMLElement) {