@@ -40,6 +40,120 @@ exports[`components and computed simple component and computed value 1`] = `
4040} "
4141` ;
4242
43+ exports [` reactive cleanup on component destruction benchmark-like scenario: signal.Array rows with computed isSelected 1` ] = `
44+ "function anonymous(app, bdom, helpers
45+ ) {
46+ let { text , createBlock , list , multi , html , toggler , comment } = bdom ;
47+ let { prepareList , createComponent , withKey } = helpers ;
48+ const comp1 = createComponent (app , \` TableRow\` , true, false, false, ["row","selected"]);
49+
50+ let block1 = createBlock(\` <table ><tbody ><block-child-0 /></tbody ></table >\` );
51+
52+ return function template(ctx, node, key = "") {
53+ const ctx1 = ctx ;
54+ const [k_block2 , v_block2 , l_block2 , c_block2 ] = prepareList (ctx [' this' ].rows ());;
55+ for (let i1 = 0 ; i1 < l_block2 ; i1 ++ ) {
56+ let ctx = Object.create(ctx1 );
57+ ctx[\`row\`] = k_block2[i1];
58+ const key1 = ctx['row'].id;
59+ c_block2[i1] = withKey(comp1 ({row : ctx ['row '],selected : ctx ['this '].selectedId }, key + \`__1__ \$ {key1 }\`, node , this , null ), key1);
60+ }
61+ const b2 = list (c_block2 );
62+ return block1 ([], [b2 ]);
63+ }
64+ }"
65+ ` ;
66+
67+ exports [` reactive cleanup on component destruction benchmark-like scenario: signal.Array rows with computed isSelected 2` ] = `
68+ "function anonymous(app, bdom, helpers
69+ ) {
70+ let { text , createBlock , list , multi , html , toggler , comment } = bdom ;
71+ let { safeOutput } = helpers ;
72+
73+ let block1 = createBlock (\` <tr block-attribute-0 = " class" ><td ><block-child-0 /></td ><td ><a ><block-child-1 /></a ></td ></tr >\` );
74+
75+ return function template(ctx, node, key = "") {
76+ let attr1 = ctx [' this' ].isSelected ()? ' danger' : ' ' ;
77+ const b2 = safeOutput (ctx [' this' ].p .row .id );
78+ const b3 = safeOutput (ctx [' this' ].p .row .label ());
79+ return block1 ([attr1 ], [b2 , b3 ]);
80+ }
81+ }"
82+ ` ;
83+
84+ exports [` reactive cleanup on component destruction destroying a component with computed cleans up signal observers 1` ] = `
85+ "function anonymous(app, bdom, helpers
86+ ) {
87+ let { text , createBlock , list , multi , html , toggler , comment } = bdom ;
88+ let { createComponent } = helpers ;
89+ const comp1 = createComponent (app , \` Child\` , true, false, false, ["selected"]);
90+
91+ let block1 = createBlock(\` <div ><block-child-0 /></div >\` );
92+
93+ return function template(ctx, node, key = "") {
94+ let b2 ;
95+ if (ctx [' this' ].show ()) {
96+ b2 = comp1({selected : ctx ['this '].selectedId }, key + \`__1 \`, node , this , null );
97+ }
98+ return block1 ([], [b2 ]);
99+ }
100+ }"
101+ ` ;
102+
103+ exports [` reactive cleanup on component destruction destroying a component with computed cleans up signal observers 2` ] = `
104+ "function anonymous(app, bdom, helpers
105+ ) {
106+ let { text , createBlock , list , multi , html , toggler , comment } = bdom ;
107+ let { safeOutput } = helpers ;
108+
109+ let block1 = createBlock (\` <span ><block-child-0 /></span >\` );
110+
111+ return function template(ctx, node, key = "") {
112+ const b2 = safeOutput (ctx [' this' ].isSelected ());
113+ return block1 ([], [b2 ]);
114+ }
115+ }"
116+ ` ;
117+
118+ exports [` reactive cleanup on component destruction destroying multiple children with computeds cleans up all signal observers 1` ] = `
119+ "function anonymous(app, bdom, helpers
120+ ) {
121+ let { text , createBlock , list , multi , html , toggler , comment } = bdom ;
122+ let { prepareList , createComponent , withKey } = helpers ;
123+ const comp1 = createComponent (app , \` Row\` , true, false, false, ["id","selected"]);
124+
125+ let block1 = createBlock(\` <div ><block-child-0 /></div >\` );
126+
127+ return function template(ctx, node, key = "") {
128+ const ctx1 = ctx ;
129+ const [k_block2 , v_block2 , l_block2 , c_block2 ] = prepareList (ctx [' this' ].rows ());;
130+ for (let i1 = 0 ; i1 < l_block2 ; i1 ++ ) {
131+ let ctx = Object.create(ctx1 );
132+ ctx[\`row\`] = k_block2[i1];
133+ const key1 = ctx['row'];
134+ c_block2[i1] = withKey(comp1 ({id : ctx ['row '],selected : ctx ['this '].selectedId }, key + \`__1__ \$ {key1 }\`, node , this , null ), key1);
135+ }
136+ const b2 = list (c_block2 );
137+ return block1 ([], [b2 ]);
138+ }
139+ }"
140+ ` ;
141+
142+ exports [` reactive cleanup on component destruction destroying multiple children with computeds cleans up all signal observers 2` ] = `
143+ "function anonymous(app, bdom, helpers
144+ ) {
145+ let { text , createBlock , list , multi , html , toggler , comment } = bdom ;
146+ let { safeOutput } = helpers ;
147+
148+ let block1 = createBlock (\` <span ><block-child-0 /></span >\` );
149+
150+ return function template(ctx, node, key = "") {
151+ const b2 = safeOutput (ctx [' this' ].isSelected ());
152+ return block1 ([], [b2 ]);
153+ }
154+ }"
155+ ` ;
156+
43157exports [` reactivity in lifecycle Child component doesn't render when state they depend on changes but their parent is about to unmount them 1` ] = `
44158"function anonymous(app, bdom, helpers
45159) {
0 commit comments