dom-expressions 0.38.2 → 0.38.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/package.json +2 -2
- package/src/client.js +9 -1
- package/src/server.js +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dom-expressions",
|
|
3
3
|
"description": "A Fine-Grained Runtime for Performant DOM Rendering",
|
|
4
|
-
"version": "0.38.
|
|
4
|
+
"version": "0.38.3",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"seroval": "^1.1.0",
|
|
30
30
|
"seroval-plugins": "^1.1.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "737c5c38c32da5d7f533e3c9f57cc846fab2634c"
|
|
33
33
|
}
|
package/src/client.js
CHANGED
|
@@ -296,8 +296,12 @@ export function runHydrationEvents() {
|
|
|
296
296
|
while (events.length) {
|
|
297
297
|
const [el, e] = events[0];
|
|
298
298
|
if (!completed.has(el)) return;
|
|
299
|
-
eventHandler(e);
|
|
300
299
|
events.shift();
|
|
300
|
+
eventHandler(e);
|
|
301
|
+
}
|
|
302
|
+
if (sharedConfig.done) {
|
|
303
|
+
sharedConfig.events = _$HY.events = null;
|
|
304
|
+
sharedConfig.completed = _$HY.completed = null;
|
|
301
305
|
}
|
|
302
306
|
});
|
|
303
307
|
sharedConfig.events.queued = true;
|
|
@@ -370,6 +374,10 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
370
374
|
}
|
|
371
375
|
|
|
372
376
|
function eventHandler(e) {
|
|
377
|
+
if (sharedConfig.registry && sharedConfig.events) {
|
|
378
|
+
if (sharedConfig.events.find(([el, ev]) => ev === e)) return;
|
|
379
|
+
}
|
|
380
|
+
|
|
373
381
|
const key = `$$${e.type}`;
|
|
374
382
|
let node = (e.composedPath && e.composedPath()[0]) || e.target;
|
|
375
383
|
// reverse Shadow DOM retargetting
|
package/src/server.js
CHANGED
|
@@ -506,7 +506,7 @@ export function generateHydrationScript({ eventNames = ["click", "input"], nonce
|
|
|
506
506
|
nonce ? ` nonce="${nonce}"` : ""
|
|
507
507
|
}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join(
|
|
508
508
|
'", "'
|
|
509
|
-
)}"].forEach((o=>document.addEventListener(o,(o=>{let
|
|
509
|
+
)}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
export function Hydration(props) {
|