another fix

experiment_s
Dominic Gannaway 22 hours ago
parent 278c49056d
commit ad1c214b29

@ -1,6 +1,6 @@
/** @import { Effect, TemplateNode, } from '#client' */ /** @import { Effect, TemplateNode, } from '#client' */
import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT, INERT } from '../../constants.js'; import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT } from '../../constants.js';
import { import {
block, block,
branch, branch,
@ -81,22 +81,19 @@ export function boundary(node, props, boundary_fn) {
var is_creating_fallback = false; var is_creating_fallback = false;
const render_snippet = (/** @type { () => void } */ snippet_fn) => { const render_snippet = (/** @type { () => void } */ snippet_fn) => {
// Render the snippet in a microtask with_boundary(boundary, () => {
queue_micro_task(() => { is_creating_fallback = true;
with_boundary(boundary, () => {
is_creating_fallback = true;
try { try {
boundary_effect = branch(() => { boundary_effect = branch(() => {
snippet_fn(); snippet_fn();
}); });
} catch (error) { } catch (error) {
handle_error(error, boundary, null, boundary.ctx); handle_error(error, boundary, null, boundary.ctx);
} }
reset_is_throwing_error(); reset_is_throwing_error();
is_creating_fallback = false; is_creating_fallback = false;
});
}); });
}; };
@ -203,12 +200,14 @@ export function boundary(node, props, boundary_fn) {
} }
if (failed) { if (failed) {
render_snippet(() => { queue_micro_task(() => {
failed( render_snippet(() => {
anchor, failed(
() => error, anchor,
() => reset () => error,
); () => reset
);
});
}); });
} }
}; };

Loading…
Cancel
Save