lahama 2.5.0 → 2.5.2
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/dist/lahama.js +14 -11
- package/package.json +5 -8
package/dist/lahama.js
CHANGED
|
@@ -177,16 +177,10 @@ function hFragment(vNodes) {
|
|
|
177
177
|
function addEventListener(
|
|
178
178
|
eventName,
|
|
179
179
|
handler,
|
|
180
|
-
el
|
|
181
|
-
hostComponent = null
|
|
180
|
+
el
|
|
182
181
|
) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
? handler.apply(hostComponent, arguments)
|
|
186
|
-
: handler(...arguments);
|
|
187
|
-
}
|
|
188
|
-
el.addEventListener(eventName, boundHandler);
|
|
189
|
-
return boundHandler
|
|
182
|
+
el.addEventListener(eventName, handler);
|
|
183
|
+
return handler
|
|
190
184
|
}
|
|
191
185
|
function addEventListeners(listeners = {}, el) {
|
|
192
186
|
const addedListeners = {};
|
|
@@ -380,6 +374,12 @@ class Dispatcher {
|
|
|
380
374
|
}
|
|
381
375
|
|
|
382
376
|
function areNodesEqual(nodeOne, nodeTwo) {
|
|
377
|
+
if (!nodeOne || !nodeTwo) {
|
|
378
|
+
console.error('Invalid VDOM node', { nodeOne, nodeTwo });
|
|
379
|
+
}
|
|
380
|
+
if (!nodeOne.type || !nodeTwo.type) {
|
|
381
|
+
console.error('Invalid VDOM node', { nodeOne, nodeTwo });
|
|
382
|
+
}
|
|
383
383
|
if (nodeOne.type !== nodeTwo.type) {
|
|
384
384
|
return false
|
|
385
385
|
}
|
|
@@ -515,8 +515,7 @@ function patchEvents(
|
|
|
515
515
|
}
|
|
516
516
|
const addedListeners = {};
|
|
517
517
|
for (const eventName of added.concat(updated)) {
|
|
518
|
-
const listener =
|
|
519
|
-
addEventListener(eventName, newEvents[eventName], el);
|
|
518
|
+
const listener = addEventListener(eventName, newEvents[eventName], el);
|
|
520
519
|
addedListeners[eventName] = listener;
|
|
521
520
|
}
|
|
522
521
|
return addedListeners
|
|
@@ -586,6 +585,10 @@ function createApp({ state, view, reducers = {} }) {
|
|
|
586
585
|
}
|
|
587
586
|
function renderApp() {
|
|
588
587
|
const newVdom = view(state, emit);
|
|
588
|
+
if (!newVdom) {
|
|
589
|
+
console.error('View returned', newVdom);
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
589
592
|
vdom = patchDOM(vdom, newVdom, parentEl);
|
|
590
593
|
}
|
|
591
594
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lahama",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/lahama.js",
|
|
6
6
|
"files": [
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
],
|
|
9
9
|
"scripts": {
|
|
10
10
|
"prepack": "npm run build",
|
|
11
|
-
"build": "rollup -c",
|
|
11
|
+
"build": "rimraf dist && rollup -c",
|
|
12
12
|
"lint": "eslint src",
|
|
13
13
|
"lint:fix": "eslint src --fix",
|
|
14
14
|
"test": "vitest",
|
|
@@ -19,16 +19,13 @@
|
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"eslint": "^9.39.0",
|
|
22
|
+
"@eslint/js": "^9.39.0",
|
|
23
|
+
"globals": "^16.5.0",
|
|
23
24
|
"jsdom": "^27.2.0",
|
|
25
|
+
"rimraf": "^3.0.2",
|
|
24
26
|
"rollup": "^4.52.5",
|
|
25
27
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
26
28
|
"rollup-plugin-filesize": "^10.0.0",
|
|
27
29
|
"vitest": "^4.0.15"
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@eslint/js": "^9.39.0",
|
|
31
|
-
"globals": "^16.5.0",
|
|
32
|
-
"lahama": "^1.1.0"
|
|
33
30
|
}
|
|
34
31
|
}
|