Skip to content

Commit

Permalink
Merge branch 'quarkusio:main' into 43811
Browse files Browse the repository at this point in the history
  • Loading branch information
tmulle authored Oct 11, 2024
2 parents f0acc0d + aea9c27 commit c97b211
Show file tree
Hide file tree
Showing 17 changed files with 530 additions and 200 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-istio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Set up Minikube-Kubernetes
uses: manusa/actions-setup-minikube@v2.12.0
uses: manusa/actions-setup-minikube@v2.13.0
with:
minikube version: v1.16.0
kubernetes version: ${{ matrix.kubernetes }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Set up Minikube-Kubernetes
uses: manusa/actions-setup-minikube@v2.12.0
uses: manusa/actions-setup-minikube@v2.13.0
with:
minikube version: v1.16.0
kubernetes version: ${{ matrix.kubernetes }}
Expand Down
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<extension>
<groupId>io.quarkus.develocity</groupId>
<artifactId>quarkus-project-develocity-extension</artifactId>
<version>1.1.5</version>
<version>1.1.6</version>
</extension>
</extensions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;

public class JBossThreadsProcessor {

@BuildStep
RuntimeInitializedClassBuildItem build() {
// TODO: Remove once we move to a jboss-threads version that handles this in its native-image.properties file
// see https://github.com/jbossas/jboss-threads/pull/200
return new RuntimeInitializedClassBuildItem("org.jboss.threads.EnhancedQueueExecutor$RuntimeFields");
}
}
69 changes: 69 additions & 0 deletions docs/src/main/asciidoc/websockets-next-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,40 @@ class MyBean {
There are also other convenient methods.
For example, `OpenConnections#findByEndpointId(String)` makes it easy to find connections for a specific endpoint.

==== User data

It is also possible to associate arbitrary user data with a specific connection.
The `io.quarkus.websockets.next.UserData` object obtained by the `WebSocketConnection#userData()` method represents mutable user data associated with a connection.

[source, java]
----
import io.quarkus.websockets.next.WebSocketConnection;
import io.quarkus.websockets.next.UserData.TypedKey;
@WebSocket(path = "/endpoint/{username}")
class MyEndpoint {
@Inject
CoolService service;
@OnOpen
void open(WebSocketConnection connection) {
connection.userData().put(TypedKey.forBoolean("isCool"), service.isCool(connection.pathParam("username"))); <1>
}
@OnTextMessage
String process(String message) {
if (connection.userData().get(TypedKey.forBoolean("isCool"))) { <2>
return "Cool message processed!";
} else {
return "Message processed!";
}
}
}
----
<1> `CoolService#isCool()` returns `Boolean` that is associated with the current connection.
<2> The `TypedKey.forBoolean("isCool")` is the key used to obtain the data stored when the connection was created.

[[server-cdi-events]]
==== CDI events

Expand Down Expand Up @@ -997,6 +1031,41 @@ class MyBean {
There are also other convenient methods.
For example, `OpenClientConnections#findByClientId(String)` makes it easy to find connections for a specific endpoint.

==== User data

It is also possible to associate arbitrary user data with a specific connection.
The `io.quarkus.websockets.next.UserData` object obtained by the `WebSocketClientConnection#userData()` method represents mutable user data associated with a connection.

[source, java]
----
import io.quarkus.websockets.next.WebSocketClientConnection;
import io.quarkus.websockets.next.UserData.TypedKey;
@WebSocketClient(path = "/endpoint/{username}")
class MyEndpoint {
@Inject
CoolService service;
@OnOpen
void open(WebSocketClientConnection connection) {
connection.userData().put(TypedKey.forBoolean("isCool"), service.isCool(connection.pathParam("username"))); <1>
}
@OnTextMessage
String process(String message) {
if (connection.userData().get(TypedKey.forBoolean("isCool"))) { <2>
return "Cool message processed!";
} else {
return "Message processed!";
}
}
}
----
<1> `CoolService#isCool()` returns `Boolean` that is associated with the current connection.
<2> The `TypedKey.forBoolean("isCool")` is the key used to obtain the data stored when the connection was created.


[[client-cdi-events]]
==== CDI events

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.LaunchModeBuildItem;
import io.quarkus.devui.spi.page.CardPageBuildItem;
import io.quarkus.devui.spi.page.MenuPageBuildItem;
import io.quarkus.devui.spi.page.ExternalPageBuilder;
import io.quarkus.devui.spi.page.Page;
import io.quarkus.devui.spi.page.WebComponentPageBuilder;
import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem;
Expand All @@ -17,8 +17,7 @@
public class InfoDevUIProcessor {

@BuildStep(onlyIf = IsDevelopment.class)
void create(BuildProducer<MenuPageBuildItem> menuPageProducer,
BuildProducer<CardPageBuildItem> cardPageProducer,
void create(BuildProducer<CardPageBuildItem> cardPageProducer,
NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem,
InfoBuildTimeConfig config,
ManagementInterfaceBuildTimeConfig managementInterfaceBuildTimeConfig,
Expand All @@ -27,25 +26,20 @@ void create(BuildProducer<MenuPageBuildItem> menuPageProducer,
var path = nonApplicationRootPathBuildItem.resolveManagementPath(config.path(),
managementInterfaceBuildTimeConfig, launchModeBuildItem);

MenuPageBuildItem menuBuildItem = new MenuPageBuildItem();

menuBuildItem.addBuildTimeData("infoUrl", path);

WebComponentPageBuilder infoPage = Page.webComponentPageBuilder()
.title("Information")
.icon("font-awesome-solid:circle-info")
.componentLink("qwc-info.js");

menuBuildItem.addPage(infoPage);
menuBuildItem.addPage(Page.externalPageBuilder("Raw")
ExternalPageBuilder rawPage = Page.externalPageBuilder("Raw")
.url(path)
.icon("font-awesome-solid:circle-info")
.isJsonContent());

menuPageProducer.produce(menuBuildItem);
.isJsonContent();

CardPageBuildItem cardBuildItem = new CardPageBuildItem();
cardBuildItem.addBuildTimeData("infoUrl", path);
cardBuildItem.addPage(infoPage);
cardBuildItem.addPage(rawPage);
cardPageProducer.produce(cardBuildItem);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ CardPageBuildItem createCard(NonApplicationRootPathBuildItem nonApplicationRootP
.doNotEmbed()
.url("https://graphql.org/");

cardPageBuildItem.addPage(schemaPage);
cardPageBuildItem.addPage(uiPage);
cardPageBuildItem.addPage(schemaPage);
cardPageBuildItem.addPage(learnLink);

return cardPageBuildItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public CardPageBuildItem pages(NonApplicationRootPathBuildItem nonApplicationRoo

CardPageBuildItem cardPageBuildItem = new CardPageBuildItem();

cardPageBuildItem.addPage(Page.externalPageBuilder("Swagger UI")
.url(uiPath + "/index.html?embed=true", uiPath)
.isHtmlContent()
.icon("font-awesome-solid:signs-post"));

cardPageBuildItem.addPage(Page.externalPageBuilder("Schema yaml")
.url(schemaPath, schemaPath)
.isYamlContent()
Expand All @@ -38,11 +43,6 @@ public CardPageBuildItem pages(NonApplicationRootPathBuildItem nonApplicationRoo
.isJsonContent()
.icon("font-awesome-solid:file-code"));

cardPageBuildItem.addPage(Page.externalPageBuilder("Swagger UI")
.url(uiPath + "/index.html?embed=true", uiPath)
.isHtmlContent()
.icon("font-awesome-solid:signs-post"));

return cardPageBuildItem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ export class QwcExtensions extends observeState(LitElement) {
flex-flow: column wrap;
padding-top: 5px;
}
.float-right {
.float-right {
align-self: flex-end;
}
qwc-extension-link {
cursor: grab;
}
`;

static properties = {
Expand Down Expand Up @@ -199,11 +203,22 @@ export class QwcExtensions extends observeState(LitElement) {
?embed=${page.embed}
externalUrl="${page.metadata.externalUrl}"
dynamicUrlMethodName="${page.metadata.dynamicUrlMethodName}"
webcomponent="${page.componentLink}" >
webcomponent="${page.componentLink}"
draggable="true" @dragstart="${this._handleDragStart}">
</qwc-extension-link>
`)}`;
}

_handleDragStart(event) {
const extensionNamespace = event.currentTarget.getAttribute('namespace');
const pageId = event.currentTarget.getAttribute('path');

const extension = devuiState.cards.active.find(obj => obj.namespace === extensionNamespace);
const page = extension.cardPages.find(obj => obj.id === pageId);
const jsonData = JSON.stringify(page);
event.dataTransfer.setData('application/json', jsonData);
}

_renderInactive(extension){
if(extension.unlisted === "false"){
return html`<qwc-extension
Expand Down
Loading

0 comments on commit c97b211

Please sign in to comment.