Skip to content

Commit 4888304

Browse files
committed
Merge branch 'docs/restructure-native-executable-guide' of https://github.com/KohiiTM/quarkus into docs/restructure-native-executable-guide
2 parents 54cee2e + c9132ac commit 4888304

File tree

64 files changed

+1411
-390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1411
-390
lines changed

bom/application/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<angus-activation.version>2.0.2</angus-activation.version>
1818
<angus-mail.version>2.0.4</angus-mail.version> <!-- keep in sync with angus-activation (mail depends on activation) -->
1919
<bouncycastle.version>1.81</bouncycastle.version>
20-
<bouncycastle.fips.version>1.0.2.5</bouncycastle.fips.version>
21-
<bouncycastle.tls.fips.version>1.0.19</bouncycastle.tls.fips.version>
20+
<bouncycastle.fips.version>2.1.1</bouncycastle.fips.version>
21+
<bouncycastle.tls.fips.version>2.1.20</bouncycastle.tls.fips.version>
2222
<cyclonedx.version>9.0.5</cyclonedx.version>
2323
<expressly.version>6.0.0</expressly.version>
2424
<findbugs.version>3.0.2</findbugs.version>
@@ -99,9 +99,9 @@
9999
hibernate-search.version, antlr.version, bytebuddy.version -->
100100
<narayana.version>7.2.2.Final</narayana.version>
101101
<narayana-lra.version>1.0.1.Final</narayana-lra.version>
102-
<agroal.version>2.7.1</agroal.version>
102+
<agroal.version>2.8</agroal.version>
103103
<jboss-transaction-spi.version>8.0.0.Final</jboss-transaction-spi.version>
104-
<elasticsearch-opensource-components.version>9.1.0</elasticsearch-opensource-components.version>
104+
<elasticsearch-opensource-components.version>9.1.2</elasticsearch-opensource-components.version>
105105
<rxjava.version>2.2.21</rxjava.version>
106106
<wildfly.openssl-java.version>2.2.5.Final</wildfly.openssl-java.version>
107107
<wildfly.openssl-linux.version>2.2.2.SP01</wildfly.openssl-linux.version>
@@ -160,7 +160,7 @@
160160
<maven-invoker.version>3.2.0</maven-invoker.version>
161161
<awaitility.version>4.3.0</awaitility.version>
162162
<jboss-logmanager.version>3.1.2.Final</jboss-logmanager.version>
163-
<flyway.version>11.11.0</flyway.version>
163+
<flyway.version>11.11.1</flyway.version>
164164
<yasson.version>3.0.4</yasson.version>
165165
<!-- liquibase-mongodb is not released everytime with liquibase anymore, but the two versions need to be compatible -->
166166
<liquibase.version>4.33.0</liquibase.version>
@@ -207,7 +207,7 @@
207207
<jansi.version>2.4.0</jansi.version> <!-- Keep in sync with aesh-readline and dekorate -->
208208
<!-- these two artifacts needs to be compatible together -->
209209
<strimzi-oauth.version>0.16.1</strimzi-oauth.version>
210-
<strimzi-oauth.nimbus.version>10.4.1</strimzi-oauth.nimbus.version>
210+
<strimzi-oauth.nimbus.version>10.4.2</strimzi-oauth.nimbus.version>
211211
<jose4j.version>0.9.6</jose4j.version>
212212
<java-buildpack-client.version>0.0.14</java-buildpack-client.version>
213213
<crac.version>1.5.0</crac.version>

bom/dev-ui/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<description>Dependency management for dev-ui. Importable by third party extension developers.</description>
1414

1515
<properties>
16-
<vaadin.version>24.8.4</vaadin.version>
16+
<vaadin.version>24.8.5</vaadin.version>
1717
<lit.version>3.3.1</lit.version>
1818
<lit-element.version>4.2.1</lit-element.version>
1919
<lit-html.version>3.3.1</lit-html.version>

build-parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<volume.access.modifier>:Z</volume.access.modifier>
7474

7575
<!-- Defaults for integration tests -->
76-
<elasticsearch-server.version>9.1.0</elasticsearch-server.version>
76+
<elasticsearch-server.version>9.1.2</elasticsearch-server.version>
7777
<elasticsearch.image>docker.io/elastic/elasticsearch:${elasticsearch-server.version}</elasticsearch.image>
7878
<logstash.image>docker.io/elastic/logstash:${elasticsearch-server.version}</logstash.image>
7979
<kibana.image>docker.io/elastic/kibana:${elasticsearch-server.version}</kibana.image>

core/deployment/src/main/java/io/quarkus/deployment/builditem/AdditionalIndexedClassesBuildItem.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.quarkus.deployment.builditem;
22

3-
import java.util.Collections;
43
import java.util.Set;
54

65
import io.quarkus.builder.item.MultiBuildItem;
@@ -18,7 +17,7 @@ public AdditionalIndexedClassesBuildItem(String... classesToIndex) {
1817
}
1918

2019
public AdditionalIndexedClassesBuildItem(String classToIndex) {
21-
this.classesToIndex = Collections.singleton(classToIndex);
20+
this.classesToIndex = Set.of(classToIndex);
2221
}
2322

2423
public Set<String> getClassesToIndex() {

core/deployment/src/main/java/io/quarkus/deployment/configuration/ConfigMappingUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static io.smallrye.config.ConfigMappings.ConfigClass.configClass;
44
import static org.jboss.jandex.AnnotationTarget.Kind.CLASS;
55

6-
import java.util.Collections;
76
import java.util.HashSet;
87
import java.util.List;
98
import java.util.Optional;
@@ -222,7 +221,7 @@ private static Set<Type> collectTypes(CombinedIndexBuildItem combinedIndex, Clas
222221
DotName configIfaceName = DotName.createSimple(configClass.getName());
223222
ClassInfo configIfaceInfo = index.getClassByName(configIfaceName);
224223
if ((configIfaceInfo == null) || configIfaceInfo.interfaceNames().isEmpty()) {
225-
return Collections.singleton(Type.create(configIfaceName, Type.Kind.CLASS));
224+
return Set.of(Type.create(configIfaceName, Type.Kind.CLASS));
226225
}
227226

228227
Set<DotName> allIfaces = new HashSet<>();

devtools/cli/src/main/java/io/quarkus/cli/config/Encrypt.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public Integer call() throws Exception {
5151
encryptionKey = encodeToString(generateEncryptionKey().getEncoded());
5252
generatedKey = true;
5353
} else {
54+
if (encryptionKey.startsWith("\\\"") && encryptionKey.endsWith("\"\\")) {
55+
encryptionKey = encryptionKey.substring(2, encryptionKey.length() - 2);
56+
}
57+
5458
if (encryptionKeyFormat.equals(KeyFormat.base64)) {
5559
encryptionKey = encodeToString(encryptionKey.getBytes());
5660
}

devtools/cli/src/main/java/io/quarkus/cli/config/SetConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ public Integer call() throws Exception {
4646
value = findKey(lines, name).getValue();
4747
}
4848
args.add(value);
49-
if (value == null || value.length() == 0) {
49+
if (value == null || value.isEmpty()) {
5050
output.error("Cannot encrypt an empty value");
5151
return -1;
5252
}
5353

5454
ConfigValue encryptionKey = findKey(lines, "smallrye.config.secret-handler.aes-gcm-nopadding.encryption-key");
5555
if (encryptionKey.getValue() != null) {
56-
args.add("--key=" + encryptionKey.getValue());
56+
args.add("--key=\\\"" + encryptionKey.getValue() + "\"\\");
5757
}
5858
ConfigValue encryptionDecode = findKey(lines,
5959
"smallrye.config.secret-handler.aes-gcm-nopadding.encryption-key-decode");

docs/src/main/asciidoc/dev-mcp.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ include::_attributes.adoc[]
1212
[IMPORTANT]
1313
.Experimental
1414
====
15-
This feature is currently experimental. To enable it, set `quarkus.dev-mcp.enabled=true` in your application properties.
15+
This feature is currently experimental.
1616
====
1717

1818
== Overview
@@ -22,11 +22,13 @@ It presents the methods used by the DevUI *MCP tools* (methods you can call) and
2222

2323
=== Connecting an MCP client
2424

25-
Open the **Dev MCP** menu in the Dev UI to see the MCP server’s URL. (Default `http://localhost:8080/q/dev-mcp`).
25+
Open the **Dev UI** settings dialog and select the Dev MCP tab.
26+
There you can enable Dev MCP, get the connection details (Default `http://localhost:8080/q/dev-mcp`) and see what clients are connected.
27+
2628
Any MCP client that supports the https://modelcontextprotocol.io/specification/2025-03-26[Streamable Protocol, version 2025‑03‑26] can connect using that URL.
27-
After a client connects, it appears on the *MCP Info* page of the Dev UI.
29+
After a client connects, it will appears on the tab:
2830

29-
image::dev_mcp_info_screen.png[Dev MCP Info, width=100%]
31+
image::dev_mcp_settings.png[Dev MCP Settings]
3032

3133
== Guide for extension developers
3234

docs/src/main/asciidoc/dev-ui.adoc

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The basic layout has the following parts:
3535
- Page
3636
- Footer
3737
- Card
38+
- Settings
3839

3940
Below is a visual overview of the layout:
4041

@@ -144,6 +145,18 @@ TIP: Clicking a page link inside a card navigates to a dedicated UI page for tha
144145

145146
Extensions are free to customize their cards and add interactive behaviors based on what they provide at runtime.
146147

148+
==== Settings
149+
150+
image::devui_layout_settings.png[Dev UI Settings]
151+
152+
The settings page is a dialog that contains settings for Dev UI:
153+
154+
- Theme (Change between Desktop/Light/Dark
155+
- Bugs / Feature requests
156+
- Storage (Manage local browser storage used in Dev UI)
157+
- Dev MCP (Enable your Dev Mode to expose a MCP Server)
158+
- ... and more... (Other extensions might add to this)
159+
147160
== Guide for Extension Developers
148161

149162
Quarkus extensions can enhance the developer experience by contributing to the Dev UI. The rest of this guide outlines how to integrate your extension into the Dev UI, covering metadata configuration, adding pages to the card, menu, and footer, and best practices for dynamic content.
@@ -193,6 +206,8 @@ Extensions can contribute interactive pages to the Dev UI in the following areas
193206
- **Card**: Add links to pages directly on the extension card.
194207
- **Footer**: Add tabs to the footer for logs or other runtime information.
195208
- **Menu**: Add pages to the Dev UI's left-hand menu.
209+
- **Settings**: Add a tab to the settings dialog
210+
- **Unlisted**: Pages that are not listed anywhere above, but are added to the router and can be linked to.
196211

197212
==== Card
198213

@@ -373,6 +388,99 @@ The key will be scoped automatically, so you do not have to prefix any namespace
373388

374389
image::devui_jokes_light.png[Dev UI Jokes, width=100%]
375390

391+
==== Settings
392+
393+
To add a tab to the Dev UI settings dialog, produce a `SettingPageBuildItem`:
394+
395+
[source,java]
396+
----
397+
@BuildStep(onlyIf = IsLocalDevelopment.class) // <1>
398+
void createMCPSettingsTab(BuildProducer<SettingPageBuildItem> settingPageProducer) {
399+
400+
SettingPageBuildItem mcpSettingTab = new SettingPageBuildItem("Dev MCP");// <2>
401+
402+
mcpSettingTab.addPage(Page.webComponentPageBuilder() // <3>
403+
.title("Dev MCP")// <4>
404+
.icon("font-awesome-solid:robot") // <5>
405+
.componentLink("qwc-dev-mcp-setting.js")); // <6>
406+
settingPageProducer.produce(mcpSettingTab);
407+
}
408+
}
409+
----
410+
<1> Always make sure that this build step is only run when in local dev mode.
411+
<2> To add anything on the settings tab, you must return/produce a `SettingPageBuildItem`.
412+
<3> To add a tab in the setting dialog, you can use the `addPage` method.
413+
<4> You can (optionally) add the title, else it will be derived from the component link.
414+
<5> You can add an icon. All free font-awesome icons are available.
415+
<6> Add the link to the web component source (`js`) file in `deployment/src/main/resources/dev-ui/`. This has to take the format of qwc-extensionname-pagename.js
416+
417+
This page will will be loaded as the content for that tab in the settings dialog
418+
419+
===== Optional: Build Time Data
420+
421+
You can pass data gathered during build to the Page (js):
422+
423+
[source,java]
424+
----
425+
mcpSettingTab.addBuildTimeData("key", values);
426+
----
427+
428+
You can add multiple of these key-value pairs for all the data you know at build time that you need on the page.
429+
430+
==== Unlisted Page
431+
432+
Lastly, you can add pages that is not listed anywhere, but added to the Router, and can be navigated to. This is usefull if you are building very complex pages that navigates to more pages.
433+
434+
To do this, produce a `UnlistedPageBuildItem`:
435+
436+
[source,java]
437+
----
438+
@BuildStep(onlyIf = IsLocalDevelopment.class) // <1>
439+
void createMCPUnlistedPages(BuildProducer<UnlistedPageBuildItem> unlistedPageProducer) {
440+
441+
UnlistedPageBuildItem mcpOtherPages = new UnlistedPageBuildItem("Dev MCP"); // <2>
442+
443+
mcpOtherPages.addPage(Page.webComponentPageBuilder() // <3>
444+
.title("Tools") // <4>
445+
.icon("font-awesome-solid:screwdriver-wrench") // <5>
446+
.componentLink("qwc-dev-mcp-tools.js")); // <6>
447+
unlistedPageProducer.produce(mcpOtherPages);
448+
}
449+
}
450+
----
451+
<1> Always make sure that this build step is only run when in local dev mode.
452+
<2> To add an unlisted page, you must return/produce a `UnlistedPageBuildItem`.
453+
<3> Use the `addPage` method.
454+
<4> You can (optionally) add the title, else it will be derived from the component link.
455+
<5> You can add an icon. All free font-awesome icons are available.
456+
<6> Add the link to the web component source (`js`) file in `deployment/src/main/resources/dev-ui/`. This has to take the format of qwc-extensionname-pagename.js
457+
458+
This page will will be registered to the Router and can be nagigated to by a normal link or using the Router:
459+
460+
[source,javascript]
461+
----
462+
import { RouterController } from 'router-controller'; // <1>
463+
464+
// ...
465+
466+
routerController = new RouterController(this); // <2>
467+
468+
// ...
469+
470+
let unlistedPages = this.routerController.getPagesForCurrentNamespace(); // <3>
471+
// or if you not in your own space
472+
// let unlistedPages = this.routerController.getPagesForNamespace("your namespace"); // <4>
473+
474+
// ... loop over page
475+
this.routerController.go(page); // <5>
476+
----
477+
<1> Import the RouterController
478+
<2> Create a new instance passing in this to scope it to your namespace
479+
<3> Get all pages of your namespace
480+
<4> Or if you are on another page (not one of yours) you can get the pages for your namespace
481+
<5> Then you can loop over the pages and build the links/buttons. To actions the navigation your use the go method
482+
483+
376484
==== Building Web Components
377485

378486
Dev UI uses https://lit.dev/[Lit] to make building these web components easier. You can read more about Web Components and Lit:
@@ -662,6 +770,42 @@ this.storageControl.set('height', 123); // Set some val
662770

663771
https://github.com/quarkusio/quarkus/blob/main/extensions/devui/resources/src/main/resources/dev-ui/qwc/qwc-footer.js[Example code]
664772

773+
======= Per Application
774+
775+
You can narrow the score of the storage further by the current application:
776+
777+
[source,javascript]
778+
----
779+
storageControl = new StorageController(this, true); // Passing in true will scope per application
780+
----
781+
782+
======= Storage Setting
783+
784+
Users can have a raw view on the storage in the settings page:
785+
786+
image::dev-ui-storage-settings.png[alt=Dev UI Storage Settings,role="center"]
787+
788+
Because users can clean/revert to default in this screen by deleting the storage item, an extension might want to react on this:
789+
790+
[source,javascript]
791+
----
792+
connectedCallback() {
793+
super.connectedCallback();
794+
window.addEventListener('storage-changed', this._storageChange); // Listen for storage changes
795+
}
796+
797+
disconnectedCallback() {
798+
window.removeEventListener('storage-changed', this._storageChange); // Clean up
799+
super.disconnectedCallback();
800+
}
801+
802+
_storageChange = (e) => {
803+
if(e.detail.method === "remove" && e.detail.key.startsWith("qwc-myextensionname-")){ // Only care about remove and your extension
804+
// React on storage removal
805+
}
806+
}
807+
808+
----
665809

666810
====== Log
667811

37.2 KB
Loading

0 commit comments

Comments
 (0)