Skip to content

Commit 66efe27

Browse files
fix: clarified dangling slot explanation
1 parent 572884c commit 66efe27

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/@lwc/ssr-compiler/src/compile-template/transformers/component/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const bYieldFromChildGenerator = esTemplateWithYield`
2020
const childProps = ${/* child props */ is.objectExpression};
2121
const childAttrs = ${/* child attrs */ is.objectExpression};
2222
/*
23-
If a slotAttributeValue is present, it is dangling and should be assigned to any slotted content. This behavior aligns with v1 and engine-dom.
23+
If 'slotAttributeValue' is set, it references a slot that does not exist, and the 'slot' attribute should be set in the DOM. This behavior aligns with engine-server and engine-dom.
2424
See: engine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/ for example case.
2525
*/
2626
if (slotAttributeValue) {

packages/@lwc/ssr-compiler/src/compile-template/transformers/component/lwc-component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const bYieldFromDynamicComponentConstructorGenerator = esTemplateWithYield`
2626
const childProps = ${/* child props */ is.objectExpression};
2727
const childAttrs = ${/* child attrs */ is.objectExpression};
2828
/*
29-
If a slotAttributeValue is present, it is dangling and should be assigned to any slotted content. This behavior aligns with v1 and engine-dom.
29+
If 'slotAttributeValue' is set, it references a slot that does not exist, and the 'slot' attribute should be set in the DOM. This behavior aligns with engine-server and engine-dom.
3030
See: engine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/ for example case.
3131
*/
3232
if (slotAttributeValue) {

packages/@lwc/ssr-compiler/src/compile-template/transformers/element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const bConditionallyYieldScopeTokenClass = esTemplateWithYield`
121121
`<EsIfStatement>;
122122

123123
/*
124-
If a slotAttributeValue is present, it is dangling and should be assigned to any slotted content. This behavior aligns with v1 and engine-dom.
124+
If `slotAttributeValue` is set, it references a slot that does not exist, and the `slot` attribute should be set in the DOM. This behavior aligns with engine-server and engine-dom.
125125
See: engine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/ for example case.
126126
*/
127127
const bConditionallyYieldDanglingSlotName = esTemplateWithYield`

0 commit comments

Comments
 (0)