pawajs-continue 1.0.0 → 1.0.1
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/README.md +1 -1
- package/component.js +7 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ if (!isServer()) {
|
|
|
44
44
|
|
|
45
45
|
1. **Server-Side**: `pawa-ssr` renders the HTML and embeds serialized data (props, state, context) into comments within the DOM.
|
|
46
46
|
2. **Client-Side**: `pawajs-continue` scans the DOM during the `pawaStartApp` process.
|
|
47
|
-
3. **Continuity**: Instead of creating new DOM elements, it continues by reading
|
|
47
|
+
3. **Continuity**: Instead of creating new DOM elements, it continues by reading the markers or the serialized data, restores the state, and attaches reactive effects to the existing elements from the server rendering.
|
|
48
48
|
|
|
49
49
|
## API
|
|
50
50
|
|
package/component.js
CHANGED
|
@@ -62,8 +62,8 @@ const oldState=getCurrentContext()
|
|
|
62
62
|
stateContexts._elementContext={...element._context}
|
|
63
63
|
const number={notRender:null,index:null}
|
|
64
64
|
children.forEach((value, index) => {
|
|
65
|
-
number.index=index
|
|
66
|
-
|
|
65
|
+
number.index = index
|
|
66
|
+
if (number.notRender !== null && index <= number.notRender) return
|
|
67
67
|
render(value,element._context,number,attr.name)
|
|
68
68
|
})
|
|
69
69
|
stateContexts._hasRun=true
|
|
@@ -95,8 +95,8 @@ const oldState=getCurrentContext()
|
|
|
95
95
|
const number={notRender:null,index:null}
|
|
96
96
|
|
|
97
97
|
children.forEach((value, index) => {
|
|
98
|
-
number.index=index
|
|
99
|
-
|
|
98
|
+
number.index = index
|
|
99
|
+
if (number.notRender !== null && index <= number.notRender) return
|
|
100
100
|
render(value,element._context,number)
|
|
101
101
|
})
|
|
102
102
|
stateContexts._hasRun=true
|
|
@@ -182,10 +182,8 @@ const oldState=getCurrentContext()
|
|
|
182
182
|
children.forEach((value, index) => {
|
|
183
183
|
isIndex++
|
|
184
184
|
if(value.hasAttribute(attr.name)) value.removeAttribute(attr.name);
|
|
185
|
-
number.index=index
|
|
186
|
-
|
|
187
|
-
return
|
|
188
|
-
}
|
|
185
|
+
number.index = index
|
|
186
|
+
if (number.notRender !== null && index <= number.notRender) return
|
|
189
187
|
render(value,element._context,number,attr.name)
|
|
190
188
|
})
|
|
191
189
|
}
|
|
@@ -246,5 +244,5 @@ const oldState=getCurrentContext()
|
|
|
246
244
|
console.log(error.message,error.stack)
|
|
247
245
|
console.error(error.message,error.stack)
|
|
248
246
|
}
|
|
249
|
-
|
|
247
|
+
|
|
250
248
|
}
|