aa-coordination
Rich Harris 9 months ago
parent 0ace243a5f
commit 6e1a33162c

@ -30,14 +30,13 @@ import {
import { get_next_sibling } from '../operations.js';
import { queue_boundary_micro_task } from '../task.js';
import * as e from '../../../shared/errors.js';
import { run_all } from '../../../shared/utils.js';
const ASYNC_INCREMENT = Symbol();
const ASYNC_DECREMENT = Symbol();
const ADD_CALLBACK = Symbol();
const ADD_RENDER_EFFECT = Symbol();
const ADD_EFFECT = Symbol();
const RELEASE = Symbol();
const COMMIT = Symbol();
/**
* @param {Effect} boundary
@ -219,7 +218,7 @@ export function boundary(node, props, children) {
return;
}
if (input === RELEASE) {
if (input === COMMIT) {
unsuspend();
return;
}
@ -445,7 +444,7 @@ export function add_boundary_effect(boundary, effect) {
/**
* @param {Effect} boundary
*/
export function release_boundary(boundary) {
export function commit_boundary(boundary) {
// @ts-ignore
boundary.fn?.(RELEASE);
boundary.fn?.(COMMIT);
}

@ -52,7 +52,7 @@ import {
set_component_context,
set_dev_current_component_function
} from './context.js';
import { add_boundary_effect, release_boundary } from './dom/blocks/boundary.js';
import { add_boundary_effect, commit_boundary } from './dom/blocks/boundary.js';
const FLUSH_MICROTASK = 0;
const FLUSH_SYNC = 1;
@ -825,7 +825,7 @@ function process_effects(effect, collected_effects, boundary) {
// Inside a boundary, defer everything except block/branch effects
var defer =
boundary !== undefined &&
(flags & BRANCH_EFFECT) === 0 &&
!is_branch &&
((flags & BLOCK_EFFECT) === 0 || (flags & TEMPLATE_EFFECT) !== 0);
if (defer) {
@ -835,12 +835,10 @@ function process_effects(effect, collected_effects, boundary) {
if ((current_effect.f & BOUNDARY_SUSPENDED) === 0) {
// no more async work to happen
release_boundary(current_effect);
commit_boundary(current_effect);
}
} else if ((flags & RENDER_EFFECT) !== 0) {
if ((flags & BOUNDARY_EFFECT) !== 0) {
// TODO do we need to do anything here?
} else if (is_branch) {
if (is_branch) {
current_effect.f ^= CLEAN;
} else {
// Ensure we set the effect to be the active reaction

Loading…
Cancel
Save