@@ -66,6 +66,15 @@ import { WrappedSignalImpl } from '../reactive-primitives/impl/wrapped-signal-im
66
66
import { SerializerSignalImpl } from '../reactive-primitives/impl/serializer-signal-impl' ;
67
67
import { AsyncComputedSignalImpl } from '../reactive-primitives/impl/async-computed-signal-impl' ;
68
68
import { isObject } from './utils/types' ;
69
+ import { qwikDebugToString } from '../debug' ;
70
+
71
+ const DEBUG = true ;
72
+
73
+ const log = ( ...args : any [ ] ) =>
74
+ console . warn (
75
+ 'SERIALIZATION' ,
76
+ ...args . map ( ( arg ) => ( arg && typeof arg === 'object' ? arg : qwikDebugToString ( arg ) ) )
77
+ ) ;
69
78
70
79
/** Arrays/Objects are special-cased so their identifiers is a single digit. */
71
80
const needsInflation = ( typeId : TypeIds ) =>
@@ -181,6 +190,7 @@ export const _eagerDeserializeArray = (
181
190
for ( let i = 0 ; i < data . length ; i += 2 ) {
182
191
out [ i / 2 ] = deserializeData ( container , data [ i ] as TypeIds , data [ i + 1 ] ) ;
183
192
}
193
+ DEBUG && log ( 'eager deserialized array' , out ) ;
184
194
return out ;
185
195
} ;
186
196
@@ -260,13 +270,16 @@ const inflate = (
260
270
break ;
261
271
}
262
272
case TypeIds . Signal : {
273
+ console . log ( 'new signal' , data ) ;
263
274
const signal = target as SignalImpl < unknown > ;
264
275
const d = data as [ unknown , ...EffectSubscription [ ] ] ;
265
276
signal . $untrackedValue$ = d [ 0 ] ;
266
277
signal . $effects$ = new Set ( d . slice ( 1 ) as EffectSubscription [ ] ) ;
267
278
break ;
268
279
}
269
280
case TypeIds . WrappedSignal : {
281
+ console . log ( 'new wrappedsignal' , data ) ;
282
+
270
283
const signal = target as WrappedSignalImpl < unknown > ;
271
284
const d = data as [
272
285
number ,
@@ -287,6 +300,7 @@ const inflate = (
287
300
break ;
288
301
}
289
302
case TypeIds . AsyncComputedSignal : {
303
+ console . log ( 'new asynccomputedsignal' , data ) ;
290
304
const asyncComputed = target as AsyncComputedSignalImpl < unknown > ;
291
305
const d = data as [
292
306
AsyncComputeQRL < unknown > ,
@@ -314,6 +328,7 @@ const inflate = (
314
328
// Inflating a SerializerSignal is the same as inflating a ComputedSignal
315
329
case TypeIds . SerializerSignal :
316
330
case TypeIds . ComputedSignal : {
331
+ console . log ( 'new computedsignal' , data ) ;
317
332
const computed = target as ComputedSignalImpl < unknown > ;
318
333
const d = data as [ QRLInternal < ( ) => { } > , EffectSubscription [ ] | null , unknown ?] ;
319
334
computed . $computeQrl$ = d [ 0 ] ;
0 commit comments