pull/12335/head
Rich Harris 2 years ago
parent 7be9add41f
commit ce14d0634f

@ -1,3 +1,4 @@
/** @import { Effect, Source, TemplateNode } from '#client' */
import { is_promise, noop } from '../../../shared/utils.js';
import {
current_component_context,
@ -11,7 +12,7 @@ import {
import { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';
import { DEV } from 'esm-env';
import { queue_micro_task } from '../task.js';
import { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from '../hydration.js';
import { hydrate_next, hydrate_node, hydrating } from '../hydration.js';
import { mutable_source, set, source } from '../../reactivity/sources.js';
const PENDING = 0;
@ -20,10 +21,10 @@ const CATCH = 2;
/**
* @template V
* @param {Comment} anchor
* @param {TemplateNode} anchor
* @param {(() => Promise<V>)} get_input
* @param {null | ((anchor: Node) => void)} pending_fn
* @param {null | ((anchor: Node, value: import('#client').Source<V>) => void)} then_fn
* @param {null | ((anchor: Node, value: Source<V>) => void)} then_fn
* @param {null | ((anchor: Node, error: unknown) => void)} catch_fn
* @returns {void}
*/
@ -41,13 +42,13 @@ export function await_block(anchor, get_input, pending_fn, then_fn, catch_fn) {
/** @type {V | Promise<V>} */
var input;
/** @type {import('#client').Effect | null} */
/** @type {Effect | null} */
var pending_effect;
/** @type {import('#client').Effect | null} */
/** @type {Effect | null} */
var then_effect;
/** @type {import('#client').Effect | null} */
/** @type {Effect | null} */
var catch_effect;
var input_source = runes

@ -1,3 +1,4 @@
/** @import { TemplateNode } from '#client' */
import { render_effect, teardown } from '../../reactivity/effects.js';
import { hydrating, set_hydrate_node } from '../hydration.js';
@ -8,7 +9,7 @@ import { hydrating, set_hydrate_node } from '../hydration.js';
*/
export function css_props(element, get_styles) {
if (hydrating) {
set_hydrate_node(element.firstChild);
set_hydrate_node(/** @type {TemplateNode} */ (element.firstChild));
}
render_effect(() => {
@ -28,8 +29,4 @@ export function css_props(element, get_styles) {
teardown(() => {
element.remove();
});
// if (hydrating) {
// set_hydrate_node(element);
// }
}

@ -8,7 +8,7 @@ import { queue_micro_task } from './task.js';
/**
* @param {TemplateNode} start
* @param {TemplateNode} end
* @param {TemplateNode | null} end
*/
export function assign_nodes(start, end) {
/** @type {Effect} */ (current_effect).nodes ??= { start, end };

@ -36,7 +36,7 @@ export interface Derived<V = unknown> extends Value<V>, Reaction {
export interface EffectNodes {
start: TemplateNode;
end: TemplateNode;
end: null | TemplateNode;
}
export interface Effect extends Reaction {

Loading…
Cancel
Save