-
Notifications
You must be signed in to change notification settings - Fork 393
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
feat(compiler): add disableSyntheticShadowSupport option #3229
Changes from all commits
6663a93
8767b4e
ed6f983
8d12bf5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ export default { | |
- `experimentalDynamicComponent` (type: `DynamicComponentConfig`, default: `null`) - The configuration to pass to `@lwc/compiler`. | ||
- `enableLwcSpread` (type: `boolean`, default: `false`) - The configuration to pass to the `@lwc/template-compiler`. | ||
- `enableScopedSlots` (type: `boolean`, default: `false`) - The configuration to pass to `@lwc/template-compiler` to enable scoped slots feature. | ||
- `disableSyntheticShadowSupport` (type: `boolean`, default: `false`) - Set to true if synthetic shadow DOM support is not needed, which can result in smaller output. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could have put this boolean on the In this PR, though, I've only implemented the optimization for the style compiler. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.foo { | ||
animation-name: fadeIn; | ||
} | ||
|
||
@keyframes fadeIn { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
opacity: 1; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"disableSyntheticShadowSupport": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function stylesheet() { | ||
var token; | ||
var useActualHostSelector = true; | ||
var useNativeDirPseudoclass = true; | ||
var shadowSelector = token ? ("[" + token + "]") : ""; | ||
var hostSelector = token ? ("[" + token + "-host]") : ""; | ||
var suffixToken = token ? ("-" + token) : ""; | ||
return ".foo" + shadowSelector + " {animation-name: fadeIn" + suffixToken + ";}@keyframes fadeIn" + suffixToken + " {0% {opacity: 0;}100% {opacity: 1;}}"; | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
export default [stylesheet]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
:host(.foo) :dir(rtl) { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"disableSyntheticShadowSupport": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function stylesheet() { | ||
var token; | ||
var useActualHostSelector = true; | ||
var useNativeDirPseudoclass = true; | ||
var shadowSelector = token ? ("[" + token + "]") : ""; | ||
var hostSelector = token ? ("[" + token + "-host]") : ""; | ||
var suffixToken = token ? ("-" + token) : ""; | ||
return ((useActualHostSelector ? (useNativeDirPseudoclass ? '' : '[dir="rtl"]') + " :host(.foo) " : (useNativeDirPseudoclass ? '' : '[dir="rtl"]') + " " + hostSelector + ".foo ")) + (useNativeDirPseudoclass ? ':dir(rtl)' : '') + " {}"; | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
export default [stylesheet]; |
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.
Verified manually that this Karma test works with the config passed in.
In the above screenshot, some of the functions still have their arguments, because they are scoped (
stylesheet.$scoped$ = true
).