-
Notifications
You must be signed in to change notification settings - Fork 439
fix: duplicate behavior for slotted content when no template is present #5174
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 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 ddea5e4
fix: default slotted content
jhefferman-sfdc 012f15b
chore: merged master
jhefferman-sfdc 7e2a5de
fix: render shadow slotted content for no template case
jhefferman-sfdc ecedbcf
fix: update types
jhefferman-sfdc d6941e3
fix: instance naming
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.
4 changes: 4 additions & 0 deletions
4
...engine-server/src/__tests__/fixtures/slots-basic/implicit-no-template/light/expected.html
This file contains hidden or 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 @@ | ||
| <x-outer> | ||
| <x-inner> | ||
| </x-inner> | ||
| </x-outer> |
3 changes: 3 additions & 0 deletions
3
...@lwc/engine-server/src/__tests__/fixtures/slots-basic/implicit-no-template/light/index.js
This file contains hidden or 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 @@ | ||
| export const tagName = 'x-outer'; | ||
| export { default } from 'x/outer'; | ||
| export * from 'x/outer'; |
5 changes: 5 additions & 0 deletions
5
...er/src/__tests__/fixtures/slots-basic/implicit-no-template/light/modules/x/inner/inner.js
This file contains hidden or 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/slots-basic/implicit-no-template/light/modules/x/outer/outer.html
This file contains hidden or 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-inner> | ||
| I am default slot | ||
| <div slot="foo">I am the foo slot</div> | ||
| </x-inner> | ||
| </template> |
5 changes: 5 additions & 0 deletions
5
...er/src/__tests__/fixtures/slots-basic/implicit-no-template/light/modules/x/outer/outer.js
This file contains hidden or 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'; | ||
| } |
Empty file.
12 changes: 12 additions & 0 deletions
12
...ngine-server/src/__tests__/fixtures/slots-basic/implicit-no-template/shadow/expected.html
This file contains hidden or 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,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> |
3 changes: 3 additions & 0 deletions
3
...lwc/engine-server/src/__tests__/fixtures/slots-basic/implicit-no-template/shadow/index.js
This file contains hidden or 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 @@ | ||
| export const tagName = 'x-outer'; | ||
| export { default } from 'x/outer'; | ||
| export * from 'x/outer'; |
3 changes: 3 additions & 0 deletions
3
...r/src/__tests__/fixtures/slots-basic/implicit-no-template/shadow/modules/x/inner/inner.js
This file contains hidden or 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 @@ | ||
| import { LightningElement } from 'lwc'; | ||
|
|
||
| export default class extends LightningElement {} |
6 changes: 6 additions & 0 deletions
6
...src/__tests__/fixtures/slots-basic/implicit-no-template/shadow/modules/x/outer/outer.html
This file contains hidden or 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> | ||
| <x-inner> | ||
| I am default slot | ||
| <div slot="foo">I am the foo slot</div> | ||
| </x-inner> | ||
| </template> |
3 changes: 3 additions & 0 deletions
3
...r/src/__tests__/fixtures/slots-basic/implicit-no-template/shadow/modules/x/outer/outer.js
This file contains hidden or 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 @@ | ||
| import { LightningElement } from 'lwc'; | ||
|
|
||
| export default class extends LightningElement {} |
This file contains hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -101,27 +101,33 @@ export function renderAttrsNoYield( | |||||
| } | ||||||
|
|
||||||
| export function* fallbackTmpl( | ||||||
| _shadowSlottedContent: unknown, | ||||||
| _lightSlottedContent: unknown, | ||||||
| _scopedSlottedContent: unknown, | ||||||
| _shadowSlottedContent: any, | ||||||
| _lightSlottedContent: any, | ||||||
| _scopedSlottedContent: any, | ||||||
| Cmp: LightningElementConstructor, | ||||||
| _instance: unknown | ||||||
|
||||||
| _instance: unknown | |
| instance: unknown |
Outdated
Contributor
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.
Suggested change
| _instance: unknown | |
| instance: unknown |
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.
BOOOO
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.
I had a feeling this might upset you :p
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.
(sorry)