fragmentless-branches
Rich Harris 3 months ago
parent ed183cd60c
commit 3a40955658

@ -246,8 +246,11 @@ export class Boundary {
if (this.#pending_count > 0) {
var fragment = document.createDocumentFragment();
var anchor = create_text();
fragment.append(anchor);
this.#offscreen_effect = this.#main_effect;
move_effect(this.#main_effect, fragment);
move_effect_before(this.#offscreen_effect, anchor);
const pending = /** @type {(anchor: Node) => void} */ (this.#props.pending);
this.#pending_effect = branch(() => pending(this.#anchor));

@ -114,8 +114,6 @@ export class BranchManager {
if (keys.includes(k)) {
// keep the effect offscreen, as another batch will need it
move_effect_before(effect, create_text());
this.#offscreen.set(k, effect);
} else {
destroy_effect(effect);

@ -151,7 +151,6 @@ function destroy_effects(state, to_destroy, remove_dom = true) {
if (preserved_effects?.has(e)) {
e.f |= EFFECT_OFFSCREEN;
move_effect_before(e, create_text());
} else {
destroy_effect(to_destroy[i], remove_dom);
}

Loading…
Cancel
Save