From bc7c190a84508054244bf77fb4aa653d79dfc325 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Dec 2021 15:39:04 +0200 Subject: [PATCH 01/12] chore(deps-dev): bump tomcat-embed-el from 9.0.55 to 9.0.56 (#12538) Bumps tomcat-embed-el from 9.0.55 to 9.0.56. --- updated-dependencies: - dependency-name: org.apache.tomcat.embed:tomcat-embed-el dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- fusion-endpoint/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fusion-endpoint/pom.xml b/fusion-endpoint/pom.xml index 94f61c825f6..839d9352f89 100644 --- a/fusion-endpoint/pom.xml +++ b/fusion-endpoint/pom.xml @@ -193,7 +193,7 @@ org.apache.tomcat.embed tomcat-embed-el - 9.0.55 + 9.0.56 test From 623079ead73d3dc546cffe1a23a6387d52acbd62 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 8 Dec 2021 16:12:47 +0200 Subject: [PATCH 02/12] chore: Upgrade jaxb (#12508) Should remove the warning The POM for com.sun.xml.bind:jaxb-core:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details --- pom.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ca419baf319..74c353913c6 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,7 @@ 2.13.0 2.0.1.Final 1.3.2 + 2.3.0.1 1.0.18 @@ -663,17 +664,17 @@ javax.xml.bind jaxb-api - 2.2.11 + 2.3.1 com.sun.xml.bind jaxb-core - 2.2.11 + ${jaxb.version} com.sun.xml.bind jaxb-impl - 2.3.5 + ${jaxb.version} com.sun.activation From 74054b89dd75e12b4c18ecce81ff317d03f61671 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 8 Dec 2021 16:13:02 +0200 Subject: [PATCH 03/12] chore: Upgrade workbox (#12509) Related to https://github.com/advisories/GHSA-896r-f27r-55mw --- .../main/java/com/vaadin/flow/server/frontend/NodeUpdater.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java index 220985b92c1..2a0c879064d 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java @@ -385,7 +385,7 @@ Map getDefaultDevDependencies() { defaults.put("typescript", "4.4.3"); - final String WORKBOX_VERSION = "6.2.0"; + final String WORKBOX_VERSION = "6.4.2"; if (featureFlags.isEnabled(FeatureFlags.VITE)) { defaults.put("vite", "v2.7.0"); From 5ab36edafb717aa65e6bd5f36f2b58737415c5f0 Mon Sep 17 00:00:00 2001 From: caalador Date: Wed, 8 Dec 2021 16:13:38 +0200 Subject: [PATCH 04/12] chore: Add issue templates (#12521) --- .github/ISSUE_TEMPLATE/bug_report.md | 35 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 24 ++++++++++++++ .github/ISSUE_TEMPLATE/vite-bug-report.md | 39 +++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/vite-bug-report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..719500de6b4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Issues for Flow related problems +title: '' +labels: '' +assignees: '' + +--- + + +### Description of the bug + +### Minimal reproducible example + +### Expected behavior + +### Actual behavior + +### Versions: + - Vaadin / Flow version: + - Java version: + - OS version: + - Browser version (if applicable): + - Application Server (if applicable): + - IDE (if applicable): diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..192d87dd0a9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,24 @@ +--- +name: Feature request +about: Request for a new feature to Flow +title: '' +labels: enhancement +assignees: '' + +--- + +### Describe your motivation + +A concise description of why you are proposing a change. For example, you would like a new feature to solve a use-case, or you want an existing feature changed because it is difficult to use. + +### Describe the solution you'd like + +Provide a clear and concise description of what you want to happen. + +### Describe alternatives you've considered + +Provide information about other solutions you've tried or researched. + +### Additional context + +Is there anything else you can add about the proposal? diff --git a/.github/ISSUE_TEMPLATE/vite-bug-report.md b/.github/ISSUE_TEMPLATE/vite-bug-report.md new file mode 100644 index 00000000000..987090400b2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/vite-bug-report.md @@ -0,0 +1,39 @@ +--- +name: Vite bug report +about: Issues about the Vite support in Vaadin 22+ +title: '' +labels: vite +assignees: '' + +--- + + +### Description of the bug + +### Minimal reproducible example + +### Expected behavior + +### Actual behavior + +### Versions: + - Vaadin / Flow version: + - Java version: + - OS version: + - Browser version (if applicable): + - Application Server (if applicable): + - IDE (if applicable): + - Development or production mode: + - Project from start.vaadin.com or activated in application: From 0e861bbc598bbe72be22b153752373150b152389 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:19:10 +0200 Subject: [PATCH 05/12] chore(deps-dev): bump equalsverifier from 3.7.2 to 3.8 (#12516) Bumps [equalsverifier](https://github.com/jqno/equalsverifier) from 3.7.2 to 3.8. - [Release notes](https://github.com/jqno/equalsverifier/releases) - [Changelog](https://github.com/jqno/equalsverifier/blob/main/CHANGELOG.md) - [Commits](https://github.com/jqno/equalsverifier/compare/equalsverifier-3.7.2...equalsverifier-3.8) --- updated-dependencies: - dependency-name: nl.jqno.equalsverifier:equalsverifier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- flow-plugins/flow-maven-plugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-plugins/flow-maven-plugin/pom.xml b/flow-plugins/flow-maven-plugin/pom.xml index 21f1f84f66e..6da865cedfc 100644 --- a/flow-plugins/flow-maven-plugin/pom.xml +++ b/flow-plugins/flow-maven-plugin/pom.xml @@ -82,7 +82,7 @@ nl.jqno.equalsverifier equalsverifier - 3.7.2 + 3.8 test From 1bc92923aa4746e6e693a906c0f60848982268a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:19:44 +0200 Subject: [PATCH 06/12] chore(deps): bump formatter-maven-plugin from 2.16.0 to 2.17.1 (#12496) Bumps [formatter-maven-plugin](https://github.com/revelc/formatter-maven-plugin) from 2.16.0 to 2.17.1. - [Release notes](https://github.com/revelc/formatter-maven-plugin/releases) - [Changelog](https://github.com/revelc/formatter-maven-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/revelc/formatter-maven-plugin/compare/formatter-maven-plugin-2.16.0...formatter-maven-plugin-2.17.1) --- updated-dependencies: - dependency-name: net.revelc.code.formatter:formatter-maven-plugin 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> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 74c353913c6..c24255ecd92 100644 --- a/pom.xml +++ b/pom.xml @@ -299,7 +299,7 @@ net.revelc.code.formatter formatter-maven-plugin - 2.16.0 + 2.17.1 https://raw.githubusercontent.com/vaadin/flow/master/eclipse/VaadinJavaConventions.xml From 39a945df42df1fb6026ac2d0396141fe75d65b79 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:31:18 +0200 Subject: [PATCH 07/12] chore(deps-dev): bump org.eclipse.core.contenttype (#12540) Bumps org.eclipse.core.contenttype from 3.7.1000 to 3.8.100. --- updated-dependencies: - dependency-name: org.eclipse.platform:org.eclipse.core.contenttype dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- flow-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-client/pom.xml b/flow-client/pom.xml index 7cbc175ddf4..81b3319e96a 100644 --- a/flow-client/pom.xml +++ b/flow-client/pom.xml @@ -96,7 +96,7 @@ org.eclipse.platform org.eclipse.core.contenttype - 3.7.1000 + 3.8.100 test From b8e69d5e16a6e17c67118a12d753aebe8dfa18b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:44:47 +0200 Subject: [PATCH 08/12] chore(deps): bump byte-buddy from 1.12.2 to 1.12.3 (#12510) Bumps [byte-buddy](https://github.com/raphw/byte-buddy) from 1.12.2 to 1.12.3. - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.12.2...byte-buddy-1.12.3) --- updated-dependencies: - dependency-name: net.bytebuddy:byte-buddy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c24255ecd92..4964c5116d2 100644 --- a/pom.xml +++ b/pom.xml @@ -234,7 +234,7 @@ net.bytebuddy byte-buddy - 1.12.2 + 1.12.3 From 22511e31b24dff938d3e24aa28df75fd6b9da0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Wed, 8 Dec 2021 17:34:38 +0200 Subject: [PATCH 09/12] Revert "chore(deps-dev): bump org.eclipse.core.contenttype (#12540)" (#12543) This reverts commit 39a945df42df1fb6026ac2d0396141fe75d65b79. --- flow-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-client/pom.xml b/flow-client/pom.xml index 81b3319e96a..7cbc175ddf4 100644 --- a/flow-client/pom.xml +++ b/flow-client/pom.xml @@ -96,7 +96,7 @@ org.eclipse.platform org.eclipse.core.contenttype - 3.8.100 + 3.7.1000 test From b7609102e9b3386d884b12614d229346de13e232 Mon Sep 17 00:00:00 2001 From: Artur Date: Thu, 9 Dec 2021 10:57:54 +0200 Subject: [PATCH 10/12] fix: Do not throw NPE for UI.access called when session has expired (#12531) Fixes #12100 --- .../java/com/vaadin/flow/component/UI.java | 20 ++++++++- .../com/vaadin/flow/component/UITest.java | 44 ++++++++++++++++++- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/component/UI.java b/flow-server/src/main/java/com/vaadin/flow/component/UI.java index 9874f78c8e6..07908dd1278 100644 --- a/flow-server/src/main/java/com/vaadin/flow/component/UI.java +++ b/flow-server/src/main/java/com/vaadin/flow/component/UI.java @@ -23,6 +23,7 @@ import java.util.Objects; import java.util.Optional; import java.util.UUID; +import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.regex.Pattern; @@ -527,9 +528,24 @@ public void handleError(Exception exception) { if (command instanceof ErrorHandlingCommand) { ErrorHandlingCommand errorHandlingCommand = (ErrorHandlingCommand) command; errorHandlingCommand.handleError(exception); - } else { + } else if (getSession() != null) { getSession().getErrorHandler() .error(new ErrorEvent(exception)); + } else { + /* + * The session has expired after `ui.access` was called. + * It makes no sense to pollute the logs with a + * UIDetachedException at this point. + */ + if (exception instanceof ExecutionException + && ((ExecutionException) exception) + .getCause() instanceof UIDetachedException) { + getLogger().debug(exception.getMessage(), + exception); + } else { + getLogger().error(exception.getMessage(), + exception); + } } } catch (Exception e) { getLogger().error(e.getMessage(), e); @@ -708,7 +724,7 @@ public ReconnectDialogConfiguration getReconnectDialogConfiguration() { return getNode().getFeature(ReconnectDialogConfigurationMap.class); } - private static Logger getLogger() { + Logger getLogger() { return LoggerFactory.getLogger(UI.class.getName()); } diff --git a/flow-server/src/test/java/com/vaadin/flow/component/UITest.java b/flow-server/src/test/java/com/vaadin/flow/component/UITest.java index f676dbe181d..57fada10338 100644 --- a/flow-server/src/test/java/com/vaadin/flow/component/UITest.java +++ b/flow-server/src/test/java/com/vaadin/flow/component/UITest.java @@ -16,6 +16,9 @@ package com.vaadin.flow.component; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -24,6 +27,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; +import org.apache.commons.io.IOUtils; import org.hamcrest.CoreMatchers; import org.hamcrest.MatcherAssert; import org.junit.After; @@ -31,7 +35,11 @@ import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.ArgumentMatchers; +import org.mockito.MockedStatic; import org.mockito.Mockito; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.impl.SimpleLogger; import com.vaadin.flow.component.internal.PendingJavaScriptInvocation; import com.vaadin.flow.component.page.History; @@ -80,6 +88,7 @@ import com.vaadin.flow.server.VaadinResponse; import com.vaadin.flow.server.VaadinService; import com.vaadin.flow.server.VaadinServletRequest; +import com.vaadin.flow.server.frontend.MockLogger; import com.vaadin.flow.shared.Registration; import com.vaadin.tests.util.AlwaysLockedVaadinSession; import com.vaadin.tests.util.MockUI; @@ -88,6 +97,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mockStatic; public class UITest { @@ -183,11 +193,17 @@ public void elementIsBody() { } private static UI createTestUI() { + MockLogger mockLogger = new MockLogger(); UI ui = new UI() { @Override public void doInit(VaadinRequest request, int uiId) { } + + @Override + Logger getLogger() { + return mockLogger; + } }; return ui; @@ -514,7 +530,7 @@ public void unsetSession_detachEventIsFiredForUIChildren() } @Test - public void unserSession_datachEventIsFiredForElements() { + public void unsetSession_detachEventIsFiredForElements() { UI ui = createTestUI(); List events = new ArrayList<>(); @@ -536,6 +552,32 @@ public void unserSession_datachEventIsFiredForElements() { assertEquals(ui.getElement(), events.get(1).getSource()); } + @Test + public void unsetSession_accessErrorHandlerStillWorks() throws IOException { + UI ui = createTestUI(); + initUI(ui, "", null); + + ui.getSession().access(() -> ui.getInternals().setSession(null)); + ui.access(() -> { + Assert.fail("We should never get here because the UI is detached"); + }); + + // Unlock to run pending access tasks + ui.getSession().unlock(); + + String logOutput = ((MockLogger) ui.getLogger()).getLogs(); + String logOutputNoDebug = logOutput.replaceAll("^\\[Debug\\].*", ""); + + Assert.assertFalse( + "No NullPointerException should be logged but got: " + + logOutput, + logOutput.contains("NullPointerException")); + Assert.assertFalse( + "No UIDetachedException should be logged but got: " + + logOutputNoDebug, + logOutputNoDebug.contains("UIDetachedException")); + } + @Test public void beforeClientResponse_regularOrder() { UI ui = createTestUI(); From 66c589e339b3649e288c6c8e023838f822ee3400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Fri, 10 Dec 2021 10:00:08 +0200 Subject: [PATCH 11/12] Revert "chore: replace exec-maven-plugin with gradle-maven-plugin (#12501)" (#12551) This reverts commit 2ecff678624336b6faf5003a3f210aad730d970f. --- flow-plugins/flow-gradle-plugin/pom.xml | 63 +++++++++++++++---------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/flow-plugins/flow-gradle-plugin/pom.xml b/flow-plugins/flow-gradle-plugin/pom.xml index ab50b7e0797..8992f54c873 100644 --- a/flow-plugins/flow-gradle-plugin/pom.xml +++ b/flow-plugins/flow-gradle-plugin/pom.xml @@ -18,6 +18,10 @@ central repo is done within platform final releases. + + ./gradlew + + com.vaadin @@ -51,40 +55,34 @@ - + + - codes.rafael.gradlemavenplugin - gradle-maven-plugin - 1.0.10 - - 7.3 - - clean - build - javadocJar - - - -x - functionalTest - -S - - + org.codehaus.mojo + exec-maven-plugin + 3.0.0 + gradle prepare-package + + ${gradle.executable} + + clean + build + javadocJar + -x + functionalTest + -S + + - invoke + exec - - - org.gradle - gradle-tooling-api - 7.3-20210825160000+0000 - - + maven-resources-plugin @@ -140,7 +138,20 @@ - + + + + windows_profile + + + Windows + + + + gradlew.bat + + + From 5ec8ddd904d3d8f0103737ef72f53d20dd707f31 Mon Sep 17 00:00:00 2001 From: Tarek Oraby <42799254+tarekoraby@users.noreply.github.com> Date: Fri, 10 Dec 2021 11:20:32 +0200 Subject: [PATCH 12/12] fix: outdated links to production mode docs (#12553) * Fix outdated link to production mode docs * Fix outdated link to production mode docs --- .../com/vaadin/flow/server/DefaultDeploymentConfiguration.java | 2 +- .../flow/server/startup/AbstractConfigurationFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java b/flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java index b67c147b435..aa02f373c58 100755 --- a/flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java @@ -46,7 +46,7 @@ public class DefaultDeploymentConfiguration public static final String NOT_PRODUCTION_MODE_WARNING = "\nWARNING: Vaadin is running in DEBUG MODE with debug features enabled, but with a prebuild frontend bundle (production ready).\n" + "When deploying application for production, disable debug features by enabling production mode!\n" - + "See more from https://vaadin.com/docs/v14/flow/production/tutorial-production-mode-basic.html"; + + "See more from https://vaadin.com/docs/latest/flow/production/overview"; public static final String WARNING_V14_BOOTSTRAP = "Using deprecated Vaadin 14 bootstrap mode.\n" + "Client-side views written in TypeScript are not supported. Vaadin 15+ enables client-side and server-side views.\n" diff --git a/flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractConfigurationFactory.java b/flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractConfigurationFactory.java index 4d372c9a415..33426315da7 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractConfigurationFactory.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractConfigurationFactory.java @@ -61,7 +61,7 @@ public class AbstractConfigurationFactory implements Serializable { public static final String DEV_FOLDER_MISSING_MESSAGE = "Running project in development mode with no access to folder '%s'.%n" - + "Build project in production mode instead, see https://vaadin.com/docs/v15/flow/production/tutorial-production-mode-basic.html"; + + "Build project in production mode instead, see https://vaadin.com/docs/latest/flow/production/overview"; /** * Returns the config parameters from the token file data {@code buildInfo}.