diff --git a/deployment/src/main/java/io/quarkiverse/web/bundler/deployment/devui/DevUIWebDependenciesBuildItem.java b/deployment/src/main/java/io/quarkiverse/web/bundler/deployment/devui/DevUIWebDependenciesBuildItem.java index eb7854f..77a019b 100644 --- a/deployment/src/main/java/io/quarkiverse/web/bundler/deployment/devui/DevUIWebDependenciesBuildItem.java +++ b/deployment/src/main/java/io/quarkiverse/web/bundler/deployment/devui/DevUIWebDependenciesBuildItem.java @@ -23,7 +23,7 @@ record WebDependencyAsset(String name, } public record DevUIWebDependency(String type, - String webDependencyName, + String name, String version, WebDependencyAsset rootAsset) { } diff --git a/deployment/src/main/java/io/quarkiverse/web/bundler/deployment/devui/WebBundlerDevUIWebDependenciesProcessor.java b/deployment/src/main/java/io/quarkiverse/web/bundler/deployment/devui/WebBundlerDevUIWebDependenciesProcessor.java index 06d15cc..4d220ed 100644 --- a/deployment/src/main/java/io/quarkiverse/web/bundler/deployment/devui/WebBundlerDevUIWebDependenciesProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/web/bundler/deployment/devui/WebBundlerDevUIWebDependenciesProcessor.java @@ -21,6 +21,7 @@ import io.quarkus.bootstrap.classloading.QuarkusClassLoader; import io.quarkus.deployment.IsDevelopment; import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.LiveReloadBuildItem; import io.quarkus.maven.dependency.ArtifactKey; import io.quarkus.maven.dependency.ResolvedDependency; import io.quarkus.vertx.http.runtime.HttpBuildTimeConfig; @@ -36,7 +37,16 @@ public class WebBundlerDevUIWebDependenciesProcessor { @BuildStep(onlyIf = IsDevelopment.class) public DevUIWebDependenciesBuildItem findWebDependenciesAssets( HttpBuildTimeConfig httpConfig, + LiveReloadBuildItem liveReload, WebDependenciesBuildItem webDependencies) { + final DevUIWebDependenciesContext webDependenciesContext = liveReload + .getContextObject(DevUIWebDependenciesContext.class); + + if (liveReload.isLiveReload() && webDependenciesContext != null + && webDependenciesContext.dependencies().equals(webDependencies.list())) { + return new DevUIWebDependenciesBuildItem(webDependenciesContext.devUIWebDependencies()); + } + final List providers = new ArrayList<>(); providers.addAll(QuarkusClassLoader.getElements(PREFIX + MVNPM_PATH, false)); providers.addAll(QuarkusClassLoader.getElements(PREFIX + WEBJARS_PATH, false)); @@ -50,8 +60,13 @@ public DevUIWebDependenciesBuildItem findWebDependenciesAssets( final List webJarDeps = new ArrayList<>(webDependencies.list().size()); for (WebDependenciesBuildItem.Dependency dependency : webDependencies.list()) { - webJarDeps.add(getDep(httpConfig, providersByKeys, dependency)); + final DevUIWebDependency dep = getDep(httpConfig, providersByKeys, dependency); + if (dep != null) { + webJarDeps.add(dep); + } } + liveReload.setContextObject(DevUIWebDependenciesContext.class, + new DevUIWebDependenciesContext(webDependencies.list(), webJarDeps)); return new DevUIWebDependenciesBuildItem(webJarDeps); } return new DevUIWebDependenciesBuildItem(List.of()); @@ -149,4 +164,9 @@ private WebDependencyAsset createAssetForDep(Path rootPath, String urlBase, bool return root; } + public record DevUIWebDependenciesContext(List dependencies, + List devUIWebDependencies) { + + } + } diff --git a/deployment/src/main/resources/dev-ui/qwc-web-bundler-web-dependencies.js b/deployment/src/main/resources/dev-ui/qwc-web-bundler-web-dependencies.js index 3bb8cf3..82235b5 100644 --- a/deployment/src/main/resources/dev-ui/qwc-web-bundler-web-dependencies.js +++ b/deployment/src/main/resources/dev-ui/qwc-web-bundler-web-dependencies.js @@ -46,8 +46,8 @@ export class QwcWebBundlerWebDependencies extends LitElement { return html` ${this._webDependencies.map(webDependency => html` - - ${webDependency.webDependencyName + " (" + webDependency.version + ")"} + + ${webDependency.name + " (" + webDependency.version + ")"} `)} @@ -69,7 +69,7 @@ export class QwcWebBundlerWebDependencies extends LitElement { }; return html` -
+
diff --git a/docs/modules/ROOT/pages/includes/attributes.adoc b/docs/modules/ROOT/pages/includes/attributes.adoc index aee86c9..8fba2ee 100644 --- a/docs/modules/ROOT/pages/includes/attributes.adoc +++ b/docs/modules/ROOT/pages/includes/attributes.adoc @@ -1,4 +1,4 @@ -:project-version: 1.4.0 +:project-version: 1.5.0.CR1 :maven-version: 3.8.1+