-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ssr): add support for superclasses @ W-17178263 (#4903)
* chore: remove unnecessary block statements * chore: merge separate build helpers * test(ssr): add test for super fancy super class * chore: no longer expect failures * feat(ssr): give components access to parent component props * feat(ssr): everything with a superclass is a component * chore(ssr): move internal setup into setInternals * revert: remove incorrect implementation * feat(ssr): implement the thing it's too late for descriptive commits * revert: mostly undo changes * feat(ssr): everything's a component * feat(ssr): fully support superclass
- Loading branch information
Showing
13 changed files
with
70 additions
and
39 deletions.
There are no files selected for viewing
Empty file.
7 changes: 7 additions & 0 deletions
7
packages/@lwc/engine-server/src/__tests__/fixtures/superclass/fancy/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,7 @@ | ||
<x-component data-lwc-host-mutated="data-yolo" data-yolo> | ||
<template shadowrootmode="open"> | ||
<div> | ||
base mixin hello | ||
</div> | ||
</template> | ||
</x-component> |
3 changes: 3 additions & 0 deletions
3
packages/@lwc/engine-server/src/__tests__/fixtures/superclass/fancy/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,3 @@ | ||
export const tagName = 'x-component'; | ||
export { default } from 'x/component'; | ||
export * from 'x/component'; |
8 changes: 8 additions & 0 deletions
8
...wc/engine-server/src/__tests__/fixtures/superclass/fancy/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,8 @@ | ||
import FancyElement from 'x/fancyElement' | ||
import {FancyMixin} from 'x/fancyMixin' | ||
|
||
const FancyMixedInElement = FancyMixin(FancyElement, 'mixin') | ||
|
||
export default class extends FancyMixedInElement { | ||
cmp = 'hello' | ||
} |
3 changes: 3 additions & 0 deletions
3
...e-server/src/__tests__/fixtures/superclass/fancy/modules/x/fancyElement/fancyElement.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> | ||
<div>{base} {mixed} {cmp}</div> | ||
</template> |
7 changes: 7 additions & 0 deletions
7
...ine-server/src/__tests__/fixtures/superclass/fancy/modules/x/fancyElement/fancyElement.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,7 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
base = 'base' | ||
mixed = 'nope' | ||
cmp = 'also nope' | ||
} |
6 changes: 6 additions & 0 deletions
6
.../engine-server/src/__tests__/fixtures/superclass/fancy/modules/x/fancyMixin/fancyMixin.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,6 @@ | ||
export const FancyMixin = (clazz, value) => class extends clazz { | ||
mixed = value | ||
connectedCallback() { | ||
this.setAttribute('data-yolo', '') | ||
} | ||
} |
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