@@ -106,7 +106,7 @@ function serialize_style_directives(style_directives, element_id, context, is_at
106
106
if ( ! is_attributes_reactive && contains_call_expression ) {
107
107
state . init . push ( singular ) ;
108
108
} else if ( is_attributes_reactive || directive . metadata . dynamic || contains_call_expression ) {
109
- state . update . push ( { grouped } ) ;
109
+ state . update . push ( grouped ) ;
110
110
} else {
111
111
state . init . push ( grouped ) ;
112
112
}
@@ -155,7 +155,7 @@ function serialize_class_directives(class_directives, element_id, context, is_at
155
155
if ( ! is_attributes_reactive && contains_call_expression ) {
156
156
state . init . push ( singular ) ;
157
157
} else if ( is_attributes_reactive || directive . metadata . dynamic || contains_call_expression ) {
158
- state . update . push ( { grouped } ) ;
158
+ state . update . push ( grouped ) ;
159
159
} else {
160
160
state . init . push ( grouped ) ;
161
161
}
@@ -333,17 +333,15 @@ function serialize_element_spread_attributes(
333
333
context . state . init . push ( standalone ) ;
334
334
}
335
335
} else {
336
- context . state . update . push ( {
337
- grouped : inside_effect
338
- } ) ;
336
+ context . state . update . push ( inside_effect ) ;
339
337
}
340
338
341
339
if ( needs_select_handling ) {
342
340
context . state . init . push (
343
341
b . stmt ( b . call ( '$.init_select' , element_id , b . thunk ( b . member ( b . id ( id ) , b . id ( 'value' ) ) ) ) )
344
342
) ;
345
- context . state . update . push ( {
346
- grouped : b . if (
343
+ context . state . update . push (
344
+ b . if (
347
345
b . binary ( 'in' , b . literal ( 'value' ) , b . id ( id ) ) ,
348
346
b . block ( [
349
347
// This ensures a one-way street to the DOM in case it's <select {value}>
@@ -353,7 +351,7 @@ function serialize_element_spread_attributes(
353
351
b . stmt ( b . call ( '$.select_option' , element_id , b . member ( b . id ( id ) , b . id ( 'value' ) ) ) )
354
352
] )
355
353
)
356
- } ) ;
354
+ ) ;
357
355
}
358
356
}
359
357
@@ -412,8 +410,8 @@ function serialize_dynamic_element_attributes(attributes, context, element_id) {
412
410
} else if ( is_reactive ) {
413
411
const id = context . state . scope . generate ( 'spread_attributes' ) ;
414
412
context . state . init . push ( b . let ( id ) ) ;
415
- context . state . update . push ( {
416
- grouped : b . stmt (
413
+ context . state . update . push (
414
+ b . stmt (
417
415
b . assignment (
418
416
'=' ,
419
417
b . id ( id ) ,
@@ -426,7 +424,7 @@ function serialize_dynamic_element_attributes(attributes, context, element_id) {
426
424
)
427
425
)
428
426
)
429
- } ) ;
427
+ ) ;
430
428
return true ;
431
429
} else {
432
430
context . state . init . push (
@@ -564,7 +562,7 @@ function serialize_element_attribute_update_assignment(element, node_id, attribu
564
562
if ( contains_call_expression && singular ) {
565
563
state . init . push ( singular ) ;
566
564
} else {
567
- state . update . push ( { grouped } ) ;
565
+ state . update . push ( grouped ) ;
568
566
}
569
567
return true ;
570
568
} else {
@@ -707,26 +705,18 @@ function serialize_update_assignment(state, id, init, value, assignment, contain
707
705
} else {
708
706
if ( assignment . skip_condition ) {
709
707
if ( assignment . singular ) {
710
- state . update . push ( {
711
- grouped : assignment . grouped
712
- } ) ;
708
+ state . update . push ( assignment . grouped ) ;
713
709
} else {
714
710
state . init . push ( b . var ( id , init ) ) ;
715
- state . update . push ( {
716
- grouped
717
- } ) ;
711
+ state . update . push ( grouped ) ;
718
712
}
719
713
} else {
720
714
if ( assignment . singular ) {
721
715
state . init . push ( b . var ( id , init ) ) ;
722
- state . update . push ( {
723
- grouped
724
- } ) ;
716
+ state . update . push ( grouped ) ;
725
717
} else {
726
718
state . init . push ( b . var ( id , init ) ) ;
727
- state . update . push ( {
728
- grouped
729
- } ) ;
719
+ state . update . push ( grouped ) ;
730
720
}
731
721
}
732
722
}
@@ -1275,7 +1265,7 @@ function get_template_function(namespace, state) {
1275
1265
* @param {import('../types.js').ComponentClientTransformState } state
1276
1266
*/
1277
1267
function serialize_render_stmt ( state ) {
1278
- return b . stmt ( b . call ( '$.render_effect' , b . thunk ( b . block ( state . update . map ( ( n ) => n . grouped ) ) ) ) ) ;
1268
+ return b . stmt ( b . call ( '$.render_effect' , b . thunk ( b . block ( state . update ) ) ) ) ;
1279
1269
}
1280
1270
1281
1271
/**
@@ -1511,16 +1501,15 @@ function process_children(nodes, expression, is_element, { visit, state }) {
1511
1501
if ( node . metadata . contains_call_expression && ! within_bound_contenteditable ) {
1512
1502
state . init . push ( singular ) ;
1513
1503
} else if ( node . metadata . dynamic && ! within_bound_contenteditable ) {
1514
- state . update . push ( {
1515
- singular,
1516
- grouped : b . stmt (
1504
+ state . update . push (
1505
+ b . stmt (
1517
1506
b . call (
1518
1507
'$.text' ,
1519
1508
text_id ,
1520
1509
/** @type {import('estree').Expression } */ ( visit ( node . expression ) )
1521
1510
)
1522
1511
)
1523
- } ) ;
1512
+ ) ;
1524
1513
} else {
1525
1514
state . init . push (
1526
1515
b . stmt (
@@ -1556,10 +1545,7 @@ function process_children(nodes, expression, is_element, { visit, state }) {
1556
1545
sequence . some ( ( node ) => node . type === 'ExpressionTag' && node . metadata . dynamic ) &&
1557
1546
! within_bound_contenteditable
1558
1547
) {
1559
- state . update . push ( {
1560
- singular,
1561
- grouped : b . stmt ( b . call ( '$.text' , text_id , assignment ) )
1562
- } ) ;
1548
+ state . update . push ( b . stmt ( b . call ( '$.text' , text_id , assignment ) ) ) ;
1563
1549
} else {
1564
1550
state . init . push ( init ) ;
1565
1551
}
@@ -3120,15 +3106,15 @@ export const template_visitors = {
3120
3106
)
3121
3107
) ;
3122
3108
} else {
3123
- state . update . push ( {
3124
- grouped : b . stmt (
3109
+ state . update . push (
3110
+ b . stmt (
3125
3111
b . assignment (
3126
3112
'=' ,
3127
3113
b . member ( b . id ( '$.document' ) , b . id ( 'title' ) ) ,
3128
3114
serialize_template_literal ( /** @type {any } */ ( node . fragment . nodes ) , visit , state ) [ 1 ]
3129
3115
)
3130
3116
)
3131
- } ) ;
3117
+ ) ;
3132
3118
}
3133
3119
} ,
3134
3120
SvelteBody ( node , context ) {
0 commit comments