-
Notifications
You must be signed in to change notification settings - Fork 439
fix(ssr): handle export { Cmp as default } @W-17655297
#5176
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 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
48d6fdd
fix: allow export { Cmp as default }
wjhsf 1a8673c
test(ssr): update component-as-default to check light and shadow
wjhsf c5432bf
fix: use fallback if no generateMarkup
wjhsf 4ab7230
Merge branch 'master' into wjh/export-cmp-as-default
wjhsf 17bb342
fix(ssr): support `export { Cmp as default }`
wjhsf 59944ac
Merge branch 'master' into wjh/export-cmp-as-default
jhefferman-sfdc b460d35
fix: support slotted content for unimplemented templates
jhefferman-sfdc b5868f1
fix: use fallbackTmpl for all cases
jhefferman-sfdc 01af84f
Update packages/@lwc/ssr-compiler/src/compile-template/transformers/c…
wjhsf e83a19e
Update packages/@lwc/ssr-compiler/src/compile-template/transformers/c…
wjhsf 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
19 changes: 17 additions & 2 deletions
19
...ages/@lwc/engine-server/src/__tests__/fixtures/exports/component-as-default/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 |
|---|---|---|
| @@ -1,4 +1,19 @@ | ||
| <x-cmp> | ||
| <x-parent> | ||
| <template shadowrootmode="open"> | ||
| <x-shadow> | ||
| <template shadowrootmode="open"> | ||
| </template> | ||
| </x-shadow> | ||
| <x-shadow> | ||
| <template shadowrootmode="open"> | ||
| </template> | ||
| <h1> | ||
| slotted content | ||
| </h1> | ||
| </x-shadow> | ||
| <x-light> | ||
| </x-light> | ||
| <x-light> | ||
| </x-light> | ||
| </template> | ||
| </x-cmp> | ||
| </x-parent> |
6 changes: 3 additions & 3 deletions
6
packages/@lwc/engine-server/src/__tests__/fixtures/exports/component-as-default/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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| export const tagName = 'x-cmp'; | ||
| export { default } from 'x/cmp'; | ||
| export * from 'x/cmp'; | ||
| export const tagName = 'x-parent'; | ||
| export { default } from 'x/parent'; | ||
| export * from 'x/parent'; |
4 changes: 0 additions & 4 deletions
4
...wc/engine-server/src/__tests__/fixtures/exports/component-as-default/modules/x/cmp/cmp.js
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...ine-server/src/__tests__/fixtures/exports/component-as-default/modules/x/light/light.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,3 @@ | ||
| <template lwc:render-mode="light"> | ||
| This template isn't actually used because `export {Component as default}` isn't recognized as an LWC component. | ||
| </template> |
7 changes: 7 additions & 0 deletions
7
...ngine-server/src/__tests__/fixtures/exports/component-as-default/modules/x/light/light.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,7 @@ | ||
| import { LightningElement } from 'lwc'; | ||
|
|
||
| class Light extends LightningElement { | ||
| static renderMode = 'light'; | ||
| } | ||
|
|
||
| export { Light as default }; |
6 changes: 6 additions & 0 deletions
6
...e-server/src/__tests__/fixtures/exports/component-as-default/modules/x/parent/parent.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-shadow></x-shadow> | ||
| <x-shadow><h1>slotted content</h1></x-shadow> | ||
| <x-light></x-light> | ||
| <x-light><h1>slotted content</h1></x-light> | ||
| </template> |
3 changes: 3 additions & 0 deletions
3
...ine-server/src/__tests__/fixtures/exports/component-as-default/modules/x/parent/parent.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 Parent extends LightningElement {} |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...ine-server/src/__tests__/fixtures/exports/component-as-default/modules/x/shadow/shadow.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'; | ||
|
|
||
| class Shadow extends LightningElement {} | ||
|
|
||
| export { Shadow as default }; |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.