@@ -193,22 +193,26 @@ interface ComponentWithGenerateMarkup extends LightningElementConstructor {
193
193
194
194
export class RenderContext {
195
195
styleDedupeIsEnabled : boolean ;
196
- stylesheetToId = new WeakMap < Stylesheet , string > ( ) ;
197
196
styleDedupePrefix : string ;
197
+ stylesheetToId = new WeakMap < Stylesheet , string > ( ) ;
198
198
nextId = 0 ;
199
199
200
- constructor ( styleDedupePrefix : string , styleDedupeIsEnabled : boolean ) {
201
- this . styleDedupeIsEnabled = styleDedupeIsEnabled ;
202
- this . styleDedupePrefix = styleDedupePrefix ;
200
+ constructor ( styleDedupe : string | boolean ) {
201
+ if ( styleDedupe || styleDedupe === '' ) {
202
+ this . styleDedupePrefix = styleDedupe && '' ;
203
+ this . styleDedupeIsEnabled = true ;
204
+ } else {
205
+ this . styleDedupePrefix = '' ;
206
+ this . styleDedupeIsEnabled = false ;
207
+ }
203
208
}
204
209
}
205
210
206
211
export async function serverSideRenderComponent (
207
212
tagName : string ,
208
213
Component : ComponentWithGenerateMarkup ,
209
214
props : Properties = { } ,
210
- styleDedupePrefix = '' ,
211
- styleDedupeIsEnabled = false ,
215
+ styleDedupe : string | boolean = '' ,
212
216
mode : CompilationMode = DEFAULT_SSR_MODE
213
217
) : Promise < string > {
214
218
if ( typeof tagName !== 'string' ) {
@@ -222,7 +226,7 @@ export async function serverSideRenderComponent(
222
226
markup += segment ;
223
227
} ;
224
228
225
- emit . cxt = new RenderContext ( styleDedupePrefix , styleDedupeIsEnabled ) ;
229
+ emit . cxt = new RenderContext ( styleDedupe ) ;
226
230
227
231
if ( ! generateMarkup ) {
228
232
// If a non-component is accidentally provided, render an empty template
0 commit comments