@@ -323,10 +323,12 @@ describe('shared-serialization', () => {
323
323
expect ( await dump ( inlinedQrl ( ( ) => myVar + other , 'dump_qrl' , [ myVar , other ] ) ) )
324
324
. toMatchInlineSnapshot ( `
325
325
"
326
- 0 QRL "mock-chunk#dump_qrl[ 1 2] "
326
+ 0 QRL "3 4 1 2"
327
327
1 {number} 123
328
328
2 {string} "hello"
329
- (47 chars)"
329
+ 3 {string} "mock-chunk"
330
+ 4 {string} "dump_qrl"
331
+ (58 chars)"
330
332
` ) ;
331
333
} ) ;
332
334
it ( title ( TypeIds . Task ) , async ( ) => {
@@ -344,7 +346,7 @@ describe('shared-serialization', () => {
344
346
) . toMatchInlineSnapshot ( `
345
347
"
346
348
0 Task [
347
- QRL "mock-chunk#task_qrl[1] "
349
+ QRL "2 3 1 "
348
350
{number} 0
349
351
{number} 0
350
352
RootRef 1
@@ -355,11 +357,13 @@ describe('shared-serialization', () => {
355
357
]
356
358
]
357
359
1 Object [
358
- RootRef 2
360
+ RootRef 4
359
361
{number} 1
360
362
]
361
- 2 RootRef "0 5 0"
362
- (91 chars)"
363
+ 2 {string} "mock-chunk"
364
+ 3 {string} "task_qrl"
365
+ 4 RootRef "0 5 0"
366
+ (102 chars)"
363
367
` ) ;
364
368
} ) ;
365
369
it ( title ( TypeIds . Resource ) , async ( ) => {
@@ -388,9 +392,11 @@ describe('shared-serialization', () => {
388
392
`
389
393
"
390
394
0 Component [
391
- QRL "mock-chunk#dump_component "
395
+ QRL "1 2 "
392
396
]
393
- (37 chars)"
397
+ 1 {string} "mock-chunk"
398
+ 2 {string} "dump_component"
399
+ (49 chars)"
394
400
`
395
401
) ;
396
402
} ) ;
@@ -484,14 +490,19 @@ describe('shared-serialization', () => {
484
490
Constant null
485
491
{number} 2
486
492
]
487
- 4 PreloadQRL "mock-chunk#dirty[8] "
488
- 5 PreloadQRL "mock-chunk#clean[8] "
489
- 6 PreloadQRL "mock-chunk#never[8] "
490
- 7 PreloadQRL "mock-chunk#always[8] "
493
+ 4 PreloadQRL "9 10 8 "
494
+ 5 PreloadQRL "9 11 8 "
495
+ 6 PreloadQRL "9 12 8 "
496
+ 7 PreloadQRL "9 13 8 "
491
497
8 Signal [
492
498
{number} 1
493
499
]
494
- (171 chars)"
500
+ 9 {string} "mock-chunk"
501
+ 10 {string} "dirty"
502
+ 11 {string} "clean"
503
+ 12 {string} "never"
504
+ 13 {string} "always"
505
+ (174 chars)"
495
506
` ) ;
496
507
} ) ;
497
508
it ( title ( TypeIds . SerializerSignal ) , async ( ) => {
@@ -514,16 +525,18 @@ describe('shared-serialization', () => {
514
525
expect ( _dumpState ( objs ) ) . toMatchInlineSnapshot ( `
515
526
"
516
527
0 ForwardRef 0
517
- 1 PreloadQRL "mock-chunk#custom_createSerializer_qrl "
528
+ 1 PreloadQRL "3 4 "
518
529
2 SerializerSignal [
519
530
RootRef 1
520
531
Constant null
521
532
{number} 4
522
533
]
523
- 3 ForwardRefs [
534
+ 3 {string} "mock-chunk"
535
+ 4 {string} "custom_createSerializer_qrl"
536
+ 5 ForwardRefs [
524
537
2
525
538
]
526
- (73 chars)"
539
+ (85 chars)"
527
540
` ) ;
528
541
} ) ;
529
542
it ( title ( TypeIds . AsyncComputedSignal ) , async ( ) => {
@@ -608,14 +621,19 @@ describe('shared-serialization', () => {
608
621
Constant null
609
622
{number} 2
610
623
]
611
- 4 PreloadQRL "mock-chunk#dirty[8] "
612
- 5 PreloadQRL "mock-chunk#clean[8] "
613
- 6 PreloadQRL "mock-chunk#never[8] "
614
- 7 PreloadQRL "mock-chunk#always[8] "
624
+ 4 PreloadQRL "9 10 8 "
625
+ 5 PreloadQRL "9 11 8 "
626
+ 6 PreloadQRL "9 12 8 "
627
+ 7 PreloadQRL "9 13 8 "
615
628
8 Signal [
616
629
{number} 1
617
630
]
618
- (231 chars)"
631
+ 9 {string} "mock-chunk"
632
+ 10 {string} "dirty"
633
+ 11 {string} "clean"
634
+ 12 {string} "never"
635
+ 13 {string} "always"
636
+ (234 chars)"
619
637
` ) ;
620
638
} ) ;
621
639
it ( title ( TypeIds . Store ) , async ( ) => {
@@ -950,12 +968,14 @@ describe('shared-serialization', () => {
950
968
const objs = await serialize ( qrl1 , [ qrl2 ] ) ;
951
969
expect ( _dumpState ( objs ) ) . toMatchInlineSnapshot ( `
952
970
"
953
- 0 QRL "mock-chunk#dump_qrl[2] "
971
+ 0 QRL "3 4 2 "
954
972
1 Array [
955
973
RootRef 0
956
974
]
957
975
2 Object []
958
- (42 chars)"
976
+ 3 {string} "mock-chunk"
977
+ 4 {string} "dump_qrl"
978
+ (53 chars)"
959
979
` ) ;
960
980
} ) ;
961
981
it ( 'should dedupe identical root qrls' , async ( ) => {
@@ -967,10 +987,12 @@ describe('shared-serialization', () => {
967
987
const objs = await serialize ( qrl1 , qrl2 ) ;
968
988
expect ( _dumpState ( objs ) ) . toMatchInlineSnapshot ( `
969
989
"
970
- 0 QRL "mock-chunk#dump_qrl[2] "
990
+ 0 QRL "3 4 2 "
971
991
1 RootRef 0
972
992
2 Object []
973
- (38 chars)"
993
+ 3 {string} "mock-chunk"
994
+ 4 {string} "dump_qrl"
995
+ (49 chars)"
974
996
` ) ;
975
997
} ) ;
976
998
} ) ;
@@ -1014,15 +1036,17 @@ describe('shared-serialization', () => {
1014
1036
{string} "child"
1015
1037
ForwardRef 0
1016
1038
]
1017
- 1 QRL "mock-chunk#dump_qrl[2] "
1039
+ 1 QRL "3 4 2 "
1018
1040
2 Object [
1019
1041
{string} "should"
1020
1042
{string} "serialize"
1021
1043
]
1022
- 3 ForwardRefs [
1044
+ 3 {string} "mock-chunk"
1045
+ 4 {string} "dump_qrl"
1046
+ 5 ForwardRefs [
1023
1047
2
1024
1048
]
1025
- (83 chars)"
1049
+ (94 chars)"
1026
1050
` ) ;
1027
1051
} ) ;
1028
1052
it ( 'should serialize object after qrl' , async ( ) => {
@@ -1037,7 +1061,7 @@ describe('shared-serialization', () => {
1037
1061
const qrl = inlinedQrl ( ( ) => parent . child . should , 'dump_qrl' , [ parent . child ] ) ;
1038
1062
expect ( await dump ( qrl , parent ) ) . toMatchInlineSnapshot ( `
1039
1063
"
1040
- 0 QRL "mock-chunk#dump_qrl[2] "
1064
+ 0 QRL "3 4 2 "
1041
1065
1 Object [
1042
1066
{string} "child"
1043
1067
ForwardRef 0
@@ -1046,10 +1070,12 @@ describe('shared-serialization', () => {
1046
1070
{string} "should"
1047
1071
{string} "serialize"
1048
1072
]
1049
- 3 ForwardRefs [
1073
+ 3 {string} "mock-chunk"
1074
+ 4 {string} "dump_qrl"
1075
+ 5 ForwardRefs [
1050
1076
2
1051
1077
]
1052
- (83 chars)"
1078
+ (94 chars)"
1053
1079
` ) ;
1054
1080
} ) ;
1055
1081
} ) ;
@@ -1158,9 +1184,11 @@ describe('shared-serialization', () => {
1158
1184
{number} 1
1159
1185
]
1160
1186
]
1161
- 1 QRL "mock-chunk#foo[2] "
1187
+ 1 QRL "3 4 2 "
1162
1188
2 RootRef "0 0"
1163
- (55 chars)"
1189
+ 3 {string} "mock-chunk"
1190
+ 4 {string} "foo"
1191
+ (66 chars)"
1164
1192
` ) ;
1165
1193
// make sure shared1 is only serialized once
1166
1194
expect ( [ objs [ 4 ] , objs [ 5 ] ] ) . toEqual ( [ TypeIds . RootRef , '0 0' ] ) ;
0 commit comments