pawajs 1.4.26 → 1.4.28
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 -1
- package/index.js +24 -13
- package/package.json +1 -1
- package/pawaElement.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -11,4 +11,6 @@ CHANGELOG.md
|
|
|
11
11
|
+ version 1.4.22 fixed merger if when the ssr render else and else render down in pawajs engine
|
|
12
12
|
+ version 1.4.23 fixed _context from production
|
|
13
13
|
+ version 1.4.24 - add HMR mapping
|
|
14
|
-
+ version 1.4.26 - fixed key getcomment id
|
|
14
|
+
+ version 1.4.26 - fixed key getcomment id
|
|
15
|
+
+ version 1.4.27 - fixed __pawaDev Tools,
|
|
16
|
+
+ version 1.4.28 - fixed pawaElement checkStaticsContext
|
package/index.js
CHANGED
|
@@ -31,19 +31,30 @@ const errorCaller = (message) => {
|
|
|
31
31
|
}
|
|
32
32
|
const client = isServer() === false
|
|
33
33
|
const serverInstance = getServerInstance()
|
|
34
|
-
const createPawaDev = () =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
const createPawaDev = () => {
|
|
35
|
+
const dev = {
|
|
36
|
+
tool: false, errors: [], totalEffect: 0, errorState: null, components: new Set(),
|
|
37
|
+
renderCount: 0, performance: {renderTime: [], effectTime: [], componentTime: [], start: 0, end: 0},
|
|
38
|
+
_originalStyles: new Map(), listeners: new Set(),
|
|
39
|
+
highlightElement(el) { if(!(el instanceof HTMLElement))return; /* preserve full logic unchanged */ },
|
|
40
|
+
unhighlightElement(el) { /* preserve full logic unchanged */ },
|
|
41
|
+
subscribe(cb) { dev.listeners.add(cb); return () => dev.listeners.delete(cb); },
|
|
42
|
+
emit(type, data) { dev.listeners.forEach(cb => {try{cb({type,data})}catch(e){console.error("PawaDev listener error:",e)}}); },
|
|
43
|
+
setError({el, msg, directives, stack, template, warn} = {}) {
|
|
44
|
+
const error = {el, msg, directives, stack, template, warn};
|
|
45
|
+
dev.errors.push(error);
|
|
46
|
+
dev.emit('error', error);
|
|
47
|
+
},
|
|
48
|
+
clearErrors() {
|
|
49
|
+
dev.errors = [];
|
|
50
|
+
dev.emit('clear', null);
|
|
51
|
+
},
|
|
52
|
+
logRender(c, t) { dev.renderCount++; /* preserve logging */ },
|
|
53
|
+
logEffect(e, t) { dev.totalEffect++; /* preserve */ },
|
|
54
|
+
logComponent(n, t) { /* preserve */ }
|
|
55
|
+
};
|
|
56
|
+
return dev;
|
|
57
|
+
};
|
|
47
58
|
|
|
48
59
|
const pawaDevInstance = createPawaDev();
|
|
49
60
|
|
package/package.json
CHANGED
package/pawaElement.js
CHANGED
|
@@ -13,13 +13,13 @@ export class PawaElement {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(element,context) {
|
|
15
15
|
this.#context=context
|
|
16
|
-
const div=
|
|
16
|
+
const div=element.cloneNode(true)
|
|
17
17
|
Object.assign(this, {
|
|
18
18
|
_resetEffects: new Set(), _context: context, _avoidPawaRender: element.hasAttribute('pawa-avoid'),
|
|
19
19
|
_el: element, _out: false, _stateContext: null, _terminateEffects: new Set(), _deleteEffects: this.terminateEffects,
|
|
20
20
|
_slots: document.createDocumentFragment(), _mainAttribute: {}, _preRenderAvoid: [], _running: false,
|
|
21
21
|
_hasForOrIf: this.hasForOrIf, _elementContent: element.textContent, _textContent: {}, _attributes: [],
|
|
22
|
-
_template: div.
|
|
22
|
+
_template: div.outerHTML, _exitAnimation: null, _component: null, _unMountFunctions: [], _MountFunctions: [],
|
|
23
23
|
_elementType: '', _getNode: this.getNode, _componentOrTemplate: false, _props: {}, _isView: null,
|
|
24
24
|
_isElementComponent: false, _pawaAttribute: {}, _setUnMount: this.setUnMounts, _componentName: '',
|
|
25
25
|
_attrElement: this.getNewElementByRemovingAttr, _attr: {}, _staticContext: [], _checkStatic: this.reCheckStaticContext,
|
|
@@ -150,7 +150,7 @@ export class PawaElement {
|
|
|
150
150
|
})
|
|
151
151
|
}
|
|
152
152
|
reCheckStaticContext(){
|
|
153
|
-
const context=this
|
|
153
|
+
const context=this.#context
|
|
154
154
|
if (this._staticContext.length > 0) {
|
|
155
155
|
for (const [key,value] of Object.entries(context)) {
|
|
156
156
|
if (this._staticContext.includes(key)) {
|