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 ADDED
@@ -0,0 +1,3 @@
1
+ CHANGELOG.md
2
+ + version 1.0.0 - v1.2.2 on experiment
3
+ + version 1.2.3 bugs fixing on for-key
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.transportContext)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pawa-ssr",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "type":"module",
5
5
  "description": "pawajs ssr libary",
6
6
  "main": "index.js",
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) =>{