-
Notifications
You must be signed in to change notification settings - Fork 0
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: add dev ui #1036
base: main
Are you sure you want to change the base?
feat: add dev ui #1036
Conversation
Format Checker ReportThere are 4 files with format errors.
Files with format issues in this PR
Full Diffdiff --git a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/EndpointBuildItem.java b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/EndpointBuildItem.java
index f73f2d1..32b0ace 100644
--- a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/EndpointBuildItem.java
+++ b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/EndpointBuildItem.java
@@ -32,8 +32,6 @@ public final class EndpointBuildItem extends SimpleBuildItem {
}
public int getEndpointMethodCount() {
- return endpoints.stream()
- .mapToInt(a -> a.children().size())
- .sum();
+ return endpoints.stream().mapToInt(a -> a.children().size()).sum();
}
}
diff --git a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/QuarkusHillaDevUICommonsProcessor.java b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/QuarkusHillaDevUICommonsProcessor.java
index 54f144a..c062cfa 100644
--- a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/QuarkusHillaDevUICommonsProcessor.java
+++ b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/QuarkusHillaDevUICommonsProcessor.java
@@ -15,6 +15,12 @@
*/
package com.github.mcollovati.quarkus.hilla.deployment.devui;
+import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.stream.Stream;
+
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
@@ -28,15 +34,10 @@ import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.DotName;
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Stream;
-
public class QuarkusHillaDevUICommonsProcessor {
- private static final GACT UI_JAR = new GACT("com.github.mcollovati", "quarkus-hilla-commons-deployment", null, "jar");
+ private static final GACT UI_JAR =
+ new GACT("com.github.mcollovati", "quarkus-hilla-commons-deployment", null, "jar");
private static final String NAMESPACE = UI_JAR.getGroupId() + "." + UI_JAR.getArtifactId();
private static final String DEV_UI = "dev-ui";
diff --git a/lit/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/devui/QuarkusHillaDevUIProcessor.java b/lit/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/devui/QuarkusHillaDevUIProcessor.java
index eded8a0..2efb618 100644
--- a/lit/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/devui/QuarkusHillaDevUIProcessor.java
+++ b/lit/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/devui/QuarkusHillaDevUIProcessor.java
@@ -1,18 +1,32 @@
+/*
+ * Copyright 2024 Marco Collovati, Dario Götze
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.github.mcollovati.quarkus.hilla.devui;
-import com.github.mcollovati.quarkus.hilla.deployment.devui.EndpointBuildItem;
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.devui.spi.page.CardPageBuildItem;
import io.quarkus.devui.spi.page.Page;
+import com.github.mcollovati.quarkus.hilla.deployment.devui.EndpointBuildItem;
+
public class QuarkusHillaDevUIProcessor {
@BuildStep(onlyIf = IsDevelopment.class)
- public void pages(
- BuildProducer<CardPageBuildItem> cardPageProducer,
- EndpointBuildItem endpointBuildItem) {
+ public void pages(BuildProducer<CardPageBuildItem> cardPageProducer, EndpointBuildItem endpointBuildItem) {
CardPageBuildItem cardPageBuildItem = new CardPageBuildItem();
final var page = Page.webComponentPageBuilder()
.title("Browser callables")
diff --git a/react/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/devui/QuarkusHillaDevUIProcessor.java b/react/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/devui/QuarkusHillaDevUIProcessor.java
index 0db2ae7..2fd604a 100644
--- a/react/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/devui/QuarkusHillaDevUIProcessor.java
+++ b/react/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/devui/QuarkusHillaDevUIProcessor.java
@@ -1,18 +1,32 @@
+/*
+ * Copyright 2024 Marco Collovati, Dario Götze
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.github.mcollovati.quarkus.hilla.devui;
-import com.github.mcollovati.quarkus.hilla.deployment.devui.EndpointBuildItem;
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.devui.spi.page.CardPageBuildItem;
import io.quarkus.devui.spi.page.Page;
+import com.github.mcollovati.quarkus.hilla.deployment.devui.EndpointBuildItem;
+
public class QuarkusHillaDevUIProcessor {
@BuildStep(onlyIf = IsDevelopment.class)
- public void pages(
- BuildProducer<CardPageBuildItem> cardPageProducer,
- EndpointBuildItem endpointBuildItem) {
+ public void pages(BuildProducer<CardPageBuildItem> cardPageProducer, EndpointBuildItem endpointBuildItem) {
CardPageBuildItem cardPageBuildItem = new CardPageBuildItem();
final var page = Page.webComponentPageBuilder()
.title("Browser callables") |
44c7f5e
to
e25cc5a
Compare
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.
Overall, looks excellent!
However, I noticed that methods defined in superclasses annotated with @EndpointExposed
are not listed in the UI.
I guess this is because ClassInfo.methods()
collects only method declared in the class and do not traverse the hierarchy
...loyment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/devui/EndpointInfo.java
Show resolved
Hide resolved
.map(DotName::withoutPackagePrefix) | ||
.orElse(null), | ||
accessAnnotation, | ||
classInfo.methods().stream() |
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.
Would maybe use methodsInDeclarationOrder()
to make the ordering consistent with the class definition.
Also, should collect methods from super classes annotated with @ExposedEndpoint
return html` | ||
<vaadin-grid .dataProvider="${this._dataProvider}" .expandedItems="${this._expandedItems}" | ||
class="datatable" theme="row-stripes"> | ||
<vaadin-grid-sort-column header="Class" |
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.
Sorting does not seem to work. Would it make sense to remove it?
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.
That's true, didn't know how to correctly specify the sort parameter. If you can give me a hint, would be nice, otherwise we could remove it.
e25cc5a
to
1bcf13c
Compare
Implements #33