@@ -138,11 +138,27 @@ export default class InlineComponentWrapper extends Wrapper {
138
138
const statements : Array < Node | Node [ ] > = [ ] ;
139
139
const updates : Array < Node | Node [ ] > = [ ] ;
140
140
141
+ if ( this . fragment ) {
142
+ this . renderer . add_to_context ( '$$scope' , true ) ;
143
+ const default_slot = this . slots . get ( 'default' ) ;
144
+
145
+ this . fragment . nodes . forEach ( ( child ) => {
146
+ child . render ( default_slot . block , null , x `#nodes` as unknown as Identifier ) ;
147
+ } ) ;
148
+ }
149
+
141
150
let props ;
142
151
const name_changes = block . get_unique_name ( `${ name . name } _changes` ) ;
143
152
144
153
const uses_spread = ! ! this . node . attributes . find ( a => a . is_spread ) ;
145
154
155
+ // removing empty slot
156
+ for ( const slot of this . slots . keys ( ) ) {
157
+ if ( ! this . slots . get ( slot ) . block . has_content ( ) ) {
158
+ this . slots . delete ( slot ) ;
159
+ }
160
+ }
161
+
146
162
const initial_props = this . slots . size > 0
147
163
? [
148
164
p `$$slots: {
@@ -172,15 +188,6 @@ export default class InlineComponentWrapper extends Wrapper {
172
188
}
173
189
}
174
190
175
- if ( this . fragment ) {
176
- this . renderer . add_to_context ( '$$scope' , true ) ;
177
- const default_slot = this . slots . get ( 'default' ) ;
178
-
179
- this . fragment . nodes . forEach ( ( child ) => {
180
- child . render ( default_slot . block , null , x `#nodes` as unknown as Identifier ) ;
181
- } ) ;
182
- }
183
-
184
191
if ( component . compile_options . dev ) {
185
192
// TODO this is a terrible hack, but without it the component
186
193
// will complain that options.target is missing. This would
0 commit comments