-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix forwarded dangling slots #5164
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cbe6460
fix: add dangling slot definition
jhefferman-sfdc c166486
fix: scoped slot case, nested cases
jhefferman-sfdc 7460711
fix: review comments
jhefferman-sfdc 721e063
fix: additional test
jhefferman-sfdc 572884c
Merge branch 'master' into jhefferman/slot-forwarding-fix
jhefferman-sfdc 66efe27
fix: clarified dangling slot explanation
jhefferman-sfdc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,9 @@ const bExportTemplate = esTemplate` | |
let textContentBuffer = ''; | ||
let didBufferTextContent = false; | ||
|
||
// This will get overridden but requires initialization. | ||
const slotAttributeValue = null; | ||
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does it get overridden if it's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. { } |
||
|
||
// Establishes a contextual relationship between two components for ContextProviders. | ||
// This variable will typically get overridden (shadowed) within slotted content. | ||
const contextfulParent = instance; | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that right?