8080 * declaration order within component.
8181 */
8282
83+ import { ChoreArray , choreComparator } from '../client/chore-array' ;
8384import { type DomContainer } from '../client/dom-container' ;
8485import { VNodeFlags , type ClientContainer } from '../client/types' ;
8586import { VNodeJournalOpCode , vnode_isVNode } from '../client/vnode' ;
86- import { vnode_diff } from '../client/vnode-diff' ;
87+ import { vnode_diff , type VNodeJournalRef } from '../client/vnode-diff' ;
88+ import type { ElementVNode , VirtualVNode } from '../client/vnode-impl' ;
89+ import { AsyncComputedSignalImpl } from '../reactive-primitives/impl/async-computed-signal-impl' ;
8790import { ComputedSignalImpl } from '../reactive-primitives/impl/computed-signal-impl' ;
8891import { WrappedSignalImpl } from '../reactive-primitives/impl/wrapped-signal-impl' ;
8992import { isSignal , type Signal } from '../reactive-primitives/signal.public' ;
93+ import { isSsrNode } from '../reactive-primitives/subscriber' ;
9094import type { NodePropPayload } from '../reactive-primitives/subscription-data' ;
9195import {
9296 SignalFlags ,
@@ -97,6 +101,7 @@ import {
97101} from '../reactive-primitives/types' ;
98102import { scheduleEffects } from '../reactive-primitives/utils' ;
99103import { type ISsrNode , type SSRContainer } from '../ssr/ssr-types' ;
104+ import { invoke , newInvokeContext } from '../use/use-core' ;
100105import { runResource , type ResourceDescriptor } from '../use/use-resource' ;
101106import {
102107 Task ,
@@ -110,23 +115,18 @@ import { executeComponent } from './component-execution';
110115import type { OnRenderFn } from './component.public' ;
111116import type { Props } from './jsx/jsx-runtime' ;
112117import type { JSXOutput } from './jsx/types/jsx-node' ;
118+ import { createNextTick } from './platform/next-tick' ;
113119import { isServerPlatform } from './platform/platform' ;
114120import { type QRLInternal } from './qrl/qrl-class' ;
121+ import { findBlockingChore , findBlockingChoreForVisible } from './scheduler-rules' ;
115122import { SsrNodeFlags , type Container , type HostElement } from './types' ;
116123import { ChoreType } from './util-chore-type' ;
124+ import { logWarn } from './utils/log' ;
117125import { QScopedStyle } from './utils/markers' ;
118126import { isPromise , maybeThen , retryOnPromise , safeCall } from './utils/promises' ;
119127import { addComponentStylePrefix } from './utils/scoped-styles' ;
120128import { serializeAttribute } from './utils/styles' ;
121129import { type ValueOrPromise } from './utils/types' ;
122- import { invoke , newInvokeContext } from '../use/use-core' ;
123- import { findBlockingChore , findBlockingChoreForVisible } from './scheduler-rules' ;
124- import { createNextTick } from './platform/next-tick' ;
125- import { AsyncComputedSignalImpl } from '../reactive-primitives/impl/async-computed-signal-impl' ;
126- import { isSsrNode } from '../reactive-primitives/subscriber' ;
127- import { logWarn } from './utils/log' ;
128- import type { ElementVNode , VirtualVNode } from '../client/vnode-impl' ;
129- import { ChoreArray , choreComparator } from '../client/chore-array' ;
130130
131131// Turn this on to get debug output of what the scheduler is doing.
132132const DEBUG : boolean = false ;
@@ -161,6 +161,7 @@ export interface Chore<T extends ChoreType = ChoreType> {
161161 $resolve$ : ( ( value : any ) => void ) | undefined ;
162162 $reject$ : ( ( reason ?: any ) => void ) | undefined ;
163163 $returnValue$ : ValueOrPromise < ChoreReturnValue < T > > ;
164+ $extra$ ?: unknown ;
164165}
165166
166167export type Scheduler = ReturnType < typeof createScheduler > ;
@@ -243,7 +244,8 @@ export const createScheduler = (
243244 type : ChoreType . COMPONENT ,
244245 host : HostElement ,
245246 qrl : QRLInternal < OnRenderFn < unknown > > ,
246- props : Props | null
247+ props : Props | null ,
248+ journalRef ?: VNodeJournalRef
247249 ) : Chore < ChoreType . COMPONENT > ;
248250 function schedule (
249251 type : ChoreType . NODE_DIFF ,
@@ -263,7 +265,8 @@ export const createScheduler = (
263265 type : T ,
264266 hostOrTask : HostElement | Task | null = null ,
265267 targetOrQrl : ChoreTarget | string | null = null ,
266- payload : any = null
268+ payload : unknown = null ,
269+ extra ?: unknown
267270 ) : Chore < T > | null {
268271 if ( type === ChoreType . WAIT_FOR_QUEUE && drainChore ) {
269272 return drainChore as Chore < T > ;
@@ -293,6 +296,9 @@ export const createScheduler = (
293296 $reject$ : undefined ,
294297 $returnValue$ : null ! ,
295298 } ;
299+ if ( extra !== undefined ) {
300+ ( chore as any ) . $extra$ = extra ;
301+ }
296302
297303 if ( type === ChoreType . WAIT_FOR_QUEUE ) {
298304 getChorePromise ( chore ) ;
@@ -659,7 +665,8 @@ This is often caused by modifying a signal in an already rendered component duri
659665 container as ClientContainer ,
660666 jsx ,
661667 host as VirtualVNode ,
662- addComponentStylePrefix ( styleScopedId )
668+ addComponentStylePrefix ( styleScopedId ) ,
669+ ( chore as any ) . $extra$
663670 )
664671 ) ;
665672 }
0 commit comments