@@ -56,7 +56,7 @@ import { isElement, isNode } from './utils/element';
56
56
import { EMPTY_ARRAY , EMPTY_OBJ } from './utils/flyweight' ;
57
57
import { ELEMENT_ID } from './utils/markers' ;
58
58
import { isPromise } from './utils/promises' ;
59
- import { SerializerSymbol , fastSkipSerialize , fastWeakSerialize } from './utils/serialize-utils' ;
59
+ import { SerializerSymbol , fastSkipSerialize } from './utils/serialize-utils' ;
60
60
import { type ValueOrPromise } from './utils/types' ;
61
61
62
62
const deserializedProxyMap = new WeakMap < object , unknown [ ] > ( ) ;
@@ -400,16 +400,6 @@ const inflate = (
400
400
effectData . data . $isConst$ = ( data as any [ ] ) [ 1 ] ;
401
401
break ;
402
402
}
403
- case TypeIds . WeakObject : {
404
- const objectKeys = data as string [ ] ;
405
- target = Object . fromEntries (
406
- objectKeys . map ( ( v ) =>
407
- // initialize values with null
408
- [ v , _UNINITIALIZED ]
409
- )
410
- ) ;
411
- break ;
412
- }
413
403
default :
414
404
throw qError ( QError . serializeErrorNotImplemented , [ typeId ] ) ;
415
405
}
@@ -472,7 +462,6 @@ const allocate = (container: DeserializeContainer, typeId: number, value: unknow
472
462
case TypeIds . Array :
473
463
return wrapDeserializerProxy ( container as any , value as any [ ] ) ;
474
464
case TypeIds . Object :
475
- case TypeIds . WeakObject :
476
465
return { } ;
477
466
case TypeIds . QRL :
478
467
const qrl = container . $getObjectById$ ( value as number ) ;
@@ -827,20 +816,15 @@ export const createSerializationContext = (
827
816
vnode_isVNode ( obj ) ||
828
817
( typeof FormData !== 'undefined' && obj instanceof FormData ) ||
829
818
// Ignore the no serialize objects
830
- fastSkipSerialize ( obj as object ) ||
831
- // only keys will be serialized
832
- fastWeakSerialize ( obj )
819
+ fastSkipSerialize ( obj as object )
833
820
) {
834
821
// ignore
835
822
} else if ( obj instanceof Error ) {
836
823
discoveredValues . push ( ...Object . values ( obj ) ) ;
837
824
} else if ( isStore ( obj ) ) {
838
825
const target = getStoreTarget ( obj ) ! ;
839
826
const effects = getStoreHandler ( obj ) ! . $effects$ ;
840
- if ( ! fastWeakSerialize ( target ) ) {
841
- discoveredValues . push ( target ) ;
842
- }
843
- discoveredValues . push ( effects ) ;
827
+ discoveredValues . push ( target , effects ) ;
844
828
845
829
for ( const prop in target ) {
846
830
const propValue = ( target as any ) [ prop ] ;
@@ -936,8 +920,6 @@ export const createSerializationContext = (
936
920
}
937
921
) ;
938
922
promises . push ( obj ) ;
939
- } else if ( obj instanceof SubscriptionData ) {
940
- discoveredValues . push ( obj . data ) ;
941
923
} else if ( Array . isArray ( obj ) ) {
942
924
discoveredValues . push ( ...obj ) ;
943
925
} else if ( isSerializerObj ( obj ) ) {
@@ -1225,8 +1207,6 @@ function serialize(serializationContext: SerializationContext): void {
1225
1207
} else if ( isObjectLiteral ( value ) ) {
1226
1208
if ( Array . isArray ( value ) ) {
1227
1209
output ( TypeIds . Array , value ) ;
1228
- } else if ( fastWeakSerialize ( value ) ) {
1229
- output ( TypeIds . WeakObject , Object . keys ( value ) ) ;
1230
1210
} else {
1231
1211
const out : any [ ] = [ ] ;
1232
1212
for ( const key in value ) {
@@ -1744,7 +1724,6 @@ export const enum TypeIds {
1744
1724
JSXNode ,
1745
1725
PropsProxy ,
1746
1726
SubscriptionData ,
1747
- WeakObject ,
1748
1727
}
1749
1728
export const _typeIdNames = [
1750
1729
'RootRef' ,
@@ -1779,7 +1758,6 @@ export const _typeIdNames = [
1779
1758
'JSXNode' ,
1780
1759
'PropsProxy' ,
1781
1760
'SubscriptionData' ,
1782
- 'WeakObject' ,
1783
1761
] ;
1784
1762
1785
1763
export const enum Constants {
0 commit comments