cleanup a bunch of internal runtime logic (#10446)

pull/10449/head
Dominic Gannaway 7 months ago committed by GitHub
parent 89123a8117
commit 1366932dc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1091,7 +1091,7 @@ export function mark_subtree_inert(signal, inert, visited_blocks = new Set()) {
if (type === IF_BLOCK) { if (type === IF_BLOCK) {
const condition_effect = block.e; const condition_effect = block.e;
if (condition_effect !== null && block !== current_block) { if (condition_effect !== null && block !== current_block) {
mark_subtree_inert(condition_effect, inert); mark_subtree_inert(condition_effect, inert, visited_blocks);
} }
const consequent_effect = block.ce; const consequent_effect = block.ce;
if (consequent_effect !== null && block.v) { if (consequent_effect !== null && block.v) {

@ -649,12 +649,16 @@ export function trigger_transitions(transitions, target_direction, from) {
mark_subtree_inert(effect, false); mark_subtree_inert(effect, false);
} else if (target_direction === 'key') { } else if (target_direction === 'key') {
if (direction === 'key') { if (direction === 'key') {
transition.p = transition.i(/** @type {DOMRect} */ (from)); if (!transition.p) {
transition.p = transition.i(/** @type {DOMRect} */ (from));
}
transition.in(); transition.in();
} }
} else { } else {
if (direction === 'out' || direction === 'both') { if (direction === 'out' || direction === 'both') {
transition.p = transition.i(); if (!transition.p) {
transition.p = transition.i();
}
outros.push(transition.o); outros.push(transition.o);
} }
transition.d.inert = true; transition.d.inert = true;

@ -17,7 +17,7 @@ export default test({
component.visible = false; component.visible = false;
// @ts-expect-error // @ts-expect-error
assert.equal(global.count, 2); assert.equal(global.count, 1);
raf.tick(500); raf.tick(500);
assert.equal(div.foo, 0.25); assert.equal(div.foo, 0.25);

Loading…
Cancel
Save