This is an automated email from the ASF dual-hosted git repository.

papegaaij pushed a commit to branch islands
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 70199465c45543a5afeaba43243b487fb9ce0261
Author: Emond Papegaaij <[email protected]>
AuthorDate: Thu Nov 5 16:55:10 2026 +0100

    Add Wicket Islands, an experimental module for JavaScript framework 
components
    
    Wicket has no supported way to embed components written for a client-side
    framework such as React, Vue or Angular. Applications glue them in by hand:
    state passed through data attributes or inline scripts, server calls
    through custom behaviors, results returned through evaluated JavaScript.
    
    The new experimental module wicket-islands makes such a component the
    client-side peer of a Wicket component. An Island renders a host element
    with its type, a key that identifies it across re-renders, and its state:
    the props from its model as JSON, escaped for the script element they are
    written into, and the Ajax attributes for calling back. Calls registered
    with onCall run in the context of the component as Wicket Ajax requests,
    so a handler can update other components through the request target; the
    result, or a structured failure (invalid, forbidden, error), is returned
    as a data entry of the Ajax response. Payloads are deserialized by a
    pluggable serializer, Jackson by default, which rejects properties the
    request type does not declare.
    
    The client-side modules come from a Vite build: in production from its
    manifest on the classpath, with the built files served by a resource that
    serves only files listed in the manifest; in development optionally from
    a Vite dev server.
    
    The module is new and changes no existing API. The client-side runtime,
    the React adapter and an example follow separately.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 pom.xml                                            |   6 +
 wicket-experimental/pom.xml                        |   1 +
 wicket-experimental/{ => wicket-islands}/pom.xml   |  38 ++--
 .../wicket-islands/src/main/java/module-info.java  |  29 +++
 .../java/org/apache/wicket/islands/Island.java     | 251 +++++++++++++++++++++
 .../java/org/apache/wicket/islands/IslandCall.java |  97 ++++++++
 .../apache/wicket/islands/IslandCallConsumer.java  |  38 ++++
 .../apache/wicket/islands/IslandCallHandler.java   |  41 ++++
 .../islands/IslandCallRejectedException.java       |  53 +++++
 .../wicket/islands/IslandEndpointBehavior.java     | 123 ++++++++++
 .../java/org/apache/wicket/islands/IslandJson.java |  55 +++++
 .../org/apache/wicket/islands/IslandSettings.java  | 218 ++++++++++++++++++
 .../islands/modules/IIslandModuleLoader.java       |  37 +++
 .../islands/modules/IslandAssetResource.java       | 119 ++++++++++
 .../islands/modules/ViteDevServerModuleLoader.java |  56 +++++
 .../wicket/islands/modules/ViteManifest.java       | 195 ++++++++++++++++
 .../islands/modules/ViteManifestModuleLoader.java  | 142 ++++++++++++
 .../islands/serializer/IIslandSerializer.java      |  57 +++++
 .../serializer/IslandSerializationException.java   |  40 ++++
 .../serializer/JacksonIslandSerializer.java        |  88 ++++++++
 .../wicket/islands/IslandAssetResourceTest.java    |  66 ++++++
 .../org/apache/wicket/islands/IslandCallTest.java  | 118 ++++++++++
 .../wicket/islands/IslandDeploymentModeTest.java   |  50 ++++
 .../apache/wicket/islands/IslandDevServerTest.java |  49 ++++
 .../org/apache/wicket/islands/IslandJsonTest.java  |  41 ++++
 .../apache/wicket/islands/IslandRenderTest.java    | 152 +++++++++++++
 .../org/apache/wicket/islands/IslandTestCase.java  | 114 ++++++++++
 .../org/apache/wicket/islands/IslandTestPage.html  |   6 +
 .../org/apache/wicket/islands/IslandTestPage.java  |  75 ++++++
 .../wicket/islands/IslandWithoutBuildTest.java     |  44 ++++
 .../serializer/JacksonIslandSerializerTest.java    |  62 +++++
 .../islands/testbuild/assets/shared-aaa111.css     |   1 +
 .../islands/testbuild/assets/shared-xyz789.js      |   1 +
 .../islands/testbuild/assets/test-island-abc123.js |   1 +
 .../testbuild/assets/test-island-def456.css        |   1 +
 .../apache/wicket/islands/testbuild/manifest.json  |  15 ++
 36 files changed, 2467 insertions(+), 13 deletions(-)

diff --git a/pom.xml b/pom.xml
index afa5354162..0bd162198e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -495,6 +495,12 @@
                                <version>12.0.0-SNAPSHOT</version>
                                <type>jar</type>
                        </dependency>
+                       <dependency>
+                               
<groupId>org.apache.wicket.experimental.wicket12</groupId>
+                               <artifactId>wicket-islands</artifactId>
+                               <version>12.0.0-SNAPSHOT</version>
+                               <type>jar</type>
+                       </dependency>
                        <dependency>
                                
<groupId>org.apache.wicket.experimental.wicket12</groupId>
                                <artifactId>wicket-metrics</artifactId>
diff --git a/wicket-experimental/pom.xml b/wicket-experimental/pom.xml
index f4bd184745..207d469487 100644
--- a/wicket-experimental/pom.xml
+++ b/wicket-experimental/pom.xml
@@ -29,6 +29,7 @@
        <name>Wicket-Experimental</name>
        <description>Wicket-Experimental contains experimental Wicket modules 
that may or may not be supported in the future.</description>
        <modules>
+               <module>wicket-islands</module>
                <module>wicket-metrics</module>
        </modules>
 
diff --git a/wicket-experimental/pom.xml 
b/wicket-experimental/wicket-islands/pom.xml
similarity index 59%
copy from wicket-experimental/pom.xml
copy to wicket-experimental/wicket-islands/pom.xml
index f4bd184745..a15faf5db8 100644
--- a/wicket-experimental/pom.xml
+++ b/wicket-experimental/wicket-islands/pom.xml
@@ -18,21 +18,33 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
        <modelVersion>4.0.0</modelVersion>
        <parent>
-               <groupId>org.apache.wicket</groupId>
-               <artifactId>wicket-parent</artifactId>
+               <groupId>org.apache.wicket.experimental.wicket12</groupId>
+               <artifactId>wicket-experimental</artifactId>
                <version>12.0.0-SNAPSHOT</version>
                <relativePath>../pom.xml</relativePath>
        </parent>
-       <groupId>org.apache.wicket.experimental.wicket12</groupId>
-       <artifactId>wicket-experimental</artifactId>
-       <packaging>pom</packaging>
-       <name>Wicket-Experimental</name>
-       <description>Wicket-Experimental contains experimental Wicket modules 
that may or may not be supported in the future.</description>
-       <modules>
-               <module>wicket-metrics</module>
-       </modules>
+       <artifactId>wicket-islands</artifactId>
+       <version>12.0.0-SNAPSHOT</version>
+       <packaging>jar</packaging>
+       <name>Wicket Islands</name>
+       <description>
+               Embeds components of JavaScript frameworks such as React, Vue 
and Angular in Wicket pages,
+               as client-side peers of Wicket components.
+       </description>
 
-       <properties>
-               <japicmp.skip>true</japicmp.skip>
-       </properties>
+       <dependencies>
+               <dependency>
+                       <groupId>org.apache.wicket</groupId>
+                       <artifactId>wicket-core</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>tools.jackson.core</groupId>
+                       <artifactId>jackson-databind</artifactId>
+                       <optional>false</optional>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.wicket</groupId>
+                       <artifactId>wicket-tester</artifactId>
+               </dependency>
+       </dependencies>
 </project>
diff --git a/wicket-experimental/wicket-islands/src/main/java/module-info.java 
b/wicket-experimental/wicket-islands/src/main/java/module-info.java
new file mode 100644
index 0000000000..1157b6e8a2
--- /dev/null
+++ b/wicket-experimental/wicket-islands/src/main/java/module-info.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+module org.apache.wicket.islands {
+    requires org.slf4j;
+    requires tools.jackson.databind;
+    requires org.apache.wicket.util;
+    requires org.apache.wicket.request;
+    requires org.apache.wicket.core;
+
+    exports org.apache.wicket.islands;
+    exports org.apache.wicket.islands.modules;
+    exports org.apache.wicket.islands.serializer;
+
+    opens org.apache.wicket.islands.modules to tools.jackson.databind;
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/Island.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/Island.java
new file mode 100644
index 0000000000..340d3c2684
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/Island.java
@@ -0,0 +1,251 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.regex.Pattern;
+
+import org.apache.wicket.IGenericComponent;
+import org.apache.wicket.islands.serializer.IIslandSerializer;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.MarkupStream;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.html.WebComponent;
+import org.apache.wicket.markup.parser.XmlTag.TagType;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.util.io.IClusterable;
+import org.apache.wicket.util.lang.Args;
+
+/**
+ * A component whose body is rendered in the browser by a JavaScript framework 
component, its
+ * client-side peer.
+ * <p>
+ * The island renders an empty host element that names its type. The 
client-side runtime mounts
+ * the framework component registered for that type into it, and hands it the 
island's props: the
+ * object of the island's model, converted to JSON. Calls registered with 
{@code onCall} can be
+ * invoked by the peer; they run on the server in the context of this 
component, under the page
+ * lock, and travel as Wicket Ajax requests, so a handler can update other 
components through
+ * {@link IslandCall#getTarget()}.
+ * <p>
+ * <strong>The props are written into the page, where the user can read 
them.</strong> The model
+ * should hold an explicit projection made for the client, never a domain 
object with fields the
+ * user must not see. The JSON is escaped for the <code>&lt;script&gt;</code> 
element it is
+ * written into.
+ * <p>
+ * <strong>Call payloads come from the browser and are untrusted.</strong> A 
request type should
+ * contain only what the interaction may change; the handler validates it and 
applies it to the
+ * server-side state.
+ *
+ * @param <P>
+ *            the type of the props
+ * @since 12.0.0
+ */
+public class Island<P> extends WebComponent implements IGenericComponent<P, 
Island<P>>
+{
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * The attribute holding the island type.
+        */
+       public static final String ATTR_TYPE = "data-wicket-island";
+
+       /**
+        * The attribute holding the island key, which identifies the island 
across re-renders.
+        */
+       public static final String ATTR_KEY = "data-wicket-island-key";
+
+       /**
+        * The attribute marking the script element holding the island's state.
+        */
+       public static final String ATTR_STATE = "data-wicket-island-state";
+
+       /**
+        * The attribute marking the element the client-side peer is mounted 
into.
+        */
+       public static final String ATTR_ROOT = "data-wicket-island-root";
+
+       private static final Pattern TYPE_PATTERN = 
Pattern.compile("[A-Za-z0-9_-]+");
+
+       private record Endpoint(Class<?> requestType, IslandCallHandler<Object, 
Object> handler)
+               implements IClusterable
+       {
+       }
+
+       private final String type;
+
+       private final String key;
+
+       private final Map<String, Endpoint> endpoints = new LinkedHashMap<>();
+
+       private final IslandEndpointBehavior endpointBehavior;
+
+       /**
+        * @param id
+        *            the component id
+        * @param type
+        *            the island type, naming the client-side module; letters, 
digits, '-' and '_'
+        * @param props
+        *            the model of the props
+        */
+       public Island(String id, String type, IModel<P> props)
+       {
+               super(id, props);
+               Args.notNull(type, "type");
+               if (!TYPE_PATTERN.matcher(type).matches())
+               {
+                       throw new IllegalArgumentException("Invalid island type 
'" + type +
+                               "': use letters, digits, '-' and '_'");
+               }
+               this.type = type;
+               key = Long.toString(ThreadLocalRandom.current().nextLong() & 
Long.MAX_VALUE, 36);
+               setOutputMarkupId(true);
+               endpointBehavior = new IslandEndpointBehavior();
+               add(endpointBehavior);
+       }
+
+       /**
+        * @return the island type
+        */
+       public final String getType()
+       {
+               return type;
+       }
+
+       /**
+        * @return the key identifying this island instance across re-renders
+        */
+       public final String getKey()
+       {
+               return key;
+       }
+
+       /**
+        * Registers a call that returns a result.
+        *
+        * @param <Q>
+        *            the request type
+        * @param <R>
+        *            the result type
+        * @param name
+        *            the name the client calls
+        * @param requestType
+        *            the request type, {@link Void} for a call without payload
+        * @param resultType
+        *            the result type
+        * @param handler
+        *            the handler
+        * @return {@code this}
+        */
+       @SuppressWarnings("unchecked")
+       public final <Q, R> Island<P> onCall(String name, Class<Q> requestType, 
Class<R> resultType,
+               IslandCallHandler<Q, R> handler)
+       {
+               Args.notEmpty(name, "name");
+               Args.notNull(requestType, "requestType");
+               Args.notNull(resultType, "resultType");
+               Args.notNull(handler, "handler");
+               endpoints.put(name, new Endpoint(requestType, 
(IslandCallHandler<Object, Object>)handler));
+               return this;
+       }
+
+       /**
+        * Registers a call that returns no result.
+        *
+        * @param <Q>
+        *            the request type
+        * @param name
+        *            the name the client calls
+        * @param requestType
+        *            the request type, {@link Void} for a call without payload
+        * @param handler
+        *            the handler
+        * @return {@code this}
+        */
+       public final <Q> Island<P> onCall(String name, Class<Q> requestType,
+               IslandCallConsumer<Q> handler)
+       {
+               Args.notNull(handler, "handler");
+               return onCall(name, requestType, Void.class, (request, call) -> 
{
+                       handler.handle(request, call);
+                       return null;
+               });
+       }
+
+       Object invoke(String name, String payload, IslandCall call)
+       {
+               Endpoint endpoint = endpoints.get(name);
+               if (endpoint == null)
+               {
+                       throw new IslandCallRejectedException("Unknown call '" 
+ name + "'.");
+               }
+
+               Object request = null;
+               if (endpoint.requestType() != Void.class)
+               {
+                       if (payload != null)
+                       {
+                               request = getSerializer().fromJson(payload, 
endpoint.requestType());
+                       }
+                       if (request == null)
+                       {
+                               throw new IslandCallRejectedException("The call 
has no payload.");
+                       }
+               }
+               return endpoint.handler().handle(request, call);
+       }
+
+       @Override
+       protected void onComponentTag(ComponentTag tag)
+       {
+               super.onComponentTag(tag);
+
+               if (tag.isOpenClose())
+               {
+                       tag.setType(TagType.OPEN);
+               }
+               tag.put(ATTR_TYPE, type);
+               tag.put(ATTR_KEY, key);
+       }
+
+       @Override
+       public void onComponentTagBody(MarkupStream markupStream, ComponentTag 
openTag)
+       {
+               IIslandSerializer serializer = getSerializer();
+               String state = "{\"props\":" + 
serializer.toJson(getModelObject()) + ",\"calls\":" +
+                       serializer.toJson(endpoints.keySet()) + ",\"ajax\":" +
+                       endpointBehavior.renderAttributes() + "}";
+
+               replaceComponentTagBody(markupStream, openTag,
+                       "<script type=\"application/json\" " + ATTR_STATE + ">" 
+
+                               IslandJson.escapeForScript(state) + 
"</script><div " + ATTR_ROOT + "></div>");
+       }
+
+       @Override
+       public void renderHead(IHeaderResponse response)
+       {
+               super.renderHead(response);
+
+               IslandSettings.get().getModuleLoader().renderHead(type, 
response);
+       }
+
+       private IIslandSerializer getSerializer()
+       {
+               return IslandSettings.get().getSerializer();
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCall.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCall.java
new file mode 100644
index 0000000000..907ff9d7c2
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCall.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+
+/**
+ * The context of one island call, handed to its handler.
+ *
+ * @since 12.0.0
+ */
+public final class IslandCall
+{
+       private final Island<?> island;
+
+       private final AjaxRequestTarget target;
+
+       private final List<String> invalidations = new ArrayList<>();
+
+       IslandCall(Island<?> island, AjaxRequestTarget target)
+       {
+               this.island = island;
+               this.target = target;
+       }
+
+       /**
+        * @return the island that was called
+        */
+       public Island<?> getIsland()
+       {
+               return island;
+       }
+
+       /**
+        * The target of the Ajax request the call travels in. Components added 
to it are updated on the
+        * client before the call's result is delivered, also when the call is 
rejected.
+        *
+        * @return the Ajax request target
+        */
+       public AjaxRequestTarget getTarget()
+       {
+               return target;
+       }
+
+       /**
+        * Creates the exception that rejects this call. Throw it:
+        *
+        * <pre>
+        * throw call.reject("The game is over.");
+        * </pre>
+        *
+        * @param messages
+        *            the messages for the client
+        * @return the exception to throw
+        */
+       public IslandCallRejectedException reject(String... messages)
+       {
+               return new IslandCallRejectedException(messages);
+       }
+
+       /**
+        * Marks client-side query keys as stale, so every island on the page 
that shows data under one
+        * of them fetches it again.
+        *
+        * @param keys
+        *            the query keys
+        * @return {@code this}
+        */
+       public IslandCall invalidate(String... keys)
+       {
+               Collections.addAll(invalidations, keys);
+               return this;
+       }
+
+       List<String> getInvalidations()
+       {
+               return invalidations;
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallConsumer.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallConsumer.java
new file mode 100644
index 0000000000..d071dc2509
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallConsumer.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import org.apache.wicket.util.io.IClusterable;
+
+/**
+ * Handles an island call that returns no result.
+ *
+ * @param <Q>
+ *            the request type
+ * @since 12.0.0
+ */
+@FunctionalInterface
+public interface IslandCallConsumer<Q> extends IClusterable
+{
+       /**
+        * @param request
+        *            the request, deserialized from untrusted client input
+        * @param call
+        *            the call's context
+        */
+       void handle(Q request, IslandCall call);
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallHandler.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallHandler.java
new file mode 100644
index 0000000000..c250d61140
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallHandler.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import org.apache.wicket.util.io.IClusterable;
+
+/**
+ * Handles an island call that returns a result.
+ *
+ * @param <Q>
+ *            the request type
+ * @param <R>
+ *            the result type
+ * @since 12.0.0
+ */
+@FunctionalInterface
+public interface IslandCallHandler<Q, R> extends IClusterable
+{
+       /**
+        * @param request
+        *            the request, deserialized from untrusted client input
+        * @param call
+        *            the call's context
+        * @return the result for the client
+        */
+       R handle(Q request, IslandCall call);
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallRejectedException.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallRejectedException.java
new file mode 100644
index 0000000000..b9483b4f07
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandCallRejectedException.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Thrown to reject an island call. The client's call fails with the kind 
<code>invalid</code> and
+ * the given messages; whatever the handler added to the Ajax request target 
before rejecting is
+ * still sent.
+ *
+ * @see IslandCall#reject(String...)
+ * @since 12.0.0
+ */
+public class IslandCallRejectedException extends RuntimeException
+{
+       private static final long serialVersionUID = 1L;
+
+       private final List<String> messages;
+
+       /**
+        * @param messages
+        *            the messages for the client
+        */
+       public IslandCallRejectedException(String... messages)
+       {
+               super(String.join("; ", messages), null, false, false);
+               this.messages = List.copyOf(Arrays.asList(messages));
+       }
+
+       /**
+        * @return the messages for the client
+        */
+       public List<String> getMessages()
+       {
+               return messages;
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandEndpointBehavior.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandEndpointBehavior.java
new file mode 100644
index 0000000000..5198dce4a9
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandEndpointBehavior.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import java.util.List;
+
+import org.apache.wicket.Application;
+import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
+import org.apache.wicket.ajax.AjaxChannel;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.authorization.AuthorizationException;
+import org.apache.wicket.islands.serializer.IIslandSerializer;
+import org.apache.wicket.islands.serializer.IslandSerializationException;
+import org.apache.wicket.request.IRequestParameters;
+import 
org.apache.wicket.request.RequestHandlerExecutor.ReplaceHandlerException;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Receives the page-bound calls of an island and answers each with a data 
entry carrying the
+ * result or the failure.
+ */
+final class IslandEndpointBehavior extends AbstractDefaultAjaxBehavior
+{
+       private static final long serialVersionUID = 1L;
+
+       private static final Logger LOG = 
LoggerFactory.getLogger(IslandEndpointBehavior.class);
+
+       static final String PARAM_CALL = "island-call";
+
+       static final String PARAM_CALL_ID = "island-call-id";
+
+       static final String PARAM_PAYLOAD = "island-payload";
+
+       static final String DATA_NAME = "wicket-islands";
+
+       @Override
+       protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
+       {
+               super.updateAjaxAttributes(attributes);
+               attributes.setMethod(AjaxRequestAttributes.Method.POST);
+               attributes.setChannel(new AjaxChannel("wicket-island-" + 
getComponent().getMarkupId()));
+       }
+
+       CharSequence renderAttributes()
+       {
+               return renderAjaxAttributes(getComponent());
+       }
+
+       @Override
+       protected void respond(AjaxRequestTarget target)
+       {
+               Island<?> island = (Island<?>)getComponent();
+               IRequestParameters parameters = 
RequestCycle.get().getRequest().getPostParameters();
+               String callId = 
parameters.getParameterValue(PARAM_CALL_ID).toString("");
+               String name = 
parameters.getParameterValue(PARAM_CALL).toString("");
+               String payload = 
parameters.getParameterValue(PARAM_PAYLOAD).toOptionalString();
+
+               IIslandSerializer serializer = 
IslandSettings.get().getSerializer();
+               IslandCall call = new IslandCall(island, target);
+
+               String outcome;
+               try
+               {
+                       Object result = island.invoke(name, payload, call);
+                       outcome = "\"ok\":true,\"value\":" + 
serializer.toJson(result);
+               }
+               catch (IslandCallRejectedException e)
+               {
+                       outcome = failure(serializer, "invalid", 
e.getMessages());
+               }
+               catch (IslandSerializationException e)
+               {
+                       LOG.debug("Island call '{}' on {} failed to 
(de)serialize", name, island.getPath(), e);
+                       outcome = failure(serializer, "invalid",
+                               List.of(detail(e, "The call's payload or result 
could not be converted.")));
+               }
+               catch (AuthorizationException e)
+               {
+                       outcome = failure(serializer, "forbidden", List.of("The 
call is not allowed."));
+               }
+               catch (ReplaceHandlerException e)
+               {
+                       throw e;
+               }
+               catch (RuntimeException e)
+               {
+                       LOG.error("Island call '{}' on {} failed", name, 
island.getPath(), e);
+                       outcome = failure(serializer, "error",
+                               List.of(detail(e, "The call failed on the 
server.")));
+               }
+
+               target.addData(DATA_NAME, "{\"call\":" + 
serializer.toJson(callId) + "," + outcome +
+                       ",\"invalidate\":" + 
serializer.toJson(call.getInvalidations()) + "}");
+       }
+
+       private static String failure(IIslandSerializer serializer, String 
kind, List<String> messages)
+       {
+               return "\"ok\":false,\"error\":{\"kind\":" + 
serializer.toJson(kind) + ",\"messages\":" +
+                       serializer.toJson(messages) + "}";
+       }
+
+       private static String detail(RuntimeException e, String message)
+       {
+               return Application.get().usesDevelopmentConfig() ? message + " 
" + e : message;
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandJson.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandJson.java
new file mode 100644
index 0000000000..480139703c
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandJson.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+/**
+ * JSON helpers.
+ */
+final class IslandJson
+{
+       private IslandJson()
+       {
+       }
+
+       /**
+        * Escapes JSON for the content of a <code>&lt;script&gt;</code> 
element. The characters
+        * replaced can only occur inside JSON strings, where their Unicode 
escapes mean the same.
+        * This makes <code>&lt;/script&gt;</code> and <code>&lt;!--</code> 
impossible in the output.
+        *
+        * @param json
+        *            the JSON text
+        * @return the escaped JSON text
+        */
+       static String escapeForScript(CharSequence json)
+       {
+               StringBuilder escaped = new StringBuilder(json.length() + 16);
+               for (int i = 0; i < json.length(); i++)
+               {
+                       char c = json.charAt(i);
+                       switch (c)
+                       {
+                               case '<' -> escaped.append("\\u003c");
+                               case '>' -> escaped.append("\\u003e");
+                               case '&' -> escaped.append("\\u0026");
+                               case '
' -> escaped.append("\\u2028");
+                               case '
' -> escaped.append("\\u2029");
+                               default -> escaped.append(c);
+                       }
+               }
+               return escaped.toString();
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandSettings.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandSettings.java
new file mode 100644
index 0000000000..afb9256026
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/IslandSettings.java
@@ -0,0 +1,218 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import org.apache.wicket.Application;
+import org.apache.wicket.MetaDataKey;
+import org.apache.wicket.islands.modules.IIslandModuleLoader;
+import org.apache.wicket.islands.modules.IslandAssetResource;
+import org.apache.wicket.islands.modules.ViteDevServerModuleLoader;
+import org.apache.wicket.islands.modules.ViteManifestModuleLoader;
+import org.apache.wicket.islands.serializer.IIslandSerializer;
+import org.apache.wicket.islands.serializer.JacksonIslandSerializer;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.request.resource.ResourceReference;
+import org.apache.wicket.util.lang.Args;
+
+/**
+ * Application-wide settings for islands. Install them once, in
+ * {@link WebApplication#init()}:
+ *
+ * <pre>
+ * IslandSettings.install(this).setDevServerUrl("http://localhost:5173";);
+ * </pre>
+ *
+ * @since 12.0.0
+ */
+public class IslandSettings
+{
+       /**
+        * The default classpath location of the Vite build.
+        */
+       public static final String DEFAULT_BASE_PATH = 
"META-INF/wicket-islands/";
+
+       /**
+        * The default location of the Vite manifest, relative to the base path.
+        */
+       public static final String DEFAULT_MANIFEST_FILE = 
".vite/manifest.json";
+
+       /**
+        * The path the built files are served under.
+        */
+       public static final String MOUNT_PATH = "wicket-islands";
+
+       private static final MetaDataKey<IslandSettings> KEY = new 
MetaDataKey<>()
+       {
+               private static final long serialVersionUID = 1L;
+       };
+
+       private IIslandSerializer serializer = new JacksonIslandSerializer();
+
+       private String basePath = DEFAULT_BASE_PATH;
+
+       private String manifestFile = DEFAULT_MANIFEST_FILE;
+
+       private String devServerUrl;
+
+       private IIslandModuleLoader moduleLoader;
+
+       private volatile ViteManifestModuleLoader manifestModuleLoader;
+
+       /**
+        * Installs the settings in an application and mounts the resource 
serving the built files.
+        *
+        * @param application
+        *            the application
+        * @return the settings, for further configuration
+        */
+       public static IslandSettings install(WebApplication application)
+       {
+               Args.notNull(application, "application");
+
+               IslandSettings settings = new IslandSettings();
+               application.setMetaData(KEY, settings);
+               application.mountResource(MOUNT_PATH,
+                       new ResourceReference(IslandSettings.class, "assets")
+                       {
+                               private static final long serialVersionUID = 1L;
+
+                               @Override
+                               public IResource getResource()
+                               {
+                                       return new 
IslandAssetResource(settings::getManifestModuleLoader);
+                               }
+                       });
+               return settings;
+       }
+
+       /**
+        * @return the settings of the current application
+        * @throws IllegalStateException
+        *             if they have not been installed
+        */
+       public static IslandSettings get()
+       {
+               IslandSettings settings = Application.get().getMetaData(KEY);
+               if (settings == null)
+               {
+                       throw new IllegalStateException(
+                               "Islands are not installed: call 
IslandSettings.install(this) in Application#init()");
+               }
+               return settings;
+       }
+
+       /**
+        * @return the serializer for props, call payloads and results
+        */
+       public IIslandSerializer getSerializer()
+       {
+               return serializer;
+       }
+
+       /**
+        * @param serializer
+        *            the serializer for props, call payloads and results
+        * @return {@code this}
+        */
+       public IslandSettings setSerializer(IIslandSerializer serializer)
+       {
+               this.serializer = Args.notNull(serializer, "serializer");
+               return this;
+       }
+
+       /**
+        * @param basePath
+        *            the classpath location of the Vite build, ending in a 
slash
+        * @return {@code this}
+        */
+       public IslandSettings setBasePath(String basePath)
+       {
+               this.basePath = Args.notEmpty(basePath, "basePath");
+               manifestModuleLoader = null;
+               return this;
+       }
+
+       /**
+        * @param manifestFile
+        *            the location of the Vite manifest, relative to the base 
path
+        * @return {@code this}
+        */
+       public IslandSettings setManifestFile(String manifestFile)
+       {
+               this.manifestFile = Args.notEmpty(manifestFile, "manifestFile");
+               manifestModuleLoader = null;
+               return this;
+       }
+
+       /**
+        * Sets the URL of a Vite dev server to load island modules from. It is 
only used when the
+        * application runs in development mode.
+        *
+        * @param devServerUrl
+        *            the dev server's URL, {@code null} to always use the 
build on the classpath
+        * @return {@code this}
+        */
+       public IslandSettings setDevServerUrl(String devServerUrl)
+       {
+               this.devServerUrl = devServerUrl;
+               return this;
+       }
+
+       /**
+        * @param moduleLoader
+        *            a loader to use instead of the default, {@code null} for 
the default
+        * @return {@code this}
+        */
+       public IslandSettings setModuleLoader(IIslandModuleLoader moduleLoader)
+       {
+               this.moduleLoader = moduleLoader;
+               return this;
+       }
+
+       /**
+        * @return the configured loader; otherwise the dev server loader when 
a dev server is set and
+        *         the application runs in development mode; otherwise the 
loader for the build on the
+        *         classpath
+        */
+       public IIslandModuleLoader getModuleLoader()
+       {
+               if (moduleLoader != null)
+               {
+                       return moduleLoader;
+               }
+               if (devServerUrl != null && 
Application.get().usesDevelopmentConfig())
+               {
+                       return new ViteDevServerModuleLoader(devServerUrl);
+               }
+               return getManifestModuleLoader();
+       }
+
+       /**
+        * @return the loader for the build on the classpath
+        */
+       public ViteManifestModuleLoader getManifestModuleLoader()
+       {
+               ViteManifestModuleLoader loader = manifestModuleLoader;
+               if (loader == null)
+               {
+                       loader = new ViteManifestModuleLoader(basePath, 
manifestFile, MOUNT_PATH + "/");
+                       manifestModuleLoader = loader;
+               }
+               return loader;
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/IIslandModuleLoader.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/IIslandModuleLoader.java
new file mode 100644
index 0000000000..a033b61493
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/IIslandModuleLoader.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.modules;
+
+import org.apache.wicket.markup.head.IHeaderResponse;
+
+/**
+ * Contributes the client-side module of an island type to the page header.
+ *
+ * @since 12.0.0
+ */
+public interface IIslandModuleLoader
+{
+       /**
+        * Renders whatever the browser needs to load the module for an island 
type.
+        *
+        * @param islandType
+        *            the island type
+        * @param response
+        *            the header response to render to
+        */
+       void renderHead(String islandType, IHeaderResponse response);
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/IslandAssetResource.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/IslandAssetResource.java
new file mode 100644
index 0000000000..b6ad6c8c4b
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/IslandAssetResource.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.modules;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.function.Supplier;
+
+import org.apache.wicket.Application;
+import org.apache.wicket.request.http.WebResponse;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.Streams;
+import org.apache.wicket.util.lang.Args;
+
+/**
+ * Serves the files of a Vite production build from the classpath.
+ * <p>
+ * Only files listed in the build's manifest are served; any other path is 
answered with
+ * <code>404</code>, so the resource cannot be used to read other classpath 
entries. Vite gives
+ * built files content-hashed names, so they are cached for as long as 
possible.
+ *
+ * @since 12.0.0
+ */
+public class IslandAssetResource extends AbstractResource
+{
+       private static final long serialVersionUID = 1L;
+
+       private final Supplier<ViteManifestModuleLoader> loader;
+
+       /**
+        * @param loader
+        *            supplies the loader whose build is served
+        */
+       public IslandAssetResource(Supplier<ViteManifestModuleLoader> loader)
+       {
+               this.loader = Args.notNull(loader, "loader");
+       }
+
+       @Override
+       protected ResourceResponse newResourceResponse(Attributes attributes)
+       {
+               ResourceResponse response = new ResourceResponse();
+
+               String path = toPath(attributes.getParameters());
+               ViteManifestModuleLoader current = loader.get();
+               ViteManifest manifest = current.getManifest();
+               URL url = null;
+               if (manifest != null && manifest.getFiles().contains(path))
+               {
+                       url = 
current.getClassLoader().getResource(current.getBasePath() + path);
+               }
+               if (url == null)
+               {
+                       response.setError(404);
+                       return response;
+               }
+
+               response.setContentType(contentType(path));
+               response.setCacheDurationToMaximum();
+               response.setCacheScope(WebResponse.CacheScope.PUBLIC);
+               final URL file = url;
+               response.setWriteCallback(new WriteCallback()
+               {
+                       @Override
+                       public void writeData(Attributes attributes) throws 
IOException
+                       {
+                               try (InputStream in = file.openStream())
+                               {
+                                       Streams.copy(in, 
attributes.getResponse().getOutputStream());
+                               }
+                       }
+               });
+               return response;
+       }
+
+       private static String toPath(PageParameters parameters)
+       {
+               StringBuilder path = new StringBuilder();
+               for (int i = 0; i < parameters.getIndexedCount(); i++)
+               {
+                       if (i > 0)
+                       {
+                               path.append('/');
+                       }
+                       path.append(parameters.get(i).toString(""));
+               }
+               return path.toString();
+       }
+
+       private static String contentType(String path)
+       {
+               if (path.endsWith(".js") || path.endsWith(".mjs"))
+               {
+                       return "text/javascript";
+               }
+               if (path.endsWith(".css"))
+               {
+                       return "text/css";
+               }
+               String mimeType = Application.get().getMimeType(path);
+               return mimeType != null ? mimeType : "application/octet-stream";
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteDevServerModuleLoader.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteDevServerModuleLoader.java
new file mode 100644
index 0000000000..fb8747edb9
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteDevServerModuleLoader.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.modules;
+
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+import org.apache.wicket.markup.head.JavaScriptReferenceType;
+import org.apache.wicket.util.lang.Args;
+import org.apache.wicket.util.string.Strings;
+
+/**
+ * Loads island modules from a running Vite dev server, for hot module 
replacement during
+ * development.
+ * <p>
+ * Renders Vite's client and, for each island type, the module the Wicket 
Islands Vite plugin
+ * serves at <code>/@wicket-islands/&lt;type&gt;</code>. The dev server's 
origin must be allowed by
+ * the page's Content Security Policy for scripts and connections.
+ *
+ * @since 12.0.0
+ */
+public class ViteDevServerModuleLoader implements IIslandModuleLoader
+{
+       private final String devServerUrl;
+
+       /**
+        * @param devServerUrl
+        *            the dev server's URL, e.g. 
<code>http://localhost:5173</code>
+        */
+       public ViteDevServerModuleLoader(String devServerUrl)
+       {
+               this.devServerUrl = 
Strings.stripEnding(Args.notEmpty(devServerUrl, "devServerUrl"), "/");
+       }
+
+       @Override
+       public void renderHead(String islandType, IHeaderResponse response)
+       {
+               response.render(JavaScriptHeaderItem.forUrl(devServerUrl + 
"/@vite/client")
+                       .setType(JavaScriptReferenceType.MODULE));
+               response.render(JavaScriptHeaderItem.forUrl(devServerUrl + 
"/@wicket-islands/" + islandType)
+                       .setType(JavaScriptReferenceType.MODULE));
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteManifest.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteManifest.java
new file mode 100644
index 0000000000..030614f451
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteManifest.java
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.modules;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.util.lang.Args;
+
+import tools.jackson.core.JacksonException;
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.databind.DeserializationFeature;
+import tools.jackson.databind.json.JsonMapper;
+
+/**
+ * The manifest Vite writes for a production build: a map from source module 
to the files it was
+ * built into.
+ *
+ * @see <a href="https://vite.dev/guide/backend-integration";>Vite backend 
integration</a>
+ * @since 12.0.0
+ */
+public final class ViteManifest
+{
+       /**
+        * One chunk of the build.
+        *
+        * @param file
+        *            the built file, relative to the build's output directory
+        * @param name
+        *            the chunk name; for an entry the key of the build's input
+        * @param isEntry
+        *            whether the chunk is an entry
+        * @param imports
+        *            the manifest keys of the chunks this chunk imports 
statically
+        * @param css
+        *            the style sheets of this chunk
+        * @param assets
+        *            other files this chunk references
+        */
+       public record Chunk(String file, String name, Boolean isEntry, 
List<String> imports,
+               List<String> css, List<String> assets)
+       {
+       }
+
+       private static final JsonMapper MAPPER = JsonMapper.builder()
+               .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+               .build();
+
+       private final Map<String, Chunk> chunks;
+
+       private final Set<String> files;
+
+       private ViteManifest(Map<String, Chunk> chunks)
+       {
+               this.chunks = Map.copyOf(chunks);
+               files = Collections.unmodifiableSet(collectFiles(chunks));
+       }
+
+       /**
+        * Reads a manifest.
+        *
+        * @param in
+        *            the manifest's JSON
+        * @return the manifest
+        */
+       public static ViteManifest read(InputStream in)
+       {
+               Args.notNull(in, "in");
+               try (in)
+               {
+                       return new ViteManifest(MAPPER.readValue(in, new 
TypeReference<Map<String, Chunk>>()
+                       {
+                       }));
+               }
+               catch (JacksonException | IOException e)
+               {
+                       throw new WicketRuntimeException("Cannot read the Vite 
manifest", e);
+               }
+       }
+
+       /**
+        * Finds the entry chunk built for an input name.
+        *
+        * @param name
+        *            the input name
+        * @return the manifest key of the entry, {@code null} if there is none
+        */
+       public String findEntry(String name)
+       {
+               for (Map.Entry<String, Chunk> entry : chunks.entrySet())
+               {
+                       Chunk chunk = entry.getValue();
+                       if (Boolean.TRUE.equals(chunk.isEntry()) && 
name.equals(chunk.name()))
+                       {
+                               return entry.getKey();
+                       }
+               }
+               return null;
+       }
+
+       /**
+        * @param key
+        *            a manifest key
+        * @return the chunk, {@code null} if there is none
+        */
+       public Chunk getChunk(String key)
+       {
+               return chunks.get(key);
+       }
+
+       /**
+        * Collects the style sheets of a chunk and of every chunk it imports, 
transitively, in
+        * dependency order.
+        *
+        * @param key
+        *            the manifest key of the chunk
+        * @return the style sheet files
+        */
+       public Set<String> collectCss(String key)
+       {
+               Set<String> css = new LinkedHashSet<>();
+               collectCss(key, new HashSet<>(), css);
+               return css;
+       }
+
+       private void collectCss(String key, Set<String> visited, Set<String> 
css)
+       {
+               Chunk chunk = chunks.get(key);
+               if (chunk == null || !visited.add(key))
+               {
+                       return;
+               }
+               if (chunk.imports() != null)
+               {
+                       for (String imported : chunk.imports())
+                       {
+                               collectCss(imported, visited, css);
+                       }
+               }
+               if (chunk.css() != null)
+               {
+                       css.addAll(chunk.css());
+               }
+       }
+
+       /**
+        * @return every file the build produced, relative to its output 
directory
+        */
+       public Set<String> getFiles()
+       {
+               return files;
+       }
+
+       private static Set<String> collectFiles(Map<String, Chunk> chunks)
+       {
+               Set<String> files = new HashSet<>();
+               for (Chunk chunk : chunks.values())
+               {
+                       if (chunk.file() != null)
+                       {
+                               files.add(chunk.file());
+                       }
+                       if (chunk.css() != null)
+                       {
+                               files.addAll(chunk.css());
+                       }
+                       if (chunk.assets() != null)
+                       {
+                               files.addAll(chunk.assets());
+                       }
+               }
+               return files;
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteManifestModuleLoader.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteManifestModuleLoader.java
new file mode 100644
index 0000000000..00aeaff9e9
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/modules/ViteManifestModuleLoader.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.modules;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.wicket.Application;
+import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+import org.apache.wicket.markup.head.JavaScriptReferenceType;
+import org.apache.wicket.util.lang.Args;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Loads island modules from a Vite production build on the classpath.
+ * <p>
+ * The build's output directory is expected under a base path on the 
classpath, with Vite's
+ * manifest in it. Each island type is an input of the build whose name is the 
island type; its
+ * entry module and style sheets are rendered from the manifest, and served by
+ * {@link IslandAssetResource}.
+ *
+ * @since 12.0.0
+ */
+public class ViteManifestModuleLoader implements IIslandModuleLoader
+{
+       private static final Logger LOG = 
LoggerFactory.getLogger(ViteManifestModuleLoader.class);
+
+       private final String basePath;
+
+       private final String manifestFile;
+
+       private final String urlPrefix;
+
+       private volatile ViteManifest manifest;
+
+       private volatile boolean manifestMissing;
+
+       /**
+        * @param basePath
+        *            the classpath location of the build's output directory, 
ending in a slash
+        * @param manifestFile
+        *            the manifest, relative to the base path
+        * @param urlPrefix
+        *            the context-relative URL under which {@link 
IslandAssetResource} serves the
+        *            files, ending in a slash
+        */
+       public ViteManifestModuleLoader(String basePath, String manifestFile, 
String urlPrefix)
+       {
+               this.basePath = Args.notEmpty(basePath, "basePath");
+               this.manifestFile = Args.notEmpty(manifestFile, "manifestFile");
+               this.urlPrefix = Args.notEmpty(urlPrefix, "urlPrefix");
+       }
+
+       /**
+        * @return the classpath location of the build's output directory
+        */
+       public String getBasePath()
+       {
+               return basePath;
+       }
+
+       /**
+        * @return the manifest, {@code null} if there is no build on the 
classpath
+        */
+       public ViteManifest getManifest()
+       {
+               if (manifest == null && !manifestMissing)
+               {
+                       URL url = getClassLoader().getResource(basePath + 
manifestFile);
+                       if (url == null)
+                       {
+                               manifestMissing = true;
+                               LOG.warn("No Vite manifest at '{}{}' on the 
classpath: islands are rendered without "
+                                       + "their JavaScript modules.", 
basePath, manifestFile);
+                       }
+                       else
+                       {
+                               try (InputStream in = url.openStream())
+                               {
+                                       manifest = ViteManifest.read(in);
+                               }
+                               catch (IOException e)
+                               {
+                                       throw new WicketRuntimeException(
+                                               "Cannot read the Vite manifest 
at " + url, e);
+                               }
+                       }
+               }
+               return manifest;
+       }
+
+       /**
+        * @return the class loader to read the build from
+        */
+       protected ClassLoader getClassLoader()
+       {
+               return 
Application.get().getApplicationSettings().getClassResolver().getClassLoader();
+       }
+
+       @Override
+       public void renderHead(String islandType, IHeaderResponse response)
+       {
+               ViteManifest current = getManifest();
+               if (current == null)
+               {
+                       return;
+               }
+
+               String key = current.findEntry(islandType);
+               if (key == null)
+               {
+                       throw new IllegalStateException("The Vite manifest at 
'" + basePath + manifestFile +
+                               "' has no entry for island type '" + islandType 
+ "'");
+               }
+
+               for (String css : current.collectCss(key))
+               {
+                       response.render(CssHeaderItem.forUrl(urlPrefix + css));
+               }
+               response.render(JavaScriptHeaderItem.forUrl(urlPrefix + 
current.getChunk(key).file())
+                       .setType(JavaScriptReferenceType.MODULE));
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/IIslandSerializer.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/IIslandSerializer.java
new file mode 100644
index 0000000000..b8a14a96d6
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/IIslandSerializer.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.serializer;
+
+/**
+ * Converts the values exchanged between an island and its client-side peer to 
and from JSON:
+ * the props written into the page, the payloads of calls and their results.
+ * <p>
+ * The JSON a serializer reads comes from the browser and is untrusted. An 
implementation must
+ * only ever create instances of the type it is asked for and of the types 
that type declares. It
+ * must never honour type information from the input itself (polymorphic type 
handling), because
+ * that lets a client choose which classes are instantiated on the server.
+ *
+ * @since 12.0.0
+ */
+public interface IIslandSerializer
+{
+       /**
+        * Converts a value to JSON.
+        *
+        * @param value
+        *            the value, may be {@code null}
+        * @return the JSON text
+        * @throws IslandSerializationException
+        *             if the value cannot be converted
+        */
+       String toJson(Object value);
+
+       /**
+        * Converts JSON received from the client into an instance of the given 
type.
+        *
+        * @param <T>
+        *            the type to create
+        * @param json
+        *            the untrusted JSON text
+        * @param type
+        *            the type to create
+        * @return the value, {@code null} if the JSON is {@code null}
+        * @throws IslandSerializationException
+        *             if the JSON is malformed or does not match the type
+        */
+       <T> T fromJson(String json, Class<T> type);
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/IslandSerializationException.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/IslandSerializationException.java
new file mode 100644
index 0000000000..ef12b2cae0
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/IslandSerializationException.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.serializer;
+
+import org.apache.wicket.WicketRuntimeException;
+
+/**
+ * Thrown when a value cannot be converted to or from JSON.
+ *
+ * @since 12.0.0
+ */
+public class IslandSerializationException extends WicketRuntimeException
+{
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * @param message
+        *            the message
+        * @param cause
+        *            the cause
+        */
+       public IslandSerializationException(String message, Throwable cause)
+       {
+               super(message, cause);
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/JacksonIslandSerializer.java
 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/JacksonIslandSerializer.java
new file mode 100644
index 0000000000..580b5e7725
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/main/java/org/apache/wicket/islands/serializer/JacksonIslandSerializer.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.serializer;
+
+import org.apache.wicket.util.lang.Args;
+
+import tools.jackson.core.JacksonException;
+import tools.jackson.databind.DeserializationFeature;
+import tools.jackson.databind.ObjectMapper;
+import tools.jackson.databind.json.JsonMapper;
+
+/**
+ * An {@link IIslandSerializer} based on Jackson.
+ * <p>
+ * The default mapper rejects JSON properties the target type does not 
declare, so a client cannot
+ * smuggle values past a request type, and leaves polymorphic type handling 
off. A custom mapper
+ * passed to {@link #JacksonIslandSerializer(ObjectMapper)} must not enable 
default typing.
+ *
+ * @since 12.0.0
+ */
+public class JacksonIslandSerializer implements IIslandSerializer
+{
+       private final ObjectMapper mapper;
+
+       /**
+        * Creates a serializer with the default mapper.
+        */
+       public JacksonIslandSerializer()
+       {
+               
this(JsonMapper.builder().enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build());
+       }
+
+       /**
+        * Creates a serializer with the given mapper.
+        *
+        * @param mapper
+        *            the mapper
+        */
+       public JacksonIslandSerializer(ObjectMapper mapper)
+       {
+               this.mapper = Args.notNull(mapper, "mapper");
+       }
+
+       @Override
+       public String toJson(Object value)
+       {
+               try
+               {
+                       return mapper.writeValueAsString(value);
+               }
+               catch (JacksonException e)
+               {
+                       throw new IslandSerializationException("Cannot convert 
a " +
+                               (value == null ? "null" : 
value.getClass().getName()) + " to JSON", e);
+               }
+       }
+
+       @Override
+       public <T> T fromJson(String json, Class<T> type)
+       {
+               Args.notNull(json, "json");
+               Args.notNull(type, "type");
+
+               try
+               {
+                       return mapper.readValue(json, type);
+               }
+               catch (JacksonException e)
+               {
+                       throw new IslandSerializationException("Cannot read a " 
+ type.getName() + " from JSON",
+                               e);
+               }
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandAssetResourceTest.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandAssetResourceTest.java
new file mode 100644
index 0000000000..59027dc1db
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandAssetResourceTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.apache.wicket.util.tester.WicketTester;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Serving the files of the build.
+ */
+class IslandAssetResourceTest extends IslandTestCase
+{
+       @Test
+       void servesFilesListedInTheManifest()
+       {
+               
tester.executeUrl("wicket-islands/assets/test-island-abc123.js");
+
+               assertEquals(200, tester.getLastResponse().getStatus());
+               
assertTrue(tester.getLastResponse().getContentType().startsWith("text/javascript"));
+               assertEquals("export default {};\n", 
tester.getLastResponseAsString());
+       }
+
+       @Test
+       void refusesFilesNotListedInTheManifest()
+       {
+               tester.executeUrl("wicket-islands/manifest.json");
+
+               assertEquals(404, tester.getLastResponse().getStatus());
+       }
+
+       @Test
+       void refusesClasspathEntriesOutsideTheBuild()
+       {
+               tester.executeUrl("wicket-islands/..%2FIslandTestPage.html");
+
+               assertEquals(404, tester.getLastResponse().getStatus());
+       }
+
+       /**
+        * Keeps {@link WicketTester} from following an error to an error page.
+        */
+       @Override
+       protected WicketTester 
newWicketTester(org.apache.wicket.protocol.http.WebApplication app)
+       {
+               WicketTester tester = super.newWicketTester(app);
+               tester.setExposeExceptions(false);
+               return tester;
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandCallTest.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandCallTest.java
new file mode 100644
index 0000000000..beca8d0324
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandCallTest.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Page-bound calls of an {@link Island}.
+ */
+class IslandCallTest extends IslandTestCase
+{
+       @BeforeEach
+       void render()
+       {
+               tester.startPage(IslandTestPage.class);
+       }
+
+       @Test
+       @SuppressWarnings("unchecked")
+       void callReturnsItsResultAndInvalidations()
+       {
+               Map<String, Object> answer = call("add", "7", "{\"amount\":5}");
+
+               assertEquals("7", answer.get("call"));
+               assertEquals(Boolean.TRUE, answer.get("ok"));
+               assertEquals(5, ((Map<String, 
Object>)answer.get("value")).get("total"));
+               assertEquals(List.of("totals"), answer.get("invalidate"));
+       }
+
+       @Test
+       void componentsAddedByTheHandlerAreUpdated()
+       {
+               call("add", "1", "{\"amount\":2}");
+
+               tester.assertComponentOnAjaxResponse("label");
+               assertTrue(tester.getLastResponseAsString().contains("count 
2"));
+       }
+
+       @Test
+       void rejectedCallStillUpdatesComponents()
+       {
+               Map<String, Object> error = error(call("add", "1", 
"{\"amount\":-1}"));
+
+               assertEquals("invalid", error.get("kind"));
+               assertEquals(List.of("negative"), error.get("messages"));
+               tester.assertComponentOnAjaxResponse("label");
+       }
+
+       @Test
+       void callWithoutResult()
+       {
+               call("add", "1", "{\"amount\":3}");
+
+               Map<String, Object> answer = call("reset", "2", null);
+
+               assertEquals(Boolean.TRUE, answer.get("ok"));
+               assertNull(answer.get("value"));
+               assertEquals(0, 
((IslandTestPage)tester.getLastRenderedPage()).island.getModelObject()
+                       .count());
+       }
+
+       @Test
+       void unknownCallIsInvalid()
+       {
+               assertEquals("invalid", error(call("delete", "1", 
null)).get("kind"));
+       }
+
+       @Test
+       void missingPayloadIsInvalid()
+       {
+               assertEquals("invalid", error(call("add", "1", 
null)).get("kind"));
+       }
+
+       @Test
+       void malformedPayloadIsInvalid()
+       {
+               assertEquals("invalid", error(call("add", "1", 
"{\"amount\":")).get("kind"));
+       }
+
+       @Test
+       void unknownPropertyIsInvalid()
+       {
+               assertEquals("invalid",
+                       error(call("add", "1", 
"{\"amount\":1,\"admin\":true}")).get("kind"));
+       }
+
+       @Test
+       @SuppressWarnings("unchecked")
+       void failingHandlerIsAnErrorWithDetailInDevelopment()
+       {
+               Map<String, Object> error = error(call("boom", "1", null));
+
+               assertEquals("error", error.get("kind"));
+               
assertTrue(((List<String>)error.get("messages")).get(0).contains("secret 
detail"));
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandDeploymentModeTest.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandDeploymentModeTest.java
new file mode 100644
index 0000000000..1a1fa150e6
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandDeploymentModeTest.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.wicket.RuntimeConfigurationType;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Island calls in deployment mode.
+ */
+class IslandDeploymentModeTest extends IslandTestCase
+{
+       @Override
+       protected RuntimeConfigurationType configurationType()
+       {
+               return RuntimeConfigurationType.DEPLOYMENT;
+       }
+
+       @Test
+       @SuppressWarnings("unchecked")
+       void failingHandlerDoesNotRevealDetails()
+       {
+               tester.startPage(IslandTestPage.class);
+
+               Map<String, Object> error = error(call("boom", "1", null));
+
+               assertEquals("error", error.get("kind"));
+               
assertFalse(((List<String>)error.get("messages")).get(0).contains("secret 
detail"));
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandDevServerTest.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandDevServerTest.java
new file mode 100644
index 0000000000..0511a44d12
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandDevServerTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Loading island modules from a Vite dev server.
+ */
+class IslandDevServerTest extends IslandTestCase
+{
+       @Override
+       protected void configureIslands(IslandSettings settings)
+       {
+               super.configureIslands(settings);
+               settings.setDevServerUrl("http://localhost:5173/";);
+       }
+
+       @Test
+       void rendersModulesFromTheDevServer()
+       {
+               tester.startPage(IslandTestPage.class);
+
+               String response = tester.getLastResponseAsString();
+               assertTrue(response.contains(
+                       "<script type=\"module\" 
src=\"http://localhost:5173/@vite/client\"";), response);
+               assertTrue(response.contains(
+                       "<script type=\"module\" 
src=\"http://localhost:5173/@wicket-islands/test-island\"";),
+                       response);
+               assertFalse(response.contains("test-island-abc123.js"), 
response);
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandJsonTest.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandJsonTest.java
new file mode 100644
index 0000000000..5e28476ea9
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandJsonTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests for {@link IslandJson}.
+ */
+class IslandJsonTest
+{
+       @Test
+       void escapesWhatCouldEndOrCommentOutTheScriptElement()
+       {
+               assertEquals("{\"a\":\"\\u003c/script\\u003e\\u003c!-- \\u0026 
\\u2028\\u2029\"}",
+                       IslandJson.escapeForScript("{\"a\":\"</script><!-- & 
\u2028\u2029\"}"));
+       }
+
+       @Test
+       void leavesEverythingElseAlone()
+       {
+               String json = "{\"a\":[1,true,null,\"x\\\"y\"]}";
+               assertEquals(json, IslandJson.escapeForScript(json));
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandRenderTest.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandRenderTest.java
new file mode 100644
index 0000000000..99b4e4079f
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandRenderTest.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.tester.TagTester;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Rendering of an {@link Island}: its host, its state and its module.
+ */
+class IslandRenderTest extends IslandTestCase
+{
+       private static final Pattern STATE = Pattern.compile(
+               "<script type=\"application/json\" 
data-wicket-island-state>(.*?)</script>", Pattern.DOTALL);
+
+       @Test
+       void rendersHostWithTypeAndKey()
+       {
+               IslandTestPage page = tester.startPage(IslandTestPage.class);
+
+               TagTester host = tester.getTagByWicketId("island");
+               assertEquals("test-island", 
host.getAttribute(Island.ATTR_TYPE));
+               assertEquals(page.island.getKey(), 
host.getAttribute(Island.ATTR_KEY));
+               assertEquals(page.island.getMarkupId(), 
host.getAttribute("id"));
+               assertTrue(tester.getLastResponseAsString().contains("<div " + 
Island.ATTR_ROOT + "></div>"));
+       }
+
+       @Test
+       @SuppressWarnings("unchecked")
+       void stateHoldsPropsCallsAndAjaxAttributes()
+       {
+               tester.startPage(IslandTestPage.class);
+
+               Map<String, Object> state = state();
+               Map<String, Object> props = (Map<String, 
Object>)state.get("props");
+               assertEquals(IslandTestPage.TRICKY_NAME, props.get("name"));
+               assertEquals(0, props.get("count"));
+               assertEquals(List.of("add", "reset", "boom"), 
state.get("calls"));
+               Map<String, Object> ajax = (Map<String, 
Object>)state.get("ajax");
+               assertNotNull(ajax.get("u"));
+               assertEquals("POST", ajax.get("m"));
+       }
+
+       @Test
+       void stateIsEscapedForTheScriptElement()
+       {
+               tester.startPage(IslandTestPage.class);
+
+               String json = stateJson();
+               assertFalse(json.contains("<"), json);
+               assertFalse(json.contains(">"), json);
+               assertFalse(json.contains("&"), json);
+               assertFalse(json.contains("\u2028"), json);
+               assertFalse(json.contains("\u2029"), json);
+       }
+
+       @Test
+       void keyIsStableAcrossRenders()
+       {
+               IslandTestPage page = tester.startPage(IslandTestPage.class);
+               String key = 
tester.getTagByWicketId("island").getAttribute(Island.ATTR_KEY);
+
+               tester.startPage(page);
+
+               assertEquals(key, 
tester.getTagByWicketId("island").getAttribute(Island.ATTR_KEY));
+       }
+
+       @Test
+       void keysDifferBetweenInstances()
+       {
+               Island<String> one = new Island<>("one", "test-island", 
Model.of(""));
+               Island<String> two = new Island<>("two", "test-island", 
Model.of(""));
+
+               assertFalse(one.getKey().equals(two.getKey()));
+       }
+
+       @Test
+       void rejectsInvalidType()
+       {
+               assertThrows(IllegalArgumentException.class,
+                       () -> new Island<>("island", "a\"b", Model.of("")));
+       }
+
+       @Test
+       void rendersEntryModuleAndStyleSheetsFromTheManifest()
+       {
+               tester.startPage(IslandTestPage.class);
+
+               String response = tester.getLastResponseAsString();
+               assertTrue(Pattern.compile(
+                       "<script type=\"module\" 
src=\"[^\"]*wicket-islands/assets/test-island-abc123\\.js\"")
+                       .matcher(response)
+                       .find(), response);
+               int shared = 
response.indexOf("wicket-islands/assets/shared-aaa111.css");
+               int own = 
response.indexOf("wicket-islands/assets/test-island-def456.css");
+               assertTrue(shared > 0 && own > shared, "imported style sheets 
come first: " + response);
+       }
+
+       @Test
+       void entryMissingFromTheManifestFails()
+       {
+               RuntimeException e = assertThrows(RuntimeException.class, () -> 
tester.startComponentInPage(
+                       new Island<>("island", "not-built", Model.of(""))));
+
+               Throwable cause = e;
+               while (cause.getCause() != null)
+               {
+                       cause = cause.getCause();
+               }
+               assertTrue(cause.getMessage().contains("no entry for island 
type 'not-built'"),
+                       cause.getMessage());
+       }
+
+       private String stateJson()
+       {
+               Matcher matcher = 
STATE.matcher(tester.getLastResponseAsString());
+               assertTrue(matcher.find(), tester.getLastResponseAsString());
+               return matcher.group(1);
+       }
+
+       @SuppressWarnings("unchecked")
+       private Map<String, Object> state()
+       {
+               return JSON.readValue(stateJson(), Map.class);
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestCase.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestCase.java
new file mode 100644
index 0000000000..eb36c8f8f4
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestCase.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.wicket.RuntimeConfigurationType;
+import org.apache.wicket.mock.MockApplication;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.util.tester.WicketTestCase;
+
+import tools.jackson.databind.json.JsonMapper;
+
+/**
+ * Base for island tests: an application with islands installed on the test 
build in
+ * {@code testbuild/}, and helpers to call an island and read its answer.
+ */
+abstract class IslandTestCase extends WicketTestCase
+{
+       private static final Pattern DATA = Pattern.compile(
+               "<data 
name=\"wicket-islands\"><!\\[CDATA\\[(.*?)\\]\\]></data>", Pattern.DOTALL);
+
+       static final JsonMapper JSON = new JsonMapper();
+
+       @Override
+       protected WebApplication newApplication()
+       {
+               return new MockApplication()
+               {
+                       @Override
+                       protected void init()
+                       {
+                               super.init();
+                               
IslandTestCase.this.configureIslands(IslandSettings.install(this));
+                       }
+
+                       @Override
+                       public RuntimeConfigurationType getConfigurationType()
+                       {
+                               return IslandTestCase.this.configurationType();
+                       }
+               };
+       }
+
+       /**
+        * @param settings
+        *            the settings to configure
+        */
+       protected void configureIslands(IslandSettings settings)
+       {
+               
settings.setBasePath("org/apache/wicket/islands/testbuild/").setManifestFile("manifest.json");
+       }
+
+       /**
+        * @return the configuration type of the test application
+        */
+       protected RuntimeConfigurationType configurationType()
+       {
+               return RuntimeConfigurationType.DEVELOPMENT;
+       }
+
+       /**
+        * Calls the island of the last rendered {@link IslandTestPage}.
+        *
+        * @return the island's answer
+        */
+       @SuppressWarnings("unchecked")
+       Map<String, Object> call(String name, String callId, String payload)
+       {
+               IslandTestPage page = 
(IslandTestPage)tester.getLastRenderedPage();
+               tester.getRequest().setMethod("POST");
+               
tester.getRequest().getPostParameters().setParameterValue(IslandEndpointBehavior.PARAM_CALL,
+                       name);
+               tester.getRequest().getPostParameters().setParameterValue(
+                       IslandEndpointBehavior.PARAM_CALL_ID, callId);
+               if (payload != null)
+               {
+                       
tester.getRequest().getPostParameters().setParameterValue(
+                               IslandEndpointBehavior.PARAM_PAYLOAD, payload);
+               }
+               
tester.executeBehavior(page.island.getBehaviors(IslandEndpointBehavior.class).get(0));
+
+               String response = tester.getLastResponseAsString();
+               Matcher matcher = DATA.matcher(response);
+               assertTrue(matcher.find(), response);
+               return JSON.readValue(matcher.group(1), Map.class);
+       }
+
+       @SuppressWarnings("unchecked")
+       static Map<String, Object> error(Map<String, Object> answer)
+       {
+               assertEquals(Boolean.FALSE, answer.get("ok"));
+               return (Map<String, Object>)answer.get("error");
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestPage.html
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestPage.html
new file mode 100644
index 0000000000..28b05c7a68
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestPage.html
@@ -0,0 +1,6 @@
+<html xmlns:wicket="http://wicket.apache.org";>
+<body>
+       <span wicket:id="label"></span>
+       <div wicket:id="island"/>
+</body>
+</html>
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestPage.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestPage.java
new file mode 100644
index 0000000000..e59b4caa49
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandTestPage.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+
+/**
+ * A page with an island and a classic component its calls update.
+ */
+public class IslandTestPage extends WebPage
+{
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * Props containing every character that needs escaping inside a script 
element.
+        */
+       public static final String TRICKY_NAME = "</script><!-- & 
 
 >";
+
+       public record TestProps(String name, int count)
+       {
+       }
+
+       public record Add(int amount)
+       {
+       }
+
+       public record Sum(int total)
+       {
+       }
+
+       private int count;
+
+       final Label label;
+
+       final Island<TestProps> island;
+
+       public IslandTestPage()
+       {
+               label = new Label("label", () -> "count " + count);
+               label.setOutputMarkupId(true);
+               add(label);
+
+               island = new Island<>("island", "test-island", () -> new 
TestProps(TRICKY_NAME, count));
+               island.onCall("add", Add.class, Sum.class, (request, call) -> {
+                       call.getTarget().add(label);
+                       if (request.amount() < 0)
+                       {
+                               throw call.reject("negative");
+                       }
+                       count += request.amount();
+                       call.invalidate("totals");
+                       return new Sum(count);
+               });
+               island.onCall("reset", Void.class, (request, call) -> count = 
0);
+               island.onCall("boom", Void.class, (request, call) -> {
+                       throw new IllegalStateException("secret detail");
+               });
+               add(island);
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandWithoutBuildTest.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandWithoutBuildTest.java
new file mode 100644
index 0000000000..a185e8634a
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/IslandWithoutBuildTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Islands without a build on the classpath.
+ */
+class IslandWithoutBuildTest extends IslandTestCase
+{
+       @Override
+       protected void configureIslands(IslandSettings settings)
+       {
+               settings.setBasePath("org/apache/wicket/islands/nobuild/");
+       }
+
+       @Test
+       void rendersTheHostWithoutModules()
+       {
+               tester.startPage(IslandTestPage.class);
+
+               String response = tester.getLastResponseAsString();
+               assertTrue(response.contains(Island.ATTR_STATE), response);
+               assertFalse(response.contains("type=\"module\""), response);
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/serializer/JacksonIslandSerializerTest.java
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/serializer/JacksonIslandSerializerTest.java
new file mode 100644
index 0000000000..a5981d6212
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/serializer/JacksonIslandSerializerTest.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.wicket.islands.serializer;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests for {@link JacksonIslandSerializer}.
+ */
+class JacksonIslandSerializerTest
+{
+       public record Point(int x, int y)
+       {
+       }
+
+       private final JacksonIslandSerializer serializer = new 
JacksonIslandSerializer();
+
+       @Test
+       void roundTripsRecords()
+       {
+               assertEquals(new Point(1, 2), 
serializer.fromJson(serializer.toJson(new Point(1, 2)),
+                       Point.class));
+       }
+
+       @Test
+       void rejectsUnknownProperties()
+       {
+               assertThrows(IslandSerializationException.class,
+                       () -> serializer.fromJson("{\"x\":1,\"y\":2,\"z\":3}", 
Point.class));
+       }
+
+       @Test
+       void rejectsMalformedJson()
+       {
+               assertThrows(IslandSerializationException.class,
+                       () -> serializer.fromJson("{\"x\":", Point.class));
+       }
+
+       @Test
+       void doesNotHonourTypeInformationInTheInput()
+       {
+               assertThrows(IslandSerializationException.class, () -> 
serializer
+                       
.fromJson("{\"@class\":\"java.util.ArrayList\",\"x\":1,\"y\":2}", Point.class));
+       }
+}
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/shared-aaa111.css
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/shared-aaa111.css
new file mode 100644
index 0000000000..18c843a576
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/shared-aaa111.css
@@ -0,0 +1 @@
+.shared { color: blue; }
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/shared-xyz789.js
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/shared-xyz789.js
new file mode 100644
index 0000000000..cf206194f0
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/shared-xyz789.js
@@ -0,0 +1 @@
+export const shared = 1;
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/test-island-abc123.js
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/test-island-abc123.js
new file mode 100644
index 0000000000..ff8b4c5632
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/test-island-abc123.js
@@ -0,0 +1 @@
+export default {};
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/test-island-def456.css
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/test-island-def456.css
new file mode 100644
index 0000000000..d92d3cf134
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/assets/test-island-def456.css
@@ -0,0 +1 @@
+.island { color: red; }
diff --git 
a/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/manifest.json
 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/manifest.json
new file mode 100644
index 0000000000..7f5d4d031e
--- /dev/null
+++ 
b/wicket-experimental/wicket-islands/src/test/java/org/apache/wicket/islands/testbuild/manifest.json
@@ -0,0 +1,15 @@
+{
+  "src/islands/test-island.tsx": {
+    "file": "assets/test-island-abc123.js",
+    "name": "test-island",
+    "src": "src/islands/test-island.tsx",
+    "isEntry": true,
+    "imports": ["_shared-xyz789.js"],
+    "css": ["assets/test-island-def456.css"]
+  },
+  "_shared-xyz789.js": {
+    "file": "assets/shared-xyz789.js",
+    "name": "shared",
+    "css": ["assets/shared-aaa111.css"]
+  }
+}

Reply via email to