pawa-ssr 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils.js +2 -14
package/CHANGELOG.md
ADDED
package/index.js
CHANGED
|
@@ -290,7 +290,7 @@ const component=async (el)=>{
|
|
|
290
290
|
serialize:{},
|
|
291
291
|
fromSerialized:{}
|
|
292
292
|
}
|
|
293
|
-
Object.assign(appContext.transportContext, oldAppContext
|
|
293
|
+
Object.assign(appContext.transportContext, oldAppContext?.transportContext || {})
|
|
294
294
|
Array.from(slot.children).forEach(prop =>{
|
|
295
295
|
if (prop.getAttribute('prop')) {
|
|
296
296
|
slots[prop.getAttribute('prop')]=()=>prop.innerHTML
|
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -69,18 +69,9 @@ export const processNode = (node, itemContext) => {
|
|
|
69
69
|
if (typeof itemContext === 'number') {
|
|
70
70
|
return
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
if (node.nodeType === 3) { // Text node
|
|
74
|
-
const text = node.textContent
|
|
75
|
-
const newText = text.replace(/{{(.+?)}}/g, (match, exp) => {
|
|
76
|
-
// Use the cached expression evaluator for performance
|
|
77
|
-
const result = evaluateExpr(exp, itemContext, `in processNode for text: ${exp}`);
|
|
78
|
-
return result !== null ? String(result) : match;
|
|
79
|
-
})
|
|
80
|
-
//console.log(newText)
|
|
81
|
-
node.textContent = newText
|
|
82
|
-
} else if (node.attributes) {
|
|
72
|
+
if (node.attributes) {
|
|
83
73
|
Array.from(node.attributes).forEach(attr => {
|
|
74
|
+
if (attr.name !== 'for-key') return
|
|
84
75
|
const newValue = attr.value.replace(/{{(.+?)}}/g, (match, exp) => {
|
|
85
76
|
// Use the cached expression evaluator for performance
|
|
86
77
|
const result = evaluateExpr(exp, itemContext, `in processNode for attribute ${attr.name}: ${exp}`);
|
|
@@ -89,9 +80,6 @@ export const processNode = (node, itemContext) => {
|
|
|
89
80
|
attr.value = newValue
|
|
90
81
|
})
|
|
91
82
|
}
|
|
92
|
-
Array.from(node.childNodes).forEach((n) => {
|
|
93
|
-
processNode(n, itemContext)
|
|
94
|
-
})
|
|
95
83
|
}
|
|
96
84
|
|
|
97
85
|
export const extractAtExpressions=(template) =>{
|