-
Notifications
You must be signed in to change notification settings - Fork 395
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-compiler): add SSR for lwc:component
#4000
Open
abdulsattar
wants to merge
13
commits into
master
Choose a base branch
from
abdulsattar/ssr-dynamic-components
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 all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1364d55
chore: update fixtures to accommodate SSR compiler
divmain a5425a2
chore: add package-local test command
divmain 3b256d6
feat: experimental SSR compiler
divmain 3f1677a
chore: address PR feedback
divmain bf43fac
chore: re-add acorn for estemplate
divmain 923e065
chore: test changes
divmain 364c638
chore: fixes to esTemplate, tests, & follow-up fixes
divmain c6da245
chore: remove no-op
divmain fb0645c
chore: update README
divmain a5139bc
fix(ssr-compiler): add SSR for `lwc:component`
abdulsattar db3322f
fix(ssr-compiler): generate uid for every imported child generateMarkup
abdulsattar 3d902e5
fix(ssr-compiler): add test for two components
abdulsattar b466dd3
fix: add comments
abdulsattar 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
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
1 change: 1 addition & 0 deletions
1
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-aria-modify/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,2 +1,3 @@ | ||
export const tagName = 'x-cmp'; | ||
export { default } from 'x/cmp'; | ||
export * from 'x/cmp'; |
1 change: 1 addition & 0 deletions
1
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-aria/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,2 +1,3 @@ | ||
export const tagName = 'x-parent'; | ||
export { default } from 'x/parent'; | ||
export * from 'x/parent'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-boolean/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-boolean'; | ||
export { default } from 'x/attribute-boolean'; | ||
export { default } from 'x/attribute-boolean'; | ||
export * from 'x/attribute-boolean'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-component-aria/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-component-aria'; | ||
export { default } from 'x/attribute-component-aria'; | ||
export { default } from 'x/attribute-component-aria'; | ||
export * from 'x/attribute-component-aria'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-component-global-html/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-component-global-html'; | ||
export { default } from 'x/attribute-component-global-html'; | ||
export { default } from 'x/attribute-component-global-html'; | ||
export * from 'x/attribute-component-global-html'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-dynamic-escape/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-dynamic-escape'; | ||
export { default } from 'x/attribute-dynamic-escape'; | ||
export { default } from 'x/attribute-dynamic-escape'; | ||
export * from 'x/attribute-dynamic-escape'; |
3 changes: 2 additions & 1 deletion
3
...ages/@lwc/engine-server/src/__tests__/fixtures/attribute-dynamic-with-scoped-css/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-dynamic-with-scoped-css'; | ||
export { default } from 'x/attribute-dynamic-with-scoped-css'; | ||
export { default } from 'x/attribute-dynamic-with-scoped-css'; | ||
export * from 'x/attribute-dynamic-with-scoped-css'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-dynamic/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-dynamic'; | ||
export { default } from 'x/attribute-dynamic'; | ||
export { default } from 'x/attribute-dynamic'; | ||
export * from 'x/attribute-dynamic'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-global-html/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-global-html'; | ||
export { default } from 'x/attribute-global-html'; | ||
export { default } from 'x/attribute-global-html'; | ||
export * from 'x/attribute-global-html'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-live-bindings/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-live-bindings'; | ||
export { default } from 'x/attribute-live-bindings'; | ||
export { default } from 'x/attribute-live-bindings'; | ||
export * from 'x/attribute-live-bindings'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-static/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-static'; | ||
export { default } from 'x/attribute-static'; | ||
export { default } from 'x/attribute-static'; | ||
export * from 'x/attribute-static'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-style/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,2 +1,3 @@ | ||
export const tagName = 'x-attribute-style'; | ||
export { default } from 'x/attribute-style'; | ||
export { default } from 'x/attribute-style'; | ||
export * from 'x/attribute-style'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/attributes-aria/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,2 +1,3 @@ | ||
export const tagName = 'x-attributes-aria'; | ||
export { default } from 'x/attributes-aria'; | ||
export { default } from 'x/attributes-aria'; | ||
export * from 'x/attributes-aria'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/comments-basic/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,2 +1,3 @@ | ||
export const tagName = 'x-comments-basic'; | ||
export { default } from 'x/comments-basic'; | ||
export { default } from 'x/comments-basic'; | ||
export * from 'x/comments-basic'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/comments-foreach/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,2 +1,3 @@ | ||
export const tagName = 'x-comments-foreach'; | ||
export { default } from 'x/comments-foreach'; | ||
export { default } from 'x/comments-foreach'; | ||
export * from 'x/comments-foreach'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/comments-if/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,2 +1,3 @@ | ||
export const tagName = 'x-comments-if'; | ||
export { default } from 'x/comments-if'; | ||
export { default } from 'x/comments-if'; | ||
export * from 'x/comments-if'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/comments-slot/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,2 +1,3 @@ | ||
export const tagName = 'x-comments-slot'; | ||
export { default } from 'x/comments-slot'; | ||
export { default } from 'x/comments-slot'; | ||
export * from 'x/comments-slot'; |
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
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/component/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,2 +1,3 @@ | ||
export const tagName = 'x-component'; | ||
export { default } from 'x/component'; | ||
export { default } from 'x/component'; | ||
export * from 'x/component'; |
1 change: 1 addition & 0 deletions
1
...es/@lwc/engine-server/src/__tests__/fixtures/component/modules/x/component/component.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,3 +1,4 @@ | ||
<template> | ||
<x-child></x-child> | ||
<x-anotherchild></x-anotherchild> | ||
</template> |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/computed/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,2 +1,3 @@ | ||
export const tagName = 'x-computed'; | ||
export { default } from 'x/computed'; | ||
export { default } from 'x/computed'; | ||
export * from 'x/computed'; |
1 change: 1 addition & 0 deletions
1
packages/@lwc/engine-server/src/__tests__/fixtures/context-deep/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,2 +1,3 @@ | ||
export const tagName = 'x-provider'; | ||
export { default } from 'x/provider'; | ||
export * from 'x/provider'; |
1 change: 1 addition & 0 deletions
1
...es/@lwc/engine-server/src/__tests__/fixtures/context-installation-on-non-element/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,2 +1,3 @@ | ||
export const tagName = 'x-provider'; | ||
export { default } from 'x/provider'; | ||
export * from 'x/provider'; |
1 change: 1 addition & 0 deletions
1
packages/@lwc/engine-server/src/__tests__/fixtures/context-nested/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,2 +1,3 @@ | ||
export const tagName = 'x-provider'; | ||
export { default } from 'x/provider'; | ||
export * from 'x/provider'; |
1 change: 1 addition & 0 deletions
1
packages/@lwc/engine-server/src/__tests__/fixtures/context-no-provider/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,2 +1,3 @@ | ||
export const tagName = 'x-parent'; | ||
export { default } from 'x/parent'; | ||
export * from 'x/parent'; |
1 change: 1 addition & 0 deletions
1
packages/@lwc/engine-server/src/__tests__/fixtures/context-shadowed/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,2 +1,3 @@ | ||
export const tagName = 'x-provider'; | ||
export { default } from 'x/provider'; | ||
export * from 'x/provider'; |
1 change: 1 addition & 0 deletions
1
packages/@lwc/engine-server/src/__tests__/fixtures/context-simple/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,2 +1,3 @@ | ||
export const tagName = 'x-provider'; | ||
export { default } from 'x/provider'; | ||
export * from 'x/provider'; |
1 change: 1 addition & 0 deletions
1
packages/@lwc/engine-server/src/__tests__/fixtures/context-slotted/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,2 +1,3 @@ | ||
export const tagName = 'x-root'; | ||
export { default } from 'x/root'; | ||
export * from 'x/root'; |
3 changes: 2 additions & 1 deletion
3
packages/@lwc/engine-server/src/__tests__/fixtures/custom-styles-with-newlines/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,2 +1,3 @@ | ||
export const tagName = 'x-component'; | ||
export { default } from 'x/component'; | ||
export { default } from 'x/component'; | ||
export * from 'x/component'; |
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.
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 don't see a test here for
<lwc:component>
...?BTW this is a good example of why it'd be nice to have the compiler output as part of the snapshots... would help with visualizing the generated code.
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.
This tests the import statement we add when we see a child in the template.
lwc:component
are imported in the JS by the user.Specifically, here db3322f#diff-17a5fc2e6a05c3f1e674d6942273c831cb914d8d3c3286062c429e5054465bdfR101, we increment UID to add unique import statements for each child.
e.g.
Definitely agree with having the compiler output in snapshots. This would have been clearer.