-
Notifications
You must be signed in to change notification settings - Fork 169
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: apply CssImport to exported webcomponent #19740
Conversation
@@ -76,6 +78,8 @@ abstract class AbstractUpdateImports implements Runnable { | |||
+ " tpl.innerHTML = block;\n" | |||
+ " document.head.appendChild(tpl.content);\n" + "}"; | |||
private static final String IMPORT_INJECT = "import { injectGlobalCss } from 'Frontend/generated/jar-resources/theme-util.js';\n"; | |||
private static final String IMPORT_COMPOSE_LOAD_ON_DEMAND = "import { composeLoadOnDemand } from 'Frontend/generated/jar-resources/theme-util.js';\n"; |
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.
The composeLoadOnDemand
function seems not be used anymore. I suppose we can remove both the constant and the function definition in theme-utils
@@ -292,7 +314,7 @@ private Map<File, List<String>> process(Map<ChunkInfo, List<CssData>> css, | |||
start = System.nanoTime(); | |||
|
|||
chunkLoader.add(""); | |||
chunkLoader.add("const loadOnDemand = (key) => {"); | |||
chunkLoader.add("const loadOnDemand = (key, isWebcomponent) => {"); |
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.
The isWebcomponent
parameter seems not required anymore
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 leaved it in just in case. But as it's not used after all, I'll remove it.
Default value is false and global CssImport (with just a value) is not injected by default to exported web components.
Quality Gate passedIssues Measures |
CssImport annotation with just a value attribute can be injected automatically to shadow root of all exported web components (embedded applications) using Constructable StyleSheets. WebComponentExporter should have a theme to make automation work properly in theme-generator.js. Theme property "autoInjectGlobalCssImports": true in theme.json enable auto injection. Disabled by default. Fixes: #19700 Co-authored-by: Marco Collovati <marco@vaadin.com>
Hi @tltv and @mshabarov, when i performed cherry-pick to this commit to 23.5, i have encountered the following issue. Can you take a look and pick it manually? |
Hi @tltv and @mshabarov, when i performed cherry-pick to this commit to 24.3, i have encountered the following issue. Can you take a look and pick it manually? |
CssImport annotation with just a value attribute can be injected automatically to shadow root of all exported web components (embedded applications) using Constructable StyleSheets. WebComponentExporter should have a theme to make automation work properly in theme-generator.js. Theme property "autoInjectGlobalCssImports": true in theme.json enable auto injection. Disabled by default. Fixes: #19700 Co-authored-by: Tomi Virtanen <tltv@vaadin.com> Co-authored-by: Marco Collovati <marco@vaadin.com>
CssImport annotation with just a value attribute can be injected automatically to shadow root of all exported web components (embedded applications) using Constructable StyleSheets. WebComponentExporter should have a theme to make automation work properly in theme-generator.js. Theme property "autoInjectGlobalCssImports": true in theme.json enable auto injection. Disabled by default. Fixes: #19700 Co-authored-by: Marco Collovati <marco@vaadin.com>
…9746) CssImport annotation with just a value attribute can be injected automatically to shadow root of all exported web components (embedded applications) using Constructable StyleSheets. WebComponentExporter should have a theme to make automation work properly in theme-generator.js. Theme property "autoInjectGlobalCssImports": true in theme.json enable auto injection. Disabled by default. Fixes: #19700 Co-authored-by: Marco Collovati <marco@vaadin.com>
CssImport annotation with just a value attribute can be injected automatically to shadow root of all exported web components (embedded applications) using Constructable StyleSheets. WebComponentExporter should have a theme to make automation work properly in theme-generator.js. Theme property "autoInjectGlobalCssImports": true in theme.json enable auto injection. Disabled by default. Fixes: #19700 Co-authored-by: Marco Collovati <marco@vaadin.com>
…9752) CssImport annotation with just a value attribute can be injected automatically to shadow root of all exported web components (embedded applications) using Constructable StyleSheets. WebComponentExporter should have a theme to make automation work properly in theme-generator.js. Theme property "autoInjectGlobalCssImports": true in theme.json enable auto injection. Disabled by default. Fixes: #19700
CssImport annotation with just a
value
attribute can be injected automatically to shadow root of all exported web components (embedded applications) using Constructable StyleSheets.WebComponentExporter
should have a theme to make automation work properly intheme-generator.js
. Theme property"autoInjectGlobalCssImports": true
intheme.json
enable auto injection. Disabled by default.Fixes: #19700