@@ -232,18 +232,6 @@ export function client_component(source, analysis, options) {
232232 group_binding_declarations . push ( b . const ( group . name , b . array ( [ ] ) ) ) ;
233233 }
234234
235- // Bind static exports to props so that people can access them with bind:x
236- const static_bindings = analysis . exports . map ( ( { name, alias } ) => {
237- return b . stmt (
238- b . call (
239- '$.bind_prop' ,
240- b . id ( '$$props' ) ,
241- b . literal ( alias ?? name ) ,
242- serialize_get_binding ( b . id ( name ) , instance_state )
243- )
244- ) ;
245- } ) ;
246-
247235 const component_returned_object = analysis . exports . map ( ( { name, alias } ) => {
248236 const expression = serialize_get_binding ( b . id ( name ) , instance_state ) ;
249237
@@ -369,10 +357,25 @@ export function client_component(source, analysis, options) {
369357 ...group_binding_declarations ,
370358 .../** @type {import('estree').Statement[] } */ ( instance . body ) ,
371359 analysis . runes ? b . empty : b . stmt ( b . call ( '$.init' ) ) ,
372- .../** @type {import('estree').Statement[] } */ ( template . body ) ,
373- ...static_bindings
360+ .../** @type {import('estree').Statement[] } */ ( template . body )
374361 ] ) ;
375362
363+ if ( ! analysis . runes ) {
364+ // Bind static exports to props so that people can access them with bind:x
365+ for ( const { name, alias } of analysis . exports ) {
366+ component_block . body . push (
367+ b . stmt (
368+ b . call (
369+ '$.bind_prop' ,
370+ b . id ( '$$props' ) ,
371+ b . literal ( alias ?? name ) ,
372+ serialize_get_binding ( b . id ( name ) , instance_state )
373+ )
374+ )
375+ ) ;
376+ }
377+ }
378+
376379 const append_styles =
377380 analysis . inject_styles && analysis . css . ast
378381 ? ( ) =>
0 commit comments