pawa-ssr 1.3.2 → 1.3.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.
Files changed (2) hide show
  1. package/index.js +8 -12
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -5,6 +5,7 @@ import { propsValidator, evaluateExpr,extractAtExpressions, reArrangeAttri,resum
5
5
  import {AsyncLocalStorage} from'node:async_hooks'
6
6
  import { If,For,State,Switch, Key } from'./power.js';
7
7
  import PawaElement from'./pawaElement.js'
8
+ import { pluginsMap } from "pawajs";
8
9
 
9
10
  const PAWA_STORE_SYMBOL = Symbol.for('pawa.ssr.store');
10
11
 
@@ -221,15 +222,10 @@ export const getAllServerAttrArray=()=>{
221
222
  return allServerAttr;
222
223
  }
223
224
 
224
- const compoBeforeCall = new Set()
225
- const compoAfterCall=new Set()
226
- const renderBeforePawa=new Set()
227
- const renderAfterPawa=new Set()
228
- const renderBeforeChild=new Set()
229
- const startsWithSet=new Set()
230
- const fullNamePlugin=new Set()
231
- const externalPlugin={}
232
- const pawaAttributes=new Set()
225
+ const {compoAfterCall,compoBeforeCall,externalPlugin,
226
+ fullNamePlugin,renderAfterPawa,renderBeforeChild,
227
+ renderBeforePawa,startsWithSet
228
+ }=pluginsMap()
233
229
  const setPawaAttribute=(...attr)=>{
234
230
  attr.forEach(att=>{
235
231
  pawaAttributes.add(att)
@@ -942,7 +938,7 @@ export const render =async (el, contexts = {},stream) => {
942
938
  console.error(error.message,error.stack)
943
939
  }
944
940
  }
945
-
941
+ const stateContext=store.getStore().stateContext
946
942
  PawaElement.Element(el,context)
947
943
  if(el.childNodes.some(node=>node.nodeType === 3 && node.nodeValue.includes('@{')) && !el._avoidPawaRender){
948
944
  await textContentHandler(el)
@@ -987,7 +983,7 @@ export const render =async (el, contexts = {},stream) => {
987
983
  console.warn(`${attr.name} plugin must be a function`)
988
984
  return
989
985
  }
990
- await plugin(el,attr)
986
+ await plugin(el,attr,stateContext,stream)// on client no stream but an object called notRender
991
987
  }catch(error){
992
988
  console.warn(error.message,error.stack)
993
989
  }
@@ -1001,7 +997,7 @@ export const render =async (el, contexts = {},stream) => {
1001
997
  console.warn(`${name} plugin must be a function`)
1002
998
  return
1003
999
  }
1004
- await plugin(el,attr)
1000
+ await plugin(el,attr,stateContext,stream)
1005
1001
  }catch(error){
1006
1002
  console.warn(error.message,error.stack)
1007
1003
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pawa-ssr",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "type":"module",
5
5
  "description": "pawajs ssr libary",
6
6
  "main": "index.js",
@@ -25,6 +25,6 @@
25
25
  "homepage": "https://github.com/Allisboy/pawajs-ssr#readme",
26
26
  "dependencies": {
27
27
  "linkedom": "^0.18.11",
28
- "pawajs": "^1.4.7"
28
+ "pawajs": "^1.4.11"
29
29
  }
30
30
  }