pawa-ssr 1.0.1 → 1.0.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/index.js CHANGED
@@ -149,17 +149,20 @@ const component=(el)=>{
149
149
  }
150
150
  })
151
151
  const children=el._componentChildren
152
+ /**
153
+ * @type{import('./pawaComponent.js').default}
154
+ */
152
155
  const component =el._component
153
156
  stateContext=component
154
157
  const insert=(arg={})=>{
155
- Object.assign(stateContext.context,arg)
158
+ Object.assign(stateContext._insert,arg)
156
159
  }
157
160
  /**
158
161
  *
159
162
  * @param {object} props
160
163
  * @returns {object}
161
164
  */
162
- stateContext._prop={children,...el._props}
165
+ stateContext._prop={children,...el._props,...slots}
163
166
  stateContext._name=el._componentName
164
167
  const useValidateProps=(props={}) => {
165
168
  if (!stateContext) {
@@ -193,7 +196,7 @@ stateContext._name=el._componentName
193
196
  try{
194
197
  compo=sanitizeTemplate(component.component(app))
195
198
  }catch(error){
196
- console.error(error.message,error.stack)
199
+ console.error(`error from ${stateContext._name}`,error.message,error.stack)
197
200
  }
198
201
  if (component?._insert) {
199
202
  Object.assign(el._context,component._insert)
@@ -255,7 +258,8 @@ const textContentHandler=(el)=>{
255
258
 
256
259
  });
257
260
  } catch (error) {
258
- console.warn(`error at ${el} textcontent`)
261
+ console.warn(`error at ${el._template} textcontent`)
262
+ console.error(error.message,error.stack)
259
263
  }
260
264
  };
261
265
  evaluate()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pawa-ssr",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "pawajs ssr libary",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pawaElement.js CHANGED
@@ -18,6 +18,7 @@ class PawaElement {
18
18
  this._slots=document.createDocumentFragment()
19
19
  this._context=context
20
20
  this._props={}
21
+ this._template=element.outerHTML
21
22
  this._component=null
22
23
  this._componentName=''
23
24
  this._running=false
package/power.js CHANGED
@@ -92,6 +92,7 @@ export const For=(el,attr)=>{
92
92
  [indexes]: index,
93
93
  ...context
94
94
  }
95
+ console.log(itemContext)
95
96
  const newElement=el.cloneNode(true)
96
97
  newElement.removeAttribute('server-for')
97
98
  newElement.setAttribute('s-data-for',convertToNumber(attr.value))