-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssr): fix rendering of
class
attribute (#4805)
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
- Loading branch information
1 parent
5bf5d91
commit bf231db
Showing
44 changed files
with
981 additions
and
80 deletions.
There are no files selected for viewing
Empty file.
225 changes: 225 additions & 0 deletions
225
...__tests__/fixtures/attribute-class/with-scoped-styles-only-in-child/dynamic/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,225 @@ | ||
<x-parent> | ||
<template shadowrootmode="open"> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="bar foo lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="bar foo lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="baz foo lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="baz foo lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="bar foo lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="bar foo lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="bar foo lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="bar foo lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="BaR FOO lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="BaR FOO lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="foo lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="foo lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
<x-child class="lwc-5h3d35cke7v-host"> | ||
<template shadowrootmode="open"> | ||
<style class="lwc-5h3d35cke7v" type="text/css"> | ||
:host {background: blue;} | ||
</style> | ||
<div class="foo lwc-5h3d35cke7v"> | ||
</div> | ||
<x-grandchild class="foo lwc-5h3d35cke7v"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-grandchild> | ||
</template> | ||
</x-child> | ||
</template> | ||
</x-parent> |
3 changes: 3 additions & 0 deletions
3
.../src/__tests__/fixtures/attribute-class/with-scoped-styles-only-in-child/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const tagName = 'x-parent'; | ||
export { default } from 'x/parent'; | ||
export * from 'x/parent'; |
8 changes: 8 additions & 0 deletions
8
...tures/attribute-class/with-scoped-styles-only-in-child/dynamic/modules/x/child/child.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,8 @@ | ||
<template> | ||
<div | ||
class={dynamic} | ||
></div> | ||
<x-grandchild | ||
class={dynamic} | ||
></x-grandchild> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ixtures/attribute-class/with-scoped-styles-only-in-child/dynamic/modules/x/child/child.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, api } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
@api dynamic | ||
} |
3 changes: 3 additions & 0 deletions
3
...attribute-class/with-scoped-styles-only-in-child/dynamic/modules/x/child/child.scoped.css
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 @@ | ||
:host { | ||
background: blue; | ||
} |
1 change: 1 addition & 0 deletions
1
...ibute-class/with-scoped-styles-only-in-child/dynamic/modules/x/grandchild/grandchild.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 @@ | ||
<template></template> |
4 changes: 4 additions & 0 deletions
4
...tribute-class/with-scoped-styles-only-in-child/dynamic/modules/x/grandchild/grandchild.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 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
} |
19 changes: 19 additions & 0 deletions
19
...res/attribute-class/with-scoped-styles-only-in-child/dynamic/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,19 @@ | ||
<template> | ||
<x-child dynamic={isUndefined}></x-child> | ||
<x-child dynamic={isNull}></x-child> | ||
<x-child dynamic={isFalse}></x-child> | ||
<x-child dynamic={isTrue}></x-child> | ||
<x-child dynamic={isZero}></x-child> | ||
<x-child dynamic={isNegZero}></x-child> | ||
<x-child dynamic={isNaN}></x-child> | ||
<x-child dynamic={isInfinity}></x-child> | ||
<x-child dynamic={isNegInfinity}></x-child> | ||
<x-child dynamic={isEmptyString}></x-child> | ||
<x-child dynamic={isArray}></x-child> | ||
<x-child dynamic={isObject}></x-child> | ||
<x-child dynamic={isTwoClasses}></x-child> | ||
<x-child dynamic={isTwoClassesWithSpaces}></x-child> | ||
<x-child dynamic={isUppercase}></x-child> | ||
<x-child dynamic={isTabs}></x-child> | ||
<x-child dynamic={isNewlines}></x-child> | ||
</template> |
24 changes: 24 additions & 0 deletions
24
...tures/attribute-class/with-scoped-styles-only-in-child/dynamic/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,24 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
isUndefined = undefined; | ||
isNull = null; | ||
isFalse = false; | ||
isTrue = true; | ||
isZero = 0; | ||
isNegZero = -0; | ||
isNaN = NaN; | ||
isInfinity = Infinity; | ||
isNegInfinity = -Infinity; | ||
isEmptyString = ""; | ||
isArray = ["foo", "bar"]; | ||
isObject = { | ||
foo: "bar", | ||
baz: "quux" | ||
}; | ||
isTwoClasses = 'foo bar' | ||
isTwoClassesWithSpaces = ' foo bar ' | ||
isUppercase = 'FOO BaR' | ||
isTabs = '\tfoo\t' | ||
isNewlines = '\nfoo\n' | ||
} |
Empty file.
Oops, something went wrong.