Skip to content

Commit 0381f3d

Browse files
authored
feat: add support for StyleSheet annotation hotswap (#22741)
Implements hotswap for changes related to the StyleSheet annotation. Reacts on adding, removing or updating the value of the annotation on AppShellConfigurator and Component subclasses, by registering or unregistering the stylesheet with the API provided by UI and UIInternals classes Fixes #22631
1 parent 843bd7f commit 0381f3d

File tree

8 files changed

+1202
-235
lines changed

8 files changed

+1202
-235
lines changed

flow-client/src/main/java/com/vaadin/client/ResourceLoader.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,11 @@ private void initLoadedResourcesFromDom() {
281281
|| "import".equalsIgnoreCase(rel)) && href != null
282282
&& href.length() != 0) {
283283
loadedResources.add(href);
284+
// Handle stylesheet loaded by AppShellRegistry
285+
String dependencyId = linkElement.getAttribute("data-id");
286+
if (dependencyId != null) {
287+
dependencyIdToResourceKey.set(dependencyId, href);
288+
}
284289
}
285290
}
286291
}

flow-server/src/main/java/com/vaadin/flow/component/dependency/StyleSheetHotswapper.java

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)