-
Notifications
You must be signed in to change notification settings - Fork 401
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(ssr): handle export { Cmp as default }
@W-17655297
#5176
Open
wjhsf
wants to merge
7
commits into
master
Choose a base branch
from
wjh/export-cmp-as-default
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 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 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
10 changes: 8 additions & 2 deletions
10
...ages/@lwc/engine-server/src/__tests__/fixtures/exports/component-as-default/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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
<x-cmp> | ||
<x-parent> | ||
<template shadowrootmode="open"> | ||
<x-shadow> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-shadow> | ||
<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 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 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 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 }; |
4 changes: 4 additions & 0 deletions
4
...e-server/src/__tests__/fixtures/exports/component-as-default/modules/x/parent/parent.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> | ||
<x-shadow></x-shadow> | ||
<x-light></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 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 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 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.
Should we be rendering the slotted content here?
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.
Added support