fix: include `segments` in upstream changes to hrm and svelte head

fix-interleaving
paoloricciuti 3 weeks ago committed by GitHub
parent 6fe7d4f5ae
commit 19a971cc1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -60,7 +60,7 @@ export function hmr(fn) {
// Forward the start/end DOM nodes from the inner effect to the outer active effect
// which would get them if the HMR wrapper wasn't there. Do this inside the block not
// outside so that HMR updates to the component will also update the nodes on the
// active effect. We copy only start/end, not the full nodes object, so that
// active effect. We copy only the removal ranges, not the full nodes object, so that
// pause_children does not collect transitions from both effects and fire outroend twice.
var inner_nodes = effect.nodes;
if (inner_nodes) {
@ -68,8 +68,15 @@ export function hmr(fn) {
if (ae.nodes) {
ae.nodes.start = inner_nodes.start;
ae.nodes.end = inner_nodes.end;
ae.nodes.segments = inner_nodes.segments;
} else {
ae.nodes = { start: inner_nodes.start, end: inner_nodes.end, a: null, t: null };
ae.nodes = {
start: inner_nodes.start,
end: inner_nodes.end,
segments: inner_nodes.segments,
a: null,
t: null
};
}
}
}, EFFECT_TRANSPARENT);

@ -64,7 +64,7 @@ export function head(hash, render_fn) {
if (!hydrating) {
if (e.nodes === null) {
e.nodes = { start: anchor, end: anchor, a: null, t: null };
e.nodes = { start: anchor, end: anchor, segments: null, a: null, t: null };
} else {
e.nodes.end = anchor;
}

Loading…
Cancel
Save