Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<x-outer>
<x-inner>
</x-inner>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement } from 'lwc';

export default class extends LightningElement {
static renderMode = 'light';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template lwc:render-mode="light">
<x-inner>
I am default slot
<div slot="foo">I am the foo slot</div>
</x-inner>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement } from 'lwc';

export default class extends LightningElement {
static renderMode = 'light';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<x-outer>
<template shadowrootmode="open">
<x-inner>
<template shadowrootmode="open">
</template>
I am default slot
<div slot="foo">
I am the foo slot
</div>
</x-inner>
</template>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { LightningElement } from 'lwc';

export default class extends LightningElement {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template>
<x-inner>
I am default slot
<div slot="foo">I am the foo slot</div>
</x-inner>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { LightningElement } from 'lwc';

export default class extends LightningElement {}
22 changes: 14 additions & 8 deletions packages/@lwc/ssr-runtime/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,33 @@ export function renderAttrsNoYield(
}

export function* fallbackTmpl(
_shadowSlottedContent: unknown,
_lightSlottedContent: unknown,
_scopedSlottedContent: unknown,
_shadowSlottedContent: any,
_lightSlottedContent: any,
_scopedSlottedContent: any,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BOOOO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a feeling this might upset you :p

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(sorry)

Cmp: LightningElementConstructor,
_instance: unknown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_instance: unknown
instance: unknown

) {
if (Cmp.renderMode !== 'light') {
yield '<template shadowrootmode="open"></template>';
yield `<template shadowrootmode="open"></template>`;
if (_shadowSlottedContent) {
yield _shadowSlottedContent(_instance);
}
}
}

export function fallbackTmplNoYield(
emit: (segment: string) => void,
_shadowSlottedContent: unknown,
_lightSlottedContent: unknown,
_scopedSlottedContent: unknown,
_shadowSlottedContent: any,
_lightSlottedContent: any,
_scopedSlottedContent: any,
Cmp: LightningElementConstructor,
_instance: unknown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_instance: unknown
instance: unknown

) {
if (Cmp.renderMode !== 'light') {
emit('<template shadowrootmode="open"></template>');
emit(`<template shadowrootmode="open"></template>`);
if (_shadowSlottedContent) {
_shadowSlottedContent(emit, _instance);
}
}
}

Expand Down