From 2977de27e92964da9f83500c2147f578b8fb7bdd Mon Sep 17 00:00:00 2001 From: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:32:22 +0200 Subject: [PATCH 1/7] feat!: WebPush Subscription Wrapper and feature flag removal (#20484) --- .../com/vaadin/experimental/FeatureFlags.java | 6 --- .../com/vaadin/flow/webpush/WebPushView.java | 5 +-- .../vaadin/flow/server/webpush/WebPush.java | 26 ++++++------ .../flow/server/webpush/WebPushKeys.java | 34 +++++++++++++++ .../server/webpush/WebPushSubscription.java | 41 +++++++++++++++++++ .../webpush/WebPushSubscriptionResponse.java | 4 +- .../META-INF/frontend/FlowWebPush.js | 2 - 7 files changed, 92 insertions(+), 26 deletions(-) create mode 100644 flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushKeys.java create mode 100644 flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushSubscription.java diff --git a/flow-server/src/main/java/com/vaadin/experimental/FeatureFlags.java b/flow-server/src/main/java/com/vaadin/experimental/FeatureFlags.java index a2431265070..cb3009ad498 100644 --- a/flow-server/src/main/java/com/vaadin/experimental/FeatureFlags.java +++ b/flow-server/src/main/java/com/vaadin/experimental/FeatureFlags.java @@ -67,11 +67,6 @@ public class FeatureFlags implements Serializable { "collaborationEngineBackend", "https://github.com/vaadin/platform/issues/1988", true, null); - public static final Feature WEB_PUSH = new Feature( - "Server side WebPush API", "webPush", - "https://vaadin.com/docs/latest/configuration/setting-up-webpush", - true, "com.vaadin.flow.server.webpush.WebPush"); - public static final Feature FORM_FILLER_ADDON = new Feature( "Form Filler Add-on", "formFillerAddon", "https://github.com/vaadin/form-filler-addon", true, @@ -112,7 +107,6 @@ public FeatureFlags(Lookup lookup) { this.lookup = lookup; features.add(new Feature(EXAMPLE)); features.add(new Feature(COLLABORATION_ENGINE_BACKEND)); - features.add(new Feature(WEB_PUSH)); features.add(new Feature(FORM_FILLER_ADDON)); features.add(new Feature(HILLA_I18N)); features.add(new Feature(HILLA_FULLSTACK_SIGNALS)); diff --git a/flow-tests/test-webpush/src/main/java/com/vaadin/flow/webpush/WebPushView.java b/flow-tests/test-webpush/src/main/java/com/vaadin/flow/webpush/WebPushView.java index c9ae1667276..c26c65cbd6e 100644 --- a/flow-tests/test-webpush/src/main/java/com/vaadin/flow/webpush/WebPushView.java +++ b/flow-tests/test-webpush/src/main/java/com/vaadin/flow/webpush/WebPushView.java @@ -18,14 +18,13 @@ import java.util.List; -import nl.martijndwars.webpush.Subscription; - import com.vaadin.flow.component.Text; import com.vaadin.flow.component.html.Div; import com.vaadin.flow.component.html.NativeButton; import com.vaadin.flow.router.Route; import com.vaadin.flow.server.webpush.WebPush; import com.vaadin.flow.server.webpush.WebPushMessage; +import com.vaadin.flow.server.webpush.WebPushSubscription; @Route("") public class WebPushView extends Div { @@ -52,7 +51,7 @@ public class WebPushView extends Div { "https://upload.wikimedia.org/wikipedia/commons/0/0e/Message-icon-blue-symbol-double.png" ); - private Subscription subscription; + private WebPushSubscription subscription; public WebPushView() { webPush = new WebPush(PUBLIC_KEY, PRIVATE_KEY, "test"); diff --git a/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPush.java b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPush.java index 01f6fdfbf42..45908906e91 100644 --- a/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPush.java +++ b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPush.java @@ -32,14 +32,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.vaadin.experimental.FeatureFlags; import com.vaadin.flow.component.ComponentUtil; import com.vaadin.flow.component.UI; import com.vaadin.flow.component.page.Page; import com.vaadin.flow.component.page.PendingJavaScriptResult; import com.vaadin.flow.function.SerializableConsumer; import com.vaadin.flow.internal.StringUtil; -import com.vaadin.flow.server.VaadinService; import elemental.json.Json; import elemental.json.JsonObject; @@ -77,11 +75,6 @@ public class WebPush { * Subject used in the JWT payload (for VAPID). */ public WebPush(String publicKey, String privateKey, String subject) { - if (!FeatureFlags.get(VaadinService.getCurrent().getContext()) - .isEnabled(FeatureFlags.WEB_PUSH)) { - throw new WebPushException("WebPush feature is not enabled. " - + "Add `com.vaadin.experimental.webPush=true` to `vaadin-featureflags.properties`file in resources to enable feature."); - } this.publicKey = publicKey; Security.addProvider(new BouncyCastleProvider()); @@ -109,13 +102,20 @@ public WebPush(String publicKey, String privateKey, String subject) { * @throws WebPushException * if sending a notification fails */ - public void sendNotification(Subscription subscription, + public void sendNotification(WebPushSubscription subscription, WebPushMessage message) throws WebPushException { int statusCode = -1; HttpResponse response = null; try { + Subscription.Keys keys = null; + if (subscription.keys() != null) { + keys = new Subscription.Keys(subscription.keys().p256dh(), + subscription.keys().auth()); + } + Subscription nativeSubscription = new Subscription( + subscription.endpoint(), keys); Notification notification = Notification.builder() - .subscription(subscription).payload(message.toJson()) + .subscription(nativeSubscription).payload(message.toJson()) .build(); response = pushService.send(notification, PushService.DEFAULT_ENCODING, @@ -282,11 +282,13 @@ private SerializableConsumer handlePossiblyEmptySubscription( }; } - private Subscription generateSubscription(JsonObject subscriptionJson) { - Subscription.Keys keys = new Subscription.Keys( + private WebPushSubscription generateSubscription( + JsonObject subscriptionJson) { + WebPushKeys keys = new WebPushKeys( subscriptionJson.getObject("keys").getString("p256dh"), subscriptionJson.getObject("keys").getString("auth")); - return new Subscription(subscriptionJson.getString("endpoint"), keys); + return new WebPushSubscription(subscriptionJson.getString("endpoint"), + keys); } private Logger getLogger() { diff --git a/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushKeys.java b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushKeys.java new file mode 100644 index 00000000000..51410fe527a --- /dev/null +++ b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushKeys.java @@ -0,0 +1,34 @@ +/* + * Copyright 2000-2024 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.flow.server.webpush; + +import java.io.Serializable; + +/** + * Holds the keys that used to encrypt the Web Push notification payload, so + * that only the current browser can read (decrypt) the content of + * notifications. + * + * @param p256dh + * public key on the P-256 curve. + * @param auth + * An authentication secret. + * @see PushSubscription + * Keys mdn web docs + */ +public record WebPushKeys(String p256dh, String auth) implements Serializable { +} diff --git a/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushSubscription.java b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushSubscription.java new file mode 100644 index 00000000000..d5a3acc5265 --- /dev/null +++ b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushSubscription.java @@ -0,0 +1,41 @@ +/* + * Copyright 2000-2024 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.flow.server.webpush; + +import java.io.Serializable; + +/** + * Represents a Web Push subscription that Push Manager gives back, when a user + * subscribes to push notifications in browser. + * + * @param endpoint + * a custom URL pointing to a push server, which can be used to send + * a push message to the particular service worker instance that + * subscribed to the push service. For this reason, it is a good idea + * to keep your endpoint a secret, so others do not hijack it and + * abuse the push functionality. + * @param keys + * an object containing the keys that used to encrypt the payload. + * @see PushSubscription + * mdn web docs + * @see PushManager + * mdn web docs + */ +public record WebPushSubscription(String endpoint, + WebPushKeys keys) implements Serializable { +} diff --git a/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushSubscriptionResponse.java b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushSubscriptionResponse.java index 0aa58d47a1d..c6f66a0a45f 100644 --- a/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushSubscriptionResponse.java +++ b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushSubscriptionResponse.java @@ -18,8 +18,6 @@ import java.io.Serializable; -import nl.martijndwars.webpush.Subscription; - /** * Callback for receiving web push subscription details * @@ -34,5 +32,5 @@ public interface WebPushSubscriptionResponse extends Serializable { * @param subscription * web push subscription object */ - void subscription(Subscription subscription); + void subscription(WebPushSubscription subscription); } diff --git a/flow-webpush/src/main/resources/META-INF/frontend/FlowWebPush.js b/flow-webpush/src/main/resources/META-INF/frontend/FlowWebPush.js index 44c399672b4..4b52b0a0893 100644 --- a/flow-webpush/src/main/resources/META-INF/frontend/FlowWebPush.js +++ b/flow-webpush/src/main/resources/META-INF/frontend/FlowWebPush.js @@ -30,8 +30,6 @@ window.Vaadin.Flow.webPush = window.Vaadin.Flow.webPush || { }); if (subscription) { - console.log(subscription); - // console.log(JSON.parse(JSON.stringify(subscription))); return JSON.parse(JSON.stringify(subscription)); } throw new Error("Subscription failed. See console for exception."); From 32d1edb142c1ae16c090ca1ebca0c3c81937c86d Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Mon, 18 Nov 2024 11:00:26 +0100 Subject: [PATCH 2/7] test: bump selenium devtools for CI system (#20487) --- flow-tests/pom.xml | 17 +++++++++++++++++ flow-tests/test-pwa/pom-production.xml | 7 ------- flow-tests/test-pwa/pom.xml | 7 ------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/flow-tests/pom.xml b/flow-tests/pom.xml index f3b48426459..536494ff803 100644 --- a/flow-tests/pom.xml +++ b/flow-tests/pom.xml @@ -430,6 +430,23 @@ + + + ci-devtools + + + teamcity.build.id + + + + + org.seleniumhq.selenium + selenium-devtools-v127 + 4.25.0 + test + + + deepClean diff --git a/flow-tests/test-pwa/pom-production.xml b/flow-tests/test-pwa/pom-production.xml index 6a44449009f..b730d282760 100644 --- a/flow-tests/test-pwa/pom-production.xml +++ b/flow-tests/test-pwa/pom-production.xml @@ -27,13 +27,6 @@ 0.1.2 test - - - org.seleniumhq.selenium - selenium-devtools-v123 - 4.21.0 - test - diff --git a/flow-tests/test-pwa/pom.xml b/flow-tests/test-pwa/pom.xml index 59747ccf2d9..5d368b16f6e 100644 --- a/flow-tests/test-pwa/pom.xml +++ b/flow-tests/test-pwa/pom.xml @@ -31,13 +31,6 @@ 0.1.2 test - - - org.seleniumhq.selenium - selenium-devtools-v123 - 4.21.0 - test - From 107f2d5ec228b0e49b31ca14aceb02a230755a81 Mon Sep 17 00:00:00 2001 From: Artur Date: Mon, 18 Nov 2024 12:08:12 +0200 Subject: [PATCH 3/7] fix: Refresh locations arrays also (#20483) --- .../component/internal/ComponentTracker.java | 45 ++++++++--- .../com/vaadin/flow/ComponentTrackerTest.java | 80 ++++++++++++------- 2 files changed, 87 insertions(+), 38 deletions(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/component/internal/ComponentTracker.java b/flow-server/src/main/java/com/vaadin/flow/component/internal/ComponentTracker.java index 611424b5d94..5e0ec629f85 100644 --- a/flow-server/src/main/java/com/vaadin/flow/component/internal/ComponentTracker.java +++ b/flow-server/src/main/java/com/vaadin/flow/component/internal/ComponentTracker.java @@ -294,20 +294,47 @@ public static void trackAttach(Component component) { */ public static void refreshLocation(Location location, int offset) { refreshLocation(createLocation, location, offset); + refreshLocations(createLocations, location, offset); refreshLocation(attachLocation, location, offset); + refreshLocations(attachLocations, location, offset); + } + + private static boolean needsUpdate(Location l, Location referenceLocation) { + return Objects.equals(l.className, referenceLocation.className) + && l.lineNumber > referenceLocation.lineNumber; + } + + private static Location updateLocation(Location l, int offset) { + return new Location(l.className, l.filename, l.methodName, + l.lineNumber + offset); } private static void refreshLocation(Map targetRef, - Location location, int offset) { + Location referenceLocation, int offset) { Map updatedLocations = new HashMap<>(); - targetRef.entrySet().stream().filter( - e -> Objects.equals(e.getValue().className, location.className)) - .filter(e -> e.getValue().lineNumber > location.lineNumber) - .forEach(e -> { - Location l = e.getValue(); - updatedLocations.put(e.getKey(), new Location(l.className, - l.filename, l.methodName, l.lineNumber + offset)); - }); + for (Component c : targetRef.keySet()) { + Location l = targetRef.get(c); + if (needsUpdate(l, referenceLocation)) { + updatedLocations.put(c, updateLocation(l, offset)); + } + } + + targetRef.putAll(updatedLocations); + } + + private static void refreshLocations(Map targetRef, + Location referenceLocation, int offset) { + Map updatedLocations = new HashMap<>(); + for (Component c : targetRef.keySet()) { + Location[] locations = targetRef.get(c); + + for (int i = 0; i < locations.length; i++) { + if (needsUpdate(locations[i], referenceLocation)) { + locations[i] = updateLocation(locations[i], offset); + } + } + } + targetRef.putAll(updatedLocations); } diff --git a/flow-server/src/test/java/com/vaadin/flow/ComponentTrackerTest.java b/flow-server/src/test/java/com/vaadin/flow/ComponentTrackerTest.java index b83bc1d0a97..34eebc776eb 100644 --- a/flow-server/src/test/java/com/vaadin/flow/ComponentTrackerTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/ComponentTrackerTest.java @@ -19,6 +19,8 @@ import com.vaadin.flow.component.HasComponents; import com.vaadin.flow.component.Tag; import com.vaadin.flow.component.internal.ComponentTracker; +import com.vaadin.flow.component.internal.ComponentTracker.Location; + import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -69,13 +71,8 @@ public void createLocationTracked() { Component c2; c2 = new Component1(); - ComponentTracker.Location c1Location = ComponentTracker.findCreate(c1); - Assert.assertEquals(68, c1Location.lineNumber()); - Assert.assertEquals(getClass().getName(), c1Location.className()); - - ComponentTracker.Location c2Location = ComponentTracker.findCreate(c2); - Assert.assertEquals(70, c2Location.lineNumber()); - Assert.assertEquals(getClass().getName(), c2Location.className()); + assertCreateLocation(c1, 70, getClass().getName()); + assertCreateLocation(c2, 72, getClass().getName()); } @Test @@ -86,24 +83,18 @@ public void attachLocationTracked() { Layout layout = new Layout(c1); - ComponentTracker.Location c1Location = ComponentTracker.findAttach(c1); - Assert.assertEquals(87, c1Location.lineNumber()); - Assert.assertEquals(getClass().getName(), c1Location.className()); + assertCreateLocation(c1, 80, getClass().getName()); layout.add(c2); - ComponentTracker.Location c2Location = ComponentTracker.findAttach(c2); - Assert.assertEquals(93, c2Location.lineNumber()); - Assert.assertEquals(getClass().getName(), c2Location.className()); + assertAttachLocation(c2, 88, getClass().getName()); // Last attach is tracked layout.add(c3); layout.remove(c3); layout.add(c3); - ComponentTracker.Location c3Location = ComponentTracker.findAttach(c3); - Assert.assertEquals(102, c3Location.lineNumber()); - Assert.assertEquals(getClass().getName(), c3Location.className()); + assertAttachLocation(c3, 95, getClass().getName()); } @Test @@ -112,45 +103,54 @@ public void offsetApplied() { Component c2 = new Component1(); Component c3 = new Component1(); - ComponentTracker.Location c1Location = ComponentTracker.findCreate(c1); - Assert.assertEquals(111, c1Location.lineNumber()); - Assert.assertEquals(getClass().getName(), c1Location.className()); + assertCreateLocation(c1, 102, getClass().getName()); - ComponentTracker.refreshLocation(c1Location, 3); + ComponentTracker.refreshLocation(ComponentTracker.findCreate(c1), 3); - ComponentTracker.Location c2Location = ComponentTracker.findCreate(c2); - Assert.assertEquals(112 + 3, c2Location.lineNumber()); - Assert.assertEquals(getClass().getName(), c2Location.className()); + assertCreateLocation(c2, 103 + 3, getClass().getName()); - ComponentTracker.refreshLocation(c2Location, 1); + ComponentTracker.refreshLocation(ComponentTracker.findCreate(c2), 1); - ComponentTracker.Location c3Location = ComponentTracker.findCreate(c3); - Assert.assertEquals(113 + 3 + 1, c3Location.lineNumber()); - Assert.assertEquals(getClass().getName(), c3Location.className()); + assertCreateLocation(c3, 104 + 3 + 1, getClass().getName()); } @Test public void memoryIsReleased() throws Exception { Field createLocationField = ComponentTracker.class .getDeclaredField("createLocation"); + Field createLocationsField = ComponentTracker.class + .getDeclaredField("createLocations"); Field attachLocationField = ComponentTracker.class .getDeclaredField("attachLocation"); + Field attachLocationsField = ComponentTracker.class + .getDeclaredField("attachLocations"); createLocationField.setAccessible(true); + createLocationsField.setAccessible(true); attachLocationField.setAccessible(true); - Map createMap = (Map) createLocationField + attachLocationsField.setAccessible(true); + + Map createMap = (Map) createLocationField.get(null); + Map attachMap = (Map) attachLocationField.get(null); + Map createLocationsMap = (Map) createLocationsField .get(null); - Map attachMap = (Map) attachLocationField + Map attachLocationsMap = (Map) attachLocationsField .get(null); createMap.clear(); + createLocationsMap.clear(); attachMap.clear(); + attachLocationsMap.clear(); new Layout(new Component1()); Assert.assertEquals(2, createMap.size()); + Assert.assertEquals(2, createLocationsMap.size()); Assert.assertEquals(1, attachMap.size()); + Assert.assertEquals(1, attachLocationsMap.size()); Assert.assertTrue(isCleared(createMap)); + Assert.assertTrue(isCleared(createLocationsMap)); Assert.assertTrue(isCleared(attachMap)); + Assert.assertTrue(isCleared(attachLocationsMap)); } private boolean isCleared(Map map) throws InterruptedException { @@ -164,4 +164,26 @@ private boolean isCleared(Map map) throws InterruptedException { return false; } + private void assertCreateLocation(Component c, int lineNumber, + String name) { + ComponentTracker.Location location = ComponentTracker.findCreate(c); + Assert.assertEquals(lineNumber, location.lineNumber()); + Assert.assertEquals(name, location.className()); + + Location[] locations = ComponentTracker.findCreateLocations(c); + Assert.assertEquals(lineNumber, locations[1].lineNumber()); + Assert.assertEquals(name, locations[1].className()); + } + + private void assertAttachLocation(Component c, int lineNumber, + String name) { + ComponentTracker.Location location = ComponentTracker.findAttach(c); + Assert.assertEquals(lineNumber, location.lineNumber()); + Assert.assertEquals(name, location.className()); + + Location[] locations = ComponentTracker.findAttachLocations(c); + Assert.assertEquals(lineNumber, locations[0].lineNumber()); + Assert.assertEquals(name, locations[0].className()); + } + } From 54d7f4f7d65d4480cd0f4a46391a30467aeccf74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:52:42 +0200 Subject: [PATCH 4/7] chore(deps): bump com.nimbusds:nimbus-jose-jwt from 9.46 to 9.47 (#20482) Bumps [com.nimbusds:nimbus-jose-jwt](https://bitbucket.org/connect2id/nimbus-jose-jwt) from 9.46 to 9.47. - [Changelog](https://bitbucket.org/connect2id/nimbus-jose-jwt/src/master/CHANGELOG.txt) - [Commits](https://bitbucket.org/connect2id/nimbus-jose-jwt/branches/compare/9.47..9.46) --- updated-dependencies: - dependency-name: com.nimbusds:nimbus-jose-jwt dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- flow-tests/vaadin-spring-tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-tests/vaadin-spring-tests/pom.xml b/flow-tests/vaadin-spring-tests/pom.xml index 8a951b895e2..cb716e94be5 100644 --- a/flow-tests/vaadin-spring-tests/pom.xml +++ b/flow-tests/vaadin-spring-tests/pom.xml @@ -17,7 +17,7 @@ true 24.5.4 - 9.46 + 9.47 From 365d7e30770259fa58b8c8af0c98cc40508d7754 Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Mon, 18 Nov 2024 14:25:10 +0200 Subject: [PATCH 5/7] chore: fix linter issues (#20499) --- flow-client/src/main/frontend/Flow.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flow-client/src/main/frontend/Flow.ts b/flow-client/src/main/frontend/Flow.ts index d9f7515657d..79d82c9dd2a 100644 --- a/flow-client/src/main/frontend/Flow.ts +++ b/flow-client/src/main/frontend/Flow.ts @@ -351,7 +351,7 @@ export class Flow { script.onload = () => resolve(); script.onerror = reject; script.src = url; - const nonce = $wnd.Vaadin.Flow.nonce; + const { nonce } = $wnd.Vaadin.Flow; if (nonce !== undefined) { script.setAttribute('nonce', nonce); } @@ -376,7 +376,7 @@ export class Flow { const scriptAppId = document.createElement('script'); scriptAppId.type = 'module'; scriptAppId.setAttribute('data-app-id', appIdWithoutHashCode); - const nonce = $wnd.Vaadin.Flow.nonce; + const { nonce } = $wnd.Vaadin.Flow; if (nonce !== undefined) { scriptAppId.setAttribute('nonce', nonce); } From 76d5e581dbbb3965aa0b728bffaefae75e877308 Mon Sep 17 00:00:00 2001 From: Vaadin Bot Date: Mon, 18 Nov 2024 13:32:14 +0100 Subject: [PATCH 6/7] chore: update component version to 24.5.5 (#20497) --- flow-tests/vaadin-spring-tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-tests/vaadin-spring-tests/pom.xml b/flow-tests/vaadin-spring-tests/pom.xml index cb716e94be5..1fe5cf474dc 100644 --- a/flow-tests/vaadin-spring-tests/pom.xml +++ b/flow-tests/vaadin-spring-tests/pom.xml @@ -16,7 +16,7 @@ true - 24.5.4 + 24.5.5 9.47 From 7ba0f02e5e37d69397afc53e6fca8e62946f95a6 Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Tue, 19 Nov 2024 09:31:38 +0200 Subject: [PATCH 7/7] docs: fix JavaDoc for npmExcludeWebComponents (#20501) --- .../kotlin/com/vaadin/gradle/VaadinFlowPluginExtension.kt | 2 +- .../java/com/vaadin/flow/plugin/base/PluginAdapterBase.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flow-plugins/flow-gradle-plugin/src/main/kotlin/com/vaadin/gradle/VaadinFlowPluginExtension.kt b/flow-plugins/flow-gradle-plugin/src/main/kotlin/com/vaadin/gradle/VaadinFlowPluginExtension.kt index 93380385efa..a5cc38b75e1 100644 --- a/flow-plugins/flow-gradle-plugin/src/main/kotlin/com/vaadin/gradle/VaadinFlowPluginExtension.kt +++ b/flow-plugins/flow-gradle-plugin/src/main/kotlin/com/vaadin/gradle/VaadinFlowPluginExtension.kt @@ -290,7 +290,7 @@ public abstract class VaadinFlowPluginExtension @Inject constructor(private val public abstract val frontendExtraFileExtensions: ListProperty /** - * Whether to include web component npm packages in packages.json + * Whether to exclude Vaadin web component npm packages in packages.json */ public abstract val npmExcludeWebComponents: Property diff --git a/flow-plugins/flow-plugin-base/src/main/java/com/vaadin/flow/plugin/base/PluginAdapterBase.java b/flow-plugins/flow-plugin-base/src/main/java/com/vaadin/flow/plugin/base/PluginAdapterBase.java index d084c6ca631..3e795ebd948 100644 --- a/flow-plugins/flow-plugin-base/src/main/java/com/vaadin/flow/plugin/base/PluginAdapterBase.java +++ b/flow-plugins/flow-plugin-base/src/main/java/com/vaadin/flow/plugin/base/PluginAdapterBase.java @@ -349,9 +349,9 @@ default Lookup createLookup(ClassFinder classFinder) { List frontendExtraFileExtensions(); /** - * Whether to include web component npm packages in packages.json. + * Whether to exclude Vaadin web component npm packages in packages.json. * - * @return {@code true} to include web component npm packages. + * @return {@code true} to exclude Vaadin web component npm packages. */ boolean isNpmExcludeWebComponents(); }