-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: partially fix slot forwarding in SSR (#4999)
- Loading branch information
Showing
44 changed files
with
264 additions
and
8 deletions.
There are no files selected for viewing
Empty file.
16 changes: 16 additions & 0 deletions
16
...es/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/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> | ||
<!----> | ||
<h1 slot="bottom"> | ||
bottom content | ||
</h1> | ||
<!----> | ||
<!----> | ||
<h1> | ||
top content | ||
</h1> | ||
<!----> | ||
</x-leaf> | ||
</x-slot> | ||
</x-dangling-container> |
4 changes: 4 additions & 0 deletions
4
packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/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 = []; |
6 changes: 6 additions & 0 deletions
6
.../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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template lwc:render-mode="light"> | ||
<x-slot> | ||
<h1 slot="top">top content</h1> | ||
<h1 slot="bottom">bottom content</h1> | ||
</x-slot> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...er/src/__tests__/fixtures/slot-forwarding/slots/dangling/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
...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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<template lwc:render-mode="light"> | ||
<slot name="top" slot="bottom"></slot> | ||
<slot name="bottom"></slot> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ngine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/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
...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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template lwc:render-mode="light"> | ||
<x-leaf> | ||
<slot name="top" slot="bottom"></slot> | ||
<slot name="bottom" slot="top"></slot> | ||
</x-leaf> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ngine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling/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'; | ||
} |
Empty file.
16 changes: 16 additions & 0 deletions
16
packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/light/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-light-container> | ||
<x-slot> | ||
<x-leaf> | ||
<!----> | ||
<h1> | ||
bottom content | ||
</h1> | ||
<!----> | ||
<!----> | ||
<h1> | ||
top content | ||
</h1> | ||
<!----> | ||
</x-leaf> | ||
</x-slot> | ||
</x-light-container> |
4 changes: 4 additions & 0 deletions
4
packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/light/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-light-container'; | ||
export { default } from 'x/container'; | ||
export * from 'x/container'; | ||
export const features = []; |
6 changes: 6 additions & 0 deletions
6
...ver/src/__tests__/fixtures/slot-forwarding/slots/light/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> | ||
<h1 slot="top">top content</h1> | ||
<h1 slot="bottom">bottom content</h1> | ||
</x-slot> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...erver/src/__tests__/fixtures/slot-forwarding/slots/light/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
...engine-server/src/__tests__/fixtures/slot-forwarding/slots/light/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="top"></slot> | ||
<slot name="bottom"></slot> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...c/engine-server/src/__tests__/fixtures/slot-forwarding/slots/light/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
...engine-server/src/__tests__/fixtures/slot-forwarding/slots/light/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="bottom"></slot> | ||
<slot name="bottom" slot="top"></slot> | ||
</x-leaf> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...c/engine-server/src/__tests__/fixtures/slot-forwarding/slots/light/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'; | ||
} |
Empty file.
40 changes: 40 additions & 0 deletions
40
packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/mixed/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,40 @@ | ||
<x-mixed-container> | ||
<template shadowrootmode="open"> | ||
<x-light-parent> | ||
<x-shadow-leaf> | ||
<template shadowrootmode="open"> | ||
<slot name="top"> | ||
</slot> | ||
<slot name="bottom"> | ||
</slot> | ||
</template> | ||
<div slot="bottom"> | ||
top of light parent | ||
</div> | ||
<div slot="top"> | ||
bottom of light parent | ||
</div> | ||
</x-shadow-leaf> | ||
</x-light-parent> | ||
<x-shadow-parent> | ||
<template shadowrootmode="open"> | ||
<x-light-leaf> | ||
<!----> | ||
<slot name="bottom"> | ||
</slot> | ||
<!----> | ||
<!----> | ||
<slot name="top"> | ||
</slot> | ||
<!----> | ||
</x-light-leaf> | ||
</template> | ||
<div slot="top"> | ||
top of shadow parent | ||
</div> | ||
<div slot="bottom"> | ||
bottom of shadow parent | ||
</div> | ||
</x-shadow-parent> | ||
</template> | ||
</x-mixed-container> |
4 changes: 4 additions & 0 deletions
4
packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/mixed/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-mixed-container'; | ||
export { default } from 'x/container'; | ||
export * from 'x/container'; | ||
export const features = []; |
11 changes: 11 additions & 0 deletions
11
...ver/src/__tests__/fixtures/slot-forwarding/slots/mixed/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,11 @@ | ||
<template> | ||
<x-light-parent> | ||
<div slot="top">top of light parent</div> | ||
<div slot="bottom">bottom of light parent</div> | ||
</x-light-parent> | ||
|
||
<x-shadow-parent> | ||
<div slot="top">top of shadow parent</div> | ||
<div slot="bottom">bottom of shadow parent</div> | ||
</x-shadow-parent> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
...erver/src/__tests__/fixtures/slot-forwarding/slots/mixed/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,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
4 changes: 4 additions & 0 deletions
4
...ver/src/__tests__/fixtures/slot-forwarding/slots/mixed/modules/x/lightLeaf/lightLeaf.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="top"></slot> | ||
<slot name="bottom"></slot> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...erver/src/__tests__/fixtures/slot-forwarding/slots/mixed/modules/x/lightLeaf/lightLeaf.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/mixed/modules/x/lightParent/lightParent.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-shadow-leaf> | ||
<slot name="top" slot="bottom"></slot> | ||
<slot name="bottom" slot="top"></slot> | ||
</x-shadow-leaf> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...r/src/__tests__/fixtures/slot-forwarding/slots/mixed/modules/x/lightParent/lightParent.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
...r/src/__tests__/fixtures/slot-forwarding/slots/mixed/modules/x/shadowLeaf/shadowLeaf.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> | ||
<slot name="top"></slot> | ||
<slot name="bottom"></slot> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
...ver/src/__tests__/fixtures/slot-forwarding/slots/mixed/modules/x/shadowLeaf/shadowLeaf.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,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
6 changes: 6 additions & 0 deletions
6
...c/__tests__/fixtures/slot-forwarding/slots/mixed/modules/x/shadowParent/shadowParent.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> | ||
<x-light-leaf> | ||
<slot name="top" slot="bottom"></slot> | ||
<slot name="bottom" slot="top"></slot> | ||
</x-light-leaf> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
...src/__tests__/fixtures/slot-forwarding/slots/mixed/modules/x/shadowParent/shadowParent.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,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
Empty file.
26 changes: 26 additions & 0 deletions
26
...ages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/shadow/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,26 @@ | ||
<x-shadow-container> | ||
<template shadowrootmode="open"> | ||
<x-slot> | ||
<template shadowrootmode="open"> | ||
<x-leaf> | ||
<template shadowrootmode="open"> | ||
<slot name="top"> | ||
</slot> | ||
<slot name="bottom"> | ||
</slot> | ||
</template> | ||
<slot name="top" slot="bottom"> | ||
</slot> | ||
<slot name="bottom" slot="top"> | ||
</slot> | ||
</x-leaf> | ||
</template> | ||
<h1 slot="top"> | ||
top content | ||
</h1> | ||
<h1 slot="bottom"> | ||
bottom content | ||
</h1> | ||
</x-slot> | ||
</template> | ||
</x-shadow-container> |
4 changes: 4 additions & 0 deletions
4
packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/shadow/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-shadow-container'; | ||
export { default } from 'x/container'; | ||
export * from 'x/container'; | ||
export const features = []; |
6 changes: 6 additions & 0 deletions
6
...er/src/__tests__/fixtures/slot-forwarding/slots/shadow/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> | ||
<x-slot> | ||
<h1 slot="top">top content</h1> | ||
<h1 slot="bottom">bottom content</h1> | ||
</x-slot> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
...rver/src/__tests__/fixtures/slot-forwarding/slots/shadow/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,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
4 changes: 4 additions & 0 deletions
4
...ngine-server/src/__tests__/fixtures/slot-forwarding/slots/shadow/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> | ||
<slot name="top"></slot> | ||
<slot name="bottom"></slot> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
.../engine-server/src/__tests__/fixtures/slot-forwarding/slots/shadow/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,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
6 changes: 6 additions & 0 deletions
6
...ngine-server/src/__tests__/fixtures/slot-forwarding/slots/shadow/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> | ||
<x-leaf> | ||
<slot name="top" slot="bottom"></slot> | ||
<slot name="bottom" slot="top"></slot> | ||
</x-leaf> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
.../engine-server/src/__tests__/fixtures/slot-forwarding/slots/shadow/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,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
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