-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix forwarded dangling slots (#5164)
* fix: add dangling slot definition * fix: scoped slot case, nested cases * fix: review comments * fix: additional test * fix: clarified dangling slot explanation
- Loading branch information
1 parent
2269119
commit 7556d0c
Showing
22 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
Empty file.
16 changes: 16 additions & 0 deletions
16
...gine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling-component/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<x-dangling-container> | ||
<x-slot> | ||
<x-leaf> | ||
<!----> | ||
<x-component slot="dangling"> | ||
Component content | ||
</x-component> | ||
<!----> | ||
<!----> | ||
<x-component> | ||
Component content | ||
</x-component> | ||
<!----> | ||
</x-leaf> | ||
</x-slot> | ||
</x-dangling-container> |
4 changes: 4 additions & 0 deletions
4
...wc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling-component/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const tagName = 'x-dangling-container'; | ||
export { default } from 'x/container'; | ||
export * from 'x/container'; | ||
export const features = []; |
3 changes: 3 additions & 0 deletions
3
...ts__/fixtures/slot-forwarding/slots/dangling-component/modules/x/component/component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template lwc:render-mode="light"> | ||
Component content | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ests__/fixtures/slot-forwarding/slots/dangling-component/modules/x/component/component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
6 changes: 6 additions & 0 deletions
6
...ts__/fixtures/slot-forwarding/slots/dangling-component/modules/x/container/container.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template lwc:render-mode="light"> | ||
<x-slot> | ||
<x-component slot="top"></x-component> | ||
<x-component slot="bottom"></x-component> | ||
</x-slot> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ests__/fixtures/slot-forwarding/slots/dangling-component/modules/x/container/container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
4 changes: 4 additions & 0 deletions
4
.../src/__tests__/fixtures/slot-forwarding/slots/dangling-component/modules/x/leaf/leaf.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<template lwc:render-mode="light"> | ||
<slot name="leafTop" slot="dangling"></slot> | ||
<slot name="leafBottom"></slot> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...er/src/__tests__/fixtures/slot-forwarding/slots/dangling-component/modules/x/leaf/leaf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
6 changes: 6 additions & 0 deletions
6
.../src/__tests__/fixtures/slot-forwarding/slots/dangling-component/modules/x/slot/slot.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template lwc:render-mode="light"> | ||
<x-leaf> | ||
<slot name="top" slot="leafTop"></slot> | ||
<slot name="bottom" slot="leafBottom"></slot> | ||
</x-leaf> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...er/src/__tests__/fixtures/slot-forwarding/slots/dangling-component/modules/x/slot/slot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../src/__tests__/fixtures/slot-forwarding/slots/dangling/modules/x/container/container.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template lwc:render-mode="light"> | ||
<x-slot> | ||
<h1 slot="top">top content</h1> | ||
<h1 slot="bottom">bottom content</h1> | ||
<h2 slot="bottom">bottom content</h2> | ||
</x-slot> | ||
</template> |
4 changes: 2 additions & 2 deletions
4
...ine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/modules/x/leaf/leaf.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<template lwc:render-mode="light"> | ||
<slot name="top" slot="bottom"></slot> | ||
<slot name="bottom"></slot> | ||
<slot name="leafTop" slot="dangling"></slot> | ||
<slot name="leafBottom"></slot> | ||
</template> |
4 changes: 2 additions & 2 deletions
4
...ine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/modules/x/slot/slot.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template lwc:render-mode="light"> | ||
<x-leaf> | ||
<slot name="top" slot="bottom"></slot> | ||
<slot name="bottom" slot="top"></slot> | ||
<slot name="top" slot="leafTop"></slot> | ||
<slot name="bottom" slot="leafBottom"></slot> | ||
</x-leaf> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters