├── vaadin-gradle-plugin ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ └── site │ │ └── site.xml └── gradlew.bat ├── vaadin-platform-hybrid-test ├── frontend │ ├── themes │ │ └── fusion-test │ │ │ ├── styles.css │ │ │ └── theme.json │ ├── views │ │ ├── helloworld │ │ │ └── hello-world-view.css │ │ ├── view.ts │ │ └── helloworldts │ │ │ └── hello-world-ts-view.ts │ ├── index.ts │ ├── index.html │ └── routes.ts ├── .npmrc └── src │ ├── main │ ├── resources │ │ ├── META-INF │ │ │ └── resources │ │ │ │ ├── icons │ │ │ │ └── icon.png │ │ │ │ └── images │ │ │ │ └── logo.png │ │ ├── banner.txt │ │ └── application.properties │ └── java │ │ └── com │ │ └── vaadin │ │ └── platform │ │ └── fusion │ │ └── test │ │ ├── Application.java │ │ └── views │ │ └── helloworld │ │ └── HelloWorldView.java │ └── test │ └── java │ └── com │ └── vaadin │ └── platform │ └── fusion │ └── offline │ ├── ComponentsIT.java │ └── ChromeOfflineIT.java ├── scripts ├── generator │ ├── templates │ │ ├── template-vaadin-versions.json │ │ ├── template-vaadin-core-versions.json │ │ ├── template-modules-release-notes.md │ │ ├── template-vaadin-core-package.json │ │ ├── template-vaadin-package.json │ │ ├── template-vaadin-gradle-plugin-portal-pom.xml │ │ ├── template-vaadin-quarkus-pom.xml │ │ ├── template-release-notes-maintenance.md │ │ ├── template-servlet-containers-tests-pom.xml │ │ └── template-release-notes-prerelease.md │ ├── README.md │ ├── package.json │ ├── test │ │ └── transformerTest.js │ └── src │ │ ├── replacer.js │ │ ├── transformer.js │ │ └── writer.js ├── checkForNonPinnedDependencies.sh ├── npmShrinkwrap.sh ├── updateVersions.py ├── verifyNpmDependencies.sh ├── generateBoms.sh ├── validateVersions.js └── listBreakingChanges.js ├── vaadin-hybrid-dev-bundle ├── src │ ├── main │ │ ├── frontend │ │ │ ├── themes │ │ │ │ └── vaadin-dev-bundle │ │ │ │ │ ├── styles.css │ │ │ │ │ └── theme.json │ │ │ └── views │ │ │ │ └── __dummy__.tsx │ │ ├── resources │ │ │ └── vaadin-featureflags.properties │ │ └── java │ │ │ └── com │ │ │ └── vaadin │ │ │ └── devbundle │ │ │ └── FakeAppConf.java │ └── test │ │ └── java │ │ └── com │ │ └── vaadin │ │ └── devbundle │ │ └── HybridBundleTest.java └── .gitignore ├── vaadin-platform-react-hybrid-test └── src │ ├── main │ ├── frontend │ │ ├── themes │ │ │ └── react-test │ │ │ │ ├── styles.css │ │ │ │ └── theme.json │ │ ├── views │ │ │ ├── hilla │ │ │ │ ├── @index.tsx │ │ │ │ ├── hello-react.tsx │ │ │ │ └── @layout.tsx │ │ │ ├── @index.tsx │ │ │ ├── flow │ │ │ │ ├── hello-hilla.tsx │ │ │ │ └── no-layout.tsx │ │ │ └── home │ │ │ │ ├── deep │ │ │ │ └── hello.tsx │ │ │ │ └── deepend │ │ │ │ └── deep.tsx │ │ └── index.html │ ├── resources │ │ ├── META-INF │ │ │ └── resources │ │ │ │ ├── icons │ │ │ │ └── icon.png │ │ │ │ └── images │ │ │ │ └── logo.png │ │ ├── banner.txt │ │ └── application.properties │ └── java │ │ └── com │ │ └── vaadin │ │ └── platform │ │ └── react │ │ └── test │ │ ├── views │ │ ├── DeepLayout.java │ │ ├── FlowMainView.java │ │ ├── HelloWorldView.java │ │ ├── FlowHillaView.java │ │ └── FlowLayout.java │ │ └── Application.java │ └── test │ └── java │ └── com │ └── vaadin │ └── platform │ └── react │ └── test │ ├── ComponentsIT.java │ └── HillaMainLayoutIT.java ├── vaadin-platform-react-hybrid-security-test └── src │ └── main │ ├── frontend │ ├── themes │ │ └── react-test │ │ │ ├── styles.css │ │ │ └── theme.json │ ├── auth.tsx │ ├── views │ │ ├── hilla │ │ │ ├── hello-react.tsx │ │ │ ├── @index.tsx │ │ │ ├── user.tsx │ │ │ ├── admin.tsx │ │ │ └── @layout.tsx │ │ ├── flow │ │ │ └── hello-hilla.tsx │ │ ├── @index.tsx │ │ └── login.tsx │ ├── index.html │ └── index.tsx │ ├── resources │ ├── META-INF │ │ └── resources │ │ │ ├── icons │ │ │ └── icon.png │ │ │ └── images │ │ │ └── logo.png │ ├── banner.txt │ └── application.properties │ └── java │ └── com │ └── vaadin │ └── platform │ └── react │ └── test │ ├── security │ ├── Role.java │ ├── UserInfo.java │ ├── UserInfoService.java │ └── SecurityConfig.java │ ├── views │ ├── AccessLayout.java │ ├── UserView.java │ ├── AdminView.java │ ├── LayoutSecuredView.java │ ├── FlowMainView.java │ ├── FlowHillaView.java │ ├── PublicView.java │ └── FlowLayout.java │ └── Application.java ├── vaadin-dev-bundle ├── .gitignore └── src │ ├── main │ ├── resources │ │ └── vaadin-featureflags.properties │ └── java │ │ └── com │ │ └── vaadin │ │ └── devbundle │ │ └── FakeAppConf.java │ └── test │ └── java │ └── com │ └── vaadin │ └── devbundle │ └── BundleTest.java ├── vaadin-prod-bundle ├── .gitignore └── src │ └── main │ ├── resources │ └── vaadin-featureflags.properties │ └── java │ └── com │ └── vaadin │ └── prodbundle │ ├── MapView.java │ ├── ChartsView.java │ ├── SpreadsheetView.java │ ├── RichTextEditorView.java │ ├── IconView.java │ └── FakeAppConf.java ├── vaadin └── src │ └── main │ ├── resources │ └── README │ └── feature │ └── feature.xml ├── vaadin-platform-gradle-test ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ ├── resources │ │ │ ├── simplelogger.properties │ │ │ └── vaadin-featureflags.properties │ │ ├── frontend │ │ │ └── themes │ │ │ │ └── gradle-test │ │ │ │ ├── styles.css │ │ │ │ ├── components │ │ │ │ └── vaadin-text-field.css │ │ │ │ └── theme.json │ │ └── java │ │ │ └── com │ │ │ └── vaadin │ │ │ └── platform │ │ │ └── gradle │ │ │ └── test │ │ │ ├── service │ │ │ └── GreetService.java │ │ │ └── views │ │ │ └── helloview │ │ │ ├── AppShell.java │ │ │ └── HelloVaadinerView.java │ └── test │ │ └── java │ │ └── com │ │ └── vaadin │ │ └── platform │ │ └── gradle │ │ └── test │ │ └── AbstractPlatformTest.java ├── settings.gradle ├── gradlew.bat └── build.gradle ├── vaadin-platform-test ├── src │ ├── main │ │ ├── resources │ │ │ └── vaadin-featureflags.properties │ │ └── java │ │ │ └── com │ │ │ └── vaadin │ │ │ └── platform │ │ │ └── test │ │ │ ├── Log.java │ │ │ ├── Entity.java │ │ │ └── CustomServletDeployer.java │ └── test │ │ └── java │ │ └── com │ │ └── vaadin │ │ └── platform │ │ └── test │ │ ├── DefaultDevBundleIT.java │ │ └── AbstractPlatformTest.java └── bnd.bnd ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yml │ ├── bug_report.yml │ └── acceptance-criteria.md └── workflows │ ├── full-release-note.yml │ └── check-published-sbom.yml ├── vaadin-maven-plugin └── src │ └── site │ └── site.xml ├── vaadin-core └── src │ └── main │ └── feature │ └── feature.xml ├── vaadin-platform-servlet-containers-tests └── bnd-tools-test │ ├── app.bndrun │ └── src │ └── test │ └── java │ └── com │ └── vaadin │ └── platform │ └── wait │ └── WaitHttpIT.java ├── .gitignore ├── hilla-spring-boot-starter └── pom.xml ├── README.md ├── vaadin-core-internal └── src │ └── test │ └── java │ └── VersionsFileTest.java ├── vaadin-core-sbom └── pom.xml ├── vaadin-quarkus ├── vaadin-quarkus-extension-deployment │ └── pom.xml └── vaadin-quarkus-extension │ └── scripts │ └── MetaDataReplacements.java ├── vaadin-spring-boot-starter └── pom.xml ├── vaadin-core-jandex ├── src │ └── test │ │ └── java │ │ └── com │ │ └── vaadin │ │ └── jandex │ │ └── JandexSmokeTest.java └── pom.xml ├── vaadin-jandex ├── src │ └── test │ │ └── java │ │ └── com │ │ └── vaadin │ │ └── jandex │ │ └── JandexSmokeTest.java └── pom.xml ├── vaadin-internal └── pom.xml ├── vaadin-dev └── pom.xml └── vaadin-platform-sbom └── pom.xml /vaadin-gradle-plugin/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.daemon=false 2 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/frontend/themes/fusion-test/styles.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-vaadin-versions.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /vaadin-hybrid-dev-bundle/src/main/frontend/themes/vaadin-dev-bundle/styles.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vaadin-hybrid-dev-bundle/src/main/resources/vaadin-featureflags.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-vaadin-core-versions.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/themes/react-test/styles.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/themes/react-test/styles.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vaadin-dev-bundle/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/frontend/index.html 2 | src/main/bundles 3 | vite.*.ts 4 | -------------------------------------------------------------------------------- /vaadin-prod-bundle/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/frontend/index.html 2 | src/main/bundles 3 | vite.*.ts 4 | -------------------------------------------------------------------------------- /vaadin-hybrid-dev-bundle/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/frontend/index.html 2 | src/main/bundles 3 | vite.*.ts 4 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-modules-release-notes.md: -------------------------------------------------------------------------------- 1 | # Vaadin {{platform}} 2 | {{modulesReleaseNotes}} -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/frontend/themes/fusion-test/theme.json: -------------------------------------------------------------------------------- 1 | {"lumoImports":["typography","color","badge"]} -------------------------------------------------------------------------------- /vaadin/src/main/resources/README: -------------------------------------------------------------------------------- 1 | This is only a meta JAR which defines dependencies and contain no classes of its own -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/themes/react-test/theme.json: -------------------------------------------------------------------------------- 1 | {"lumoImports":["typography","color","badge"]} -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/gradle.properties: -------------------------------------------------------------------------------- 1 | vaadinVersion=25.0-SNAPSHOT 2 | pluginVersion=25.0-SNAPSHOT 3 | org.gradle.daemon=false 4 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/themes/react-test/theme.json: -------------------------------------------------------------------------------- 1 | {"lumoImports":["typography","color","badge"]} -------------------------------------------------------------------------------- /vaadin-hybrid-dev-bundle/src/main/frontend/views/__dummy__.tsx: -------------------------------------------------------------------------------- 1 | const __dummy__ = "Fake view only used to trigger Hilla usage in frontend build"; -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/frontend/views/helloworld/hello-world-view.css: -------------------------------------------------------------------------------- 1 | .hello-world-view { 2 | display: block; 3 | padding: 1em; 4 | } 5 | -------------------------------------------------------------------------------- /vaadin-gradle-plugin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/platform/HEAD/vaadin-gradle-plugin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /vaadin-hybrid-dev-bundle/src/main/frontend/themes/vaadin-dev-bundle/theme.json: -------------------------------------------------------------------------------- 1 | { 2 | "lumoImports": ["typography", "color", "spacing", "badge", "utility"] 3 | } 4 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/platform/HEAD/vaadin-platform-gradle-test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/main/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | org.slf4j.simpleLogger.defaultLogLevel = info 2 | org.slf4j.simpleLogger.log.org.atmosphere = warn 3 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/main/resources/vaadin-featureflags.properties: -------------------------------------------------------------------------------- 1 | # Enable theme component style injection 2 | com.vaadin.experimental.themeComponentStyles=true 3 | -------------------------------------------------------------------------------- /vaadin-dev-bundle/src/main/resources/vaadin-featureflags.properties: -------------------------------------------------------------------------------- 1 | # Master Detail Layout Component (Experimental) 2 | com.vaadin.experimental.masterDetailLayoutComponent=true 3 | -------------------------------------------------------------------------------- /vaadin-platform-test/src/main/resources/vaadin-featureflags.properties: -------------------------------------------------------------------------------- 1 | # Master Detail Layout Component (Experimental) 2 | com.vaadin.experimental.masterDetailLayoutComponent=true 3 | -------------------------------------------------------------------------------- /vaadin-prod-bundle/src/main/resources/vaadin-featureflags.properties: -------------------------------------------------------------------------------- 1 | # Master Detail Layout Component (Experimental) 2 | com.vaadin.experimental.masterDetailLayoutComponent=true 3 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/.npmrc: -------------------------------------------------------------------------------- 1 | # 2 | # NOTICE: this is an auto-generated file 3 | # 4 | # This file sets the default parameters for manual `pnpm install`. 5 | # 6 | shamefully-hoist=true 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Vaadin Forum 4 | url: https://vaadin.com/forum/ 5 | about: You can ask questions for fast responses here. 6 | -------------------------------------------------------------------------------- /vaadin-gradle-plugin/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Vaadin Gradle Plugin 4 | https://vaadin.com/ 5 | 6 | 7 | -------------------------------------------------------------------------------- /vaadin-maven-plugin/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Vaadin Maven Plugin 4 | https://vaadin.com/ 5 | 6 | 7 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/main/frontend/themes/gradle-test/styles.css: -------------------------------------------------------------------------------- 1 | @import '@vaadin/vaadin-lumo-styles/lumo.css'; 2 | 3 | .centered-content { 4 | margin: 0 auto; 5 | max-width: 250px; 6 | } 7 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/src/main/resources/META-INF/resources/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/platform/HEAD/vaadin-platform-hybrid-test/src/main/resources/META-INF/resources/icons/icon.png -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/src/main/resources/META-INF/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/platform/HEAD/vaadin-platform-hybrid-test/src/main/resources/META-INF/resources/images/logo.png -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/resources/META-INF/resources/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/platform/HEAD/vaadin-platform-react-hybrid-test/src/main/resources/META-INF/resources/icons/icon.png -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/main/frontend/themes/gradle-test/components/vaadin-text-field.css: -------------------------------------------------------------------------------- 1 | [part="input-field"] { 2 | box-shadow: inset 0 0 0 1px var(--lumo-contrast-30pct); 3 | background-color: orange; 4 | } 5 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/resources/META-INF/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/platform/HEAD/vaadin-platform-react-hybrid-test/src/main/resources/META-INF/resources/images/logo.png -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | mavenLocal() 4 | maven { url = 'https://maven.vaadin.com/vaadin-prereleases' } 5 | gradlePluginPortal() 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/frontend/index.ts: -------------------------------------------------------------------------------- 1 | import { Router } from '@vaadin/router'; 2 | import { routes } from './routes'; 3 | 4 | export const router = new Router(document.querySelector('#outlet')); 5 | router.setRoutes(routes); 6 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/frontend/views/view.ts: -------------------------------------------------------------------------------- 1 | import { LitElement } from 'lit'; 2 | 3 | export class View extends LitElement { 4 | createRenderRoot() { 5 | // Do not use a shadow root 6 | return this; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/resources/META-INF/resources/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/platform/HEAD/vaadin-platform-react-hybrid-security-test/src/main/resources/META-INF/resources/icons/icon.png -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/resources/META-INF/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/platform/HEAD/vaadin-platform-react-hybrid-security-test/src/main/resources/META-INF/resources/images/logo.png -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/security/Role.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.security; 2 | 3 | public class Role { 4 | public static final String USER = "USER"; 5 | public static final String ADMIN = "ADMIN"; 6 | } 7 | -------------------------------------------------------------------------------- /vaadin-gradle-plugin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/main/frontend/themes/gradle-test/theme.json: -------------------------------------------------------------------------------- 1 | { 2 | "importCss": ["@fortawesome/fontawesome-free/css/all.css"], 3 | "assets": { 4 | "@fortawesome/fontawesome-free": { 5 | "svgs/brands/**": "fontawesome/svgs/brands" 6 | } 7 | }, 8 | "lumoImports":[ 9 | "typography","color","badge" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /vaadin-dev-bundle/src/main/java/com/vaadin/devbundle/FakeAppConf.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.devbundle; 2 | 3 | import com.vaadin.flow.component.page.AppShellConfigurator; 4 | import com.vaadin.flow.server.PWA; 5 | 6 | @PWA(name = "vaadin-dev-bundle", shortName = "vaadin-dev-bundle") 7 | public class FakeAppConf implements AppShellConfigurator{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /scripts/generator/README.md: -------------------------------------------------------------------------------- 1 | Generates `package.json` for core, `package.json` for vaadin, Maven BOM and release 2 | notes from `versions.json`. 3 | 4 | ## Run 5 | 6 | `npm install && node generate.js --platform=10.0.0.beta42 --versions=versions.json` 7 | 8 | Generate Java dependencies with SNAPSHOT version by using `--useSnapshots`. 9 | 10 | ## Test 11 | 12 | `npm test` 13 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/auth.tsx: -------------------------------------------------------------------------------- 1 | import { UserInfoService } from 'Frontend/generated/endpoints'; 2 | import {configureAuth} from "@vaadin/hilla-react-auth"; 3 | 4 | const auth = configureAuth(UserInfoService.getUserInfo, { 5 | getRoles: (userInfo) => userInfo.authorities, 6 | }); 7 | 8 | export const useAuth = auth.useAuth; 9 | export const AuthProvider = auth.AuthProvider; -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/main/java/com/vaadin/platform/gradle/test/service/GreetService.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.gradle.test.service; 2 | 3 | public class GreetService { 4 | 5 | public String greet(String name) { 6 | if (name == null || name.isEmpty()) { 7 | return "Hello anonymous user"; 8 | } else { 9 | return "Hello " + name; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vaadin-hybrid-dev-bundle/src/main/java/com/vaadin/devbundle/FakeAppConf.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.devbundle; 2 | 3 | import com.vaadin.flow.component.page.AppShellConfigurator; 4 | import com.vaadin.flow.server.PWA; 5 | import com.vaadin.flow.theme.Theme; 6 | 7 | @Theme("vaadin-dev-bundle") 8 | @PWA(name = "vaadin-dev-bundle", shortName = "vaadin-dev-bundle") 9 | public class FakeAppConf implements AppShellConfigurator{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ,------. ,--. ,--. ,--. 2 | | .--. ' ,---. ,--,--. ,---.,-' '-.,-----.,-' '-. ,---. ,---.,-' '-. 3 | | '--'.'| .-. :' ,-. || .--''-. .-''-----''-. .-'| .-. :( .-''-. .-' 4 | | |\ \ \ --.\ '-' |\ `--. | | | | \ --..-' `) | | 5 | `--' '--' `----' `--`--' `---' `--' `--' `----'`----' `--' -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | __ _ _ _ 2 | / _| _ _ ___ (_) ___ _ __ | |_ ___ ___ | |_ 3 | | |_ | | | |/ __|| | / _ \ | '_ \ _____ | __| / _ \/ __|| __| 4 | | _|| |_| |\__ \| || (_) || | | ||_____|| |_ | __/\__ \| |_ 5 | |_| \__,_||___/|_| \___/ |_| |_| \__| \___||___/ \__| 6 | 7 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ,------. ,--. ,--. ,--. 2 | | .--. ' ,---. ,--,--. ,---.,-' '-.,-----.,-' '-. ,---. ,---.,-' '-. 3 | | '--'.'| .-. :' ,-. || .--''-. .-''-----''-. .-'| .-. :( .-''-. .-' 4 | | |\ \ \ --.\ '-' |\ `--. | | | | \ --..-' `) | | 5 | `--' '--' `----' `--`--' `---' `--' `--' `----'`----' `--' -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=${PORT:8080} 2 | logging.level.org.atmosphere = warn 3 | spring.mustache.check-template-location = false 4 | vaadin.devmode.liveReload.enabled = false 5 | 6 | # To improve the performance during development. 7 | # For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters 8 | # vaadin.whitelisted-packages= org/vaadin/example 9 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=${PORT:8080} 2 | logging.level.org.atmosphere = warn 3 | spring.mustache.check-template-location = false 4 | vaadin.devmode.liveReload.enabled = false 5 | 6 | # To improve the performance during development. 7 | # For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters 8 | # vaadin.whitelisted-packages= org/vaadin/example 9 | -------------------------------------------------------------------------------- /vaadin-prod-bundle/src/main/java/com/vaadin/prodbundle/MapView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.prodbundle; 2 | 3 | import com.vaadin.flow.component.html.Div; 4 | import com.vaadin.flow.component.map.Map; 5 | import com.vaadin.flow.router.Route; 6 | import com.vaadin.flow.router.internal.DependencyTrigger; 7 | 8 | @Route 9 | @DependencyTrigger(Map.class) 10 | public class MapView extends Div { 11 | 12 | public MapView() { 13 | add(new Map()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=${PORT:8080} 2 | logging.level.org.atmosphere = warn 3 | spring.mustache.check-template-location = false 4 | vaadin.devmode.liveReload.enabled = false 5 | 6 | # To improve the performance during development. 7 | # For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters 8 | # vaadin.whitelisted-packages= org/vaadin/example 9 | -------------------------------------------------------------------------------- /vaadin-prod-bundle/src/main/java/com/vaadin/prodbundle/ChartsView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.prodbundle; 2 | 3 | import com.vaadin.flow.component.charts.Chart; 4 | import com.vaadin.flow.component.html.Div; 5 | import com.vaadin.flow.router.Route; 6 | import com.vaadin.flow.router.internal.DependencyTrigger; 7 | 8 | @Route 9 | @DependencyTrigger(Chart.class) 10 | public class ChartsView extends Div { 11 | 12 | public ChartsView() { 13 | add(new Chart()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vaadin/src/main/feature/feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | mvn:com.vaadin/vaadin-core/${project.version}/xml/features 5 | 6 | 7 |
Vaadin feature
8 | vaadin-core 9 |
10 |
11 | -------------------------------------------------------------------------------- /vaadin-prod-bundle/src/main/java/com/vaadin/prodbundle/SpreadsheetView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.prodbundle; 2 | 3 | import com.vaadin.flow.component.html.Div; 4 | import com.vaadin.flow.component.spreadsheet.Spreadsheet; 5 | import com.vaadin.flow.router.Route; 6 | import com.vaadin.flow.router.internal.DependencyTrigger; 7 | 8 | @Route 9 | @DependencyTrigger(Spreadsheet.class) 10 | public class SpreadsheetView extends Div { 11 | 12 | public SpreadsheetView() { 13 | add(new Spreadsheet()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /scripts/checkForNonPinnedDependencies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | while read line 3 | do 4 | echo "$line" 5 | if [[ $line == *"version selected from constraint"* ]]; then 6 | echo "Error: Have found versions that are selected from constraint, pin those so they won't change themselves." 7 | echo "Run mvn:dependency-tree to see all dependencies, including the ones marked as 'selected from constraint'" 8 | exit 1 9 | fi 10 | done < <(mvn -B dependency:tree) 11 | echo "OK: No non-pinned dependencies" 12 | -------------------------------------------------------------------------------- /vaadin-prod-bundle/src/main/java/com/vaadin/prodbundle/RichTextEditorView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.prodbundle; 2 | 3 | import com.vaadin.flow.component.html.Div; 4 | import com.vaadin.flow.component.richtexteditor.RichTextEditor; 5 | import com.vaadin.flow.router.Route; 6 | import com.vaadin.flow.router.internal.DependencyTrigger; 7 | 8 | @Route 9 | @DependencyTrigger(RichTextEditor.class) 10 | public class RichTextEditorView extends Div { 11 | 12 | public RichTextEditorView() { 13 | add(new RichTextEditor()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vaadin-prod-bundle/src/main/java/com/vaadin/prodbundle/IconView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.prodbundle; 2 | 3 | import com.vaadin.flow.component.html.Div; 4 | import com.vaadin.flow.component.icon.Icon; 5 | import com.vaadin.flow.router.Route; 6 | import com.vaadin.flow.router.internal.DependencyTrigger; 7 | import com.vaadin.flow.theme.lumo.LumoIcon; 8 | 9 | @Route 10 | @DependencyTrigger(Icon.class) 11 | public class IconView extends Div { 12 | 13 | public IconView() { 14 | add(LumoIcon.ARROW_DOWN.create()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /vaadin-platform-test/bnd.bnd: -------------------------------------------------------------------------------- 1 | -fixupmessages: 2 | Bundle-SymbolicName: ${project.groupId}.platform-test 3 | Bundle-Name: Vaadin Platform Server Tests 4 | Bundle-Version: ${osgi.bundle.version} 5 | Bundle-RequiredExecutionEnvironment: JavaSE-11 6 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0 7 | Import-Package: * 8 | Export-Package: com.vaadin.platform.test*;-noimport:=true 9 | Vaadin-OSGi-Extender: true 10 | Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.component)(version>=1.4.0)(!(version>=2.0.0)))",osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=11))" 11 | -------------------------------------------------------------------------------- /scripts/generator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vaadin-releaser", 3 | "version": "1.0.0", 4 | "description": "Write platform dependencies from version file", 5 | "main": "index.js", 6 | "author": "Vaadin", 7 | "license": "Apache-2.0", 8 | "scripts": { 9 | "test": "mocha" 10 | }, 11 | "dependencies": { 12 | "compare-versions": "^3.4.0", 13 | "minimist": "^1.2.3", 14 | "sync-request": "^6.0.0" 15 | }, 16 | "devDependencies": { 17 | "chai": "^4.1.2", 18 | "eslint-config-airbnb-base": "^12.1.0", 19 | "eslint-plugin-import": "^2.12.0", 20 | "mocha": "^5.2.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-prod-bundle/src/main/java/com/vaadin/prodbundle/FakeAppConf.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.prodbundle; 2 | 3 | import com.vaadin.flow.component.dependency.JsModule; 4 | import com.vaadin.flow.component.dnd.internal.DndUtil; 5 | import com.vaadin.flow.component.page.AppShellConfigurator; 6 | import com.vaadin.flow.server.LoadDependenciesOnStartup; 7 | import com.vaadin.flow.server.PWA; 8 | 9 | @PWA(name = "vaadin-prod-bundle", shortName = "vaadin-prod-bundle") 10 | @LoadDependenciesOnStartup(EagerView.class) 11 | @JsModule(DndUtil.DND_CONNECTOR) 12 | public class FakeAppConf implements AppShellConfigurator { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/main/java/com/vaadin/platform/gradle/test/views/helloview/AppShell.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.gradle.test.views.helloview; 2 | 3 | import com.vaadin.flow.component.page.AppShellConfigurator; 4 | import com.vaadin.flow.server.PWA; 5 | import com.vaadin.flow.theme.Theme; 6 | 7 | /** 8 | * Use the @PWA annotation make the application installable on phones, tablets 9 | * and some desktop browsers. 10 | */ 11 | @Theme("gradle-test") 12 | @PWA(name = "Vaadin Platform Gradle Integration Test", shortName = "Platform Gradle IT") 13 | public class AppShell implements AppShellConfigurator { 14 | } 15 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/views/hilla/@index.tsx: -------------------------------------------------------------------------------- 1 | import type {ViewConfig} from "@vaadin/hilla-file-router/types.js"; 2 | import { NavLink } from "react-router"; 3 | 4 | export const config: ViewConfig = { 5 | menu: { 6 | exclude: true, 7 | title: "ERROR!", 8 | }, 9 | }; 10 | 11 | export default function Hilla() { 12 | return ( 13 |
14 | 15 |
"Hilla root view for menu!"
16 | To hello react 17 |
18 | ); 19 | } -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/views/hilla/hello-react.tsx: -------------------------------------------------------------------------------- 1 | import { VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | 5 | export const config: ViewConfig = { 6 | menu: { 7 | title: "Hello World React", 8 | } 9 | }; 10 | 11 | export default function User() { 12 | const [name, setName] = useState(""); 13 | 14 | return ( 15 | 16 | Hello to everyone. 17 | 18 | ); 19 | } -------------------------------------------------------------------------------- /scripts/generator/templates/template-vaadin-core-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vaadin/vaadin-core", 3 | "version": "25.0.0", 4 | "description": "Vaadin components is an evolving set of free, open sourced custom HTML elements for building mobile and desktop web applications in modern browsers.", 5 | "author": "Vaadin Ltd", 6 | "license": "Apache-2.0", 7 | "main": "vaadin-core.js", 8 | "dependencies": {}, 9 | "files": [ 10 | "vaadin-core.js" 11 | ], 12 | "keywords": [ 13 | "vaadin", 14 | "core", 15 | "elements", 16 | "web", 17 | "components", 18 | "webcomponents", 19 | "web-components" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/views/hilla/@index.tsx: -------------------------------------------------------------------------------- 1 | import type {ViewConfig} from "@vaadin/hilla-file-router/types.js"; 2 | import { NavLink } from "react-router"; 3 | 4 | export const config: ViewConfig = { 5 | menu: { 6 | exclude: true, 7 | title: "ERROR!", 8 | }, 9 | }; 10 | 11 | export default function Hilla() { 12 | return ( 13 |
14 | 15 |
"Hilla root view for menu!"
16 | To hello react 17 |
18 | ); 19 | } -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/views/AccessLayout.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import jakarta.annotation.security.RolesAllowed; 4 | 5 | import com.vaadin.flow.router.Layout; 6 | import com.vaadin.flow.spring.security.AuthenticationContext; 7 | import com.vaadin.platform.react.test.security.Role; 8 | 9 | @Layout("/flow/access") 10 | @RolesAllowed({ Role.USER, Role.ADMIN }) 11 | public class AccessLayout extends FlowLayout { 12 | 13 | public AccessLayout(AuthenticationContext authenticationContext) { 14 | super(authenticationContext); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | fusion-test 7 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /vaadin-core/src/main/feature/feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | mvn:com.vaadin/flow/${com.vaadin:flow-server:jar.version}/xml/features 5 | mvn:com.vaadin/vaadin-grid-flow/${com.vaadin:vaadin-grid-flow:jar.version}/xml/features 6 | 7 | 8 |
Vaadin Core feature
9 | flow 10 | vaadin-grid-flow 11 |
12 |
13 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-vaadin-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vaadin/vaadin", 3 | "version": "25.0.0", 4 | "description": "Vaadin components is an evolving set of open sourced custom HTML elements for building mobile and desktop web applications in modern browsers.", 5 | "author": "Vaadin Ltd", 6 | "license": "(Apache-2.0 OR SEE LICENSE IN https://vaadin.com/license/cvdl-4.0)", 7 | "main": "vaadin.js", 8 | "dependencies": {}, 9 | "files": [ 10 | "vaadin.js" 11 | ], 12 | "keywords": [ 13 | "vaadin", 14 | "core", 15 | "elements", 16 | "web", 17 | "components", 18 | "webcomponents", 19 | "web-components" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/views/hilla/user.tsx: -------------------------------------------------------------------------------- 1 | import { VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | 5 | export const config: ViewConfig = { 6 | menu: { 7 | title: "Hello User", 8 | }, 9 | loginRequired: true, 10 | rolesAllowed: ['ROLE_USER'], 11 | }; 12 | 13 | export default function HelloReact() { 14 | const [name, setName] = useState(""); 15 | 16 | return ( 17 | 18 | Hello USER of the system. 19 | 20 | ); 21 | } -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/views/hilla/admin.tsx: -------------------------------------------------------------------------------- 1 | import { VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | 5 | export const config: ViewConfig = { 6 | menu: { 7 | title: "Hello Admin", 8 | }, 9 | loginRequired: true, 10 | rolesAllowed: ['ROLE_ADMIN'], 11 | }; 12 | 13 | export default function HelloReact() { 14 | const [name, setName] = useState(""); 15 | 16 | return ( 17 | 18 | Hello ADMIN of the system. 19 | 20 | ); 21 | } -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/views/UserView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import jakarta.annotation.security.RolesAllowed; 4 | 5 | import com.vaadin.flow.component.html.Span; 6 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 7 | import com.vaadin.flow.router.Menu; 8 | import com.vaadin.flow.router.Route; 9 | import com.vaadin.platform.react.test.security.Role; 10 | 11 | @Route("flow/access/user") 12 | @RolesAllowed(Role.USER) 13 | @Menu(title = "User view") 14 | public class UserView extends VerticalLayout { 15 | 16 | public UserView() { 17 | add(new Span("User only view")); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/views/AdminView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import jakarta.annotation.security.RolesAllowed; 4 | 5 | import com.vaadin.flow.component.html.Span; 6 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 7 | import com.vaadin.flow.router.Menu; 8 | import com.vaadin.flow.router.Route; 9 | import com.vaadin.platform.react.test.security.Role; 10 | 11 | @Route("flow/access/admin") 12 | @RolesAllowed(Role.ADMIN) 13 | @Menu(title = "Admin view") 14 | public class AdminView extends VerticalLayout { 15 | 16 | public AdminView() { 17 | add(new Span("Administator only view")); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/index.tsx: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copied from generated file to wrap in AuthProvider 3 | ******************************************************************************/ 4 | 5 | import { createElement } from 'react'; 6 | import { createRoot } from 'react-dom/client'; 7 | import { RouterProvider } from 'react-router'; 8 | import { router } from 'Frontend/generated/routes'; 9 | import { AuthProvider } from './auth'; 10 | 11 | function App() { 12 | return 13 | 14 | ; 15 | } 16 | 17 | createRoot(document.getElementById('outlet')!).render(createElement(App)); 18 | -------------------------------------------------------------------------------- /vaadin-platform-test/src/main/java/com/vaadin/platform/test/Log.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.test; 2 | 3 | import com.vaadin.flow.component.html.Div; 4 | import com.vaadin.flow.component.html.Span; 5 | 6 | public class Log extends Div { 7 | 8 | private int nr = 1; 9 | private Span logMsg = new Span(); 10 | 11 | public Log() { 12 | setWidth("100%"); 13 | setHeight("5em"); 14 | getElement().getStyle().set("overflow", "auto"); 15 | logMsg.setId("log"); 16 | add(logMsg); 17 | } 18 | 19 | public void log(String message) { 20 | Div row = new Div(); 21 | row.setText(nr++ + ". " + message); 22 | getElement().appendChild(row.getElement()); 23 | logMsg.setText(message); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/views/flow/hello-hilla.tsx: -------------------------------------------------------------------------------- 1 | import { VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | 5 | export const config: ViewConfig = { 6 | menu: { 7 | title: "Hello React in Flow Layout", 8 | }, 9 | title: "Hilla in Flow", 10 | loginRequired: true, 11 | rolesAllowed: [ "ROLE_USER", "ROLE_ADMIN" ] 12 | }; 13 | 14 | export default function HelloHilla() { 15 | const [name, setName] = useState(""); 16 | 17 | return ( 18 | 19 | Hilla in Flow Layout with USER/ADMIN login required! 20 | 21 | ) 22 | ; 23 | } -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/frontend/views/helloworldts/hello-world-ts-view.ts: -------------------------------------------------------------------------------- 1 | import { Notification } from '@vaadin/notification'; 2 | import '@vaadin/button'; 3 | import '@vaadin/text-field'; 4 | import { html } from 'lit'; 5 | import { customElement } from 'lit/decorators.js'; 6 | import { View } from '../view'; 7 | 8 | @customElement('hello-world-ts-view') 9 | export class HelloWorldTSView extends View { 10 | name: string = ''; 11 | 12 | render() { 13 | return html` 14 | 15 | Say hello 16 | `; 17 | } 18 | nameChanged(e: CustomEvent) { 19 | this.name = e.detail.value; 20 | } 21 | 22 | sayHello() { 23 | Notification.show('Hello ' + this.name); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/views/@index.tsx: -------------------------------------------------------------------------------- 1 | import {Button, VerticalLayout} from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import {useNavigate} from "react-router"; 4 | 5 | export const config: ViewConfig = { 6 | menu: { 7 | title: "root", 8 | }, 9 | flowLayout: false 10 | }; 11 | 12 | /** 13 | * Hilla view that is available publicly. 14 | */ 15 | export default function Public() { 16 | const navigate = useNavigate(); 17 | 18 | return ( 19 | 20 |

This is the Hilla index page.

21 | 22 | 23 |
24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/views/LayoutSecuredView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import jakarta.annotation.security.PermitAll; 4 | import jakarta.annotation.security.RolesAllowed; 5 | 6 | import com.vaadin.flow.component.html.Span; 7 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 8 | import com.vaadin.flow.router.Menu; 9 | import com.vaadin.flow.router.Route; 10 | import com.vaadin.flow.server.auth.AnonymousAllowed; 11 | import com.vaadin.platform.react.test.security.Role; 12 | 13 | @Route("flow/access/layout") 14 | @AnonymousAllowed 15 | @Menu(title = "Layout secured") 16 | public class LayoutSecuredView extends VerticalLayout { 17 | 18 | public LayoutSecuredView() { 19 | add(new Span("Only available with layout access")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /scripts/npmShrinkwrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | pushd `dirname $0` 4 | scriptDir=`pwd` 5 | vaadinShrinkwrapNpmDir="$scriptDir"/tmp.npm.vaadin-shrinkwrap 6 | mkdir "$vaadinShrinkwrapNpmDir" 7 | cp "$scriptDir"/generator/results/vaadin-shrinkwrap-package.json "$vaadinShrinkwrapNpmDir"/package.json 8 | 9 | coreShrinkwrapNpmDir="$scriptDir"/tmp.npm.vaadin-core-shrinkwrap 10 | mkdir "$coreShrinkwrapNpmDir" 11 | cp "$scriptDir"/generator/results/vaadin-core-shrinkwrap-package.json "$coreShrinkwrapNpmDir"/package.json 12 | 13 | pushd $coreShrinkwrapNpmDir 14 | npm install 15 | npm shrinkwrap 16 | cp "$coreShrinkwrapNpmDir"/npm-shrinkwrap.json "$scriptDir"/generator/results/vaadin-core-npm-shrinkwrap.json 17 | popd 18 | 19 | pushd $vaadinShrinkwrapNpmDir 20 | npm install 21 | npm shrinkwrap 22 | cp "$vaadinShrinkwrapNpmDir"/npm-shrinkwrap.json "$scriptDir"/generator/results/vaadin-npm-shrinkwrap.json 23 | popd 24 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/DeepLayout.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import com.vaadin.flow.component.applayout.AppLayout; 4 | import com.vaadin.flow.component.applayout.DrawerToggle; 5 | import com.vaadin.flow.component.html.Footer; 6 | import com.vaadin.flow.component.html.H1; 7 | import com.vaadin.flow.component.html.Header; 8 | import com.vaadin.flow.component.html.Span; 9 | import com.vaadin.flow.component.orderedlayout.Scroller; 10 | import com.vaadin.flow.component.sidenav.SideNav; 11 | import com.vaadin.flow.component.sidenav.SideNavItem; 12 | import com.vaadin.flow.router.Layout; 13 | import com.vaadin.flow.router.RoutePrefix; 14 | import com.vaadin.flow.server.menu.MenuConfiguration; 15 | import com.vaadin.flow.theme.lumo.LumoUtility; 16 | 17 | @Layout("/home/deep") 18 | public class DeepLayout extends FlowLayout { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-vaadin-gradle-plugin-portal-pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.vaadin 7 | vaadin-platform-parent 8 | {{platform}} 9 | 10 | 11 | com.vaadin 12 | com.vaadin.gradle.plugin 13 | {{platform}} 14 | pom 15 | vaadin gradle plugin portal 16 | 17 | 18 | com.vaadin 19 | vaadin-gradle-plugin 20 | {{platform}} 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/views/hilla/hello-react.tsx: -------------------------------------------------------------------------------- 1 | import { Button, TextField, VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | import { Notification } from '@vaadin/react-components/Notification.js'; 5 | 6 | export const config: ViewConfig = { 7 | menu: { 8 | title: "Hello World React", 9 | } 10 | }; 11 | 12 | export default function HelloReact() { 13 | const [name, setName] = useState(""); 14 | 15 | return ( 16 | 17 | setName(e.detail.value)} /> 18 | 22 | 23 | ); 24 | } -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/views/@index.tsx: -------------------------------------------------------------------------------- 1 | import {Button, VerticalLayout} from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import {useNavigate} from "react-router"; 4 | 5 | export const config: ViewConfig = { 6 | menu: { 7 | title: "root", 8 | }, 9 | // should be removed after hilla https://github.com/vaadin/hilla/issues/3482 10 | lazy: false, 11 | flowLayout: false 12 | }; 13 | 14 | /** 15 | * Hilla view that is available publicly. 16 | */ 17 | export default function Public() { 18 | const navigate = useNavigate(); 19 | 20 | return ( 21 | 22 |

This is the Hilla index page.

23 | 24 | 25 |
26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/views/flow/hello-hilla.tsx: -------------------------------------------------------------------------------- 1 | import { Button, TextField, VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | import { Notification } from '@vaadin/react-components/Notification.js'; 5 | 6 | export const config: ViewConfig = { 7 | menu: { 8 | title: "Hello React in Flow Layout", 9 | }, 10 | title: "Hilla in Flow" 11 | }; 12 | 13 | export default function HelloHilla() { 14 | const [name, setName] = useState(""); 15 | 16 | return ( 17 | 18 | setName(e.detail.value)} /> 19 | 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/security/UserInfo.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.security; 2 | 3 | import java.util.Collection; 4 | import java.util.Collections; 5 | 6 | import org.jspecify.annotations.NonNull; 7 | 8 | /** 9 | * User information used in client-side authentication and authorization. 10 | * To be saved in browsers’ LocalStorage for offline support. 11 | */ 12 | public final class UserInfo { 13 | 14 | @NonNull 15 | private final String name; 16 | @NonNull 17 | private final Collection<@NonNull String> authorities; 18 | 19 | public UserInfo(String name, Collection authorities) { 20 | this.name = name; 21 | this.authorities = Collections.unmodifiableCollection(authorities); 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public Collection getAuthorities() { 29 | return authorities; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /scripts/updateVersions.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sys 3 | 4 | # specify the component that need to be updated 5 | # the name should be matching with versions.json file 6 | # TODO: when there is new component, this should be added automatically 7 | originRepo=sys.argv[1] 8 | # the new version should be used 9 | # this will come from the build chain/dependency 10 | newVersion=sys.argv[2] 11 | 12 | if originRepo=="bundles" : 13 | module="bundles" 14 | originRepo="vaadin" 15 | version="jsVersion" 16 | else : 17 | module="core" 18 | version="javaVersion" 19 | 20 | with open('../versions.json','r') as data: 21 | versions = json.load(data) 22 | 23 | print("Updating " + originRepo + " verson from: ") 24 | print(versions[module][originRepo][version]) 25 | print("to: ") 26 | versions[module][originRepo][version]=newVersion 27 | print(versions[module][originRepo][version]) 28 | 29 | with open('../versions.json','w') as data: 30 | json.dump(versions,data,sort_keys=True, indent=4) 31 | data.write('\n') 32 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/views/home/deep/hello.tsx: -------------------------------------------------------------------------------- 1 | import { Button, TextField, VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | import { Notification } from '@vaadin/react-components/Notification.js'; 5 | 6 | export const config: ViewConfig = { 7 | menu: { 8 | title: "Non root React in Flow", 9 | }, 10 | title: "React in Flow Layout Deep Tree" 11 | }; 12 | 13 | export default function HelloHilla() { 14 | const [name, setName] = useState(""); 15 | 16 | return ( 17 | 18 | setName(e.detail.value)} /> 19 | 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/src/main/java/com/vaadin/platform/fusion/test/Application.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.fusion.test; 2 | 3 | import com.vaadin.flow.component.page.AppShellConfigurator; 4 | import com.vaadin.flow.server.PWA; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 9 | import com.vaadin.flow.theme.Theme; 10 | 11 | /** 12 | * The entry point of the Spring Boot application. 13 | * 14 | * Use the * and some desktop browsers. 15 | * 16 | */ 17 | @SpringBootApplication 18 | @Theme(value = "fusion-test") 19 | @PWA(name = "fusion-test", shortName = "fusion-test", offlineResources = {"images/logo.png"}) 20 | public class Application extends SpringBootServletInitializer implements AppShellConfigurator { 21 | 22 | public static void main(String[] args) { 23 | SpringApplication.run(Application.class, args); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/views/flow/no-layout.tsx: -------------------------------------------------------------------------------- 1 | import { Button, TextField, VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | import { Notification } from '@vaadin/react-components/Notification.js'; 5 | 6 | export const config: ViewConfig = { 7 | menu: { 8 | title: "Hello React NO Flow Layout", 9 | }, 10 | title: "Hilla outside Flow", 11 | flowLayout: false, 12 | }; 13 | 14 | export default function HelloHilla() { 15 | const [name, setName] = useState(""); 16 | 17 | return ( 18 | 19 | setName(e.detail.value)} /> 20 | 23 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/views/home/deepend/deep.tsx: -------------------------------------------------------------------------------- 1 | import { Button, TextField, VerticalLayout } from "@vaadin/react-components"; 2 | import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 3 | import { useState } from "react"; 4 | import { Notification } from '@vaadin/react-components/Notification.js'; 5 | 6 | export const config: ViewConfig = { 7 | menu: { 8 | title: "Not a match for layout", 9 | }, 10 | title: "React in Flow Layout Deep Tree not a match" 11 | }; 12 | 13 | export default function HelloHilla() { 14 | const [name, setName] = useState(""); 15 | 16 | return ( 17 | 18 | setName(e.detail.value)} /> 19 | 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowMainView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import com.vaadin.flow.component.button.Button; 4 | import com.vaadin.flow.component.html.Span; 5 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 6 | import com.vaadin.flow.router.Route; 7 | import com.vaadin.flow.router.RouterLink; 8 | 9 | @Route("flow") 10 | public class FlowMainView extends VerticalLayout { 11 | public FlowMainView() { 12 | Span span = new Span("Flow root view for menu!"); 13 | span.setId("flow-main"); 14 | add(span); 15 | 16 | RouterLink flow = new RouterLink("Flow with RouterLink", 17 | HelloWorldView.class); 18 | flow.setId("flow-link"); 19 | 20 | Button flowButton = new Button("Flow with Button", 21 | e -> e.getSource().getUI().get() 22 | .navigate(HelloWorldView.class)); 23 | flowButton.setId("flow-button"); 24 | 25 | add(flow, flowButton); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scripts/verifyNpmDependencies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | pushd `dirname $0` 4 | scriptDir=`pwd` 5 | vaadinCoreNpmDir="$scriptDir"/tmp.npm.vaadin-core 6 | mkdir "$vaadinCoreNpmDir" 7 | cp "$scriptDir"/generator/results/vaadin-core-package.json "$vaadinCoreNpmDir"/package.json 8 | 9 | vaadinNpmDir="$scriptDir"/tmp.npm.vaadin 10 | mkdir "$vaadinNpmDir" 11 | cp "$scriptDir"/generator/results/vaadin-package.json "$vaadinNpmDir"/package.json 12 | 13 | pushd $vaadinCoreNpmDir 14 | npm install 15 | vaadinCorePackage=`npm pack` 16 | popd 17 | 18 | pushd $vaadinNpmDir 19 | perl -pi -e "s~\"\@vaadin/vaadin-core\": .*~\"\@vaadin/vaadin-core\": \"file:$vaadinCoreNpmDir/$vaadinCorePackage\",~g" package.json 20 | cat package.json 21 | rm -rf node_modules package-lock.json 22 | npm install 23 | npm install -g find-duplicate-dependencies 24 | result=`find-duplicate-dependencies` 25 | popd 26 | 27 | rm -rf "$vaadinCoreNpmDir" "$vaadinNpmDir" 28 | 29 | if [[ ! -z "$result" ]] 30 | then 31 | echo "$result" 32 | if [[ "$TRAVIS_EVENT_TYPE" == "" ]] 33 | then 34 | exit 1 35 | fi 36 | fi 37 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/frontend/routes.ts: -------------------------------------------------------------------------------- 1 | import { Flow } from '@vaadin/flow-frontend'; 2 | 3 | const { serverSideRoutes } = new Flow({ 4 | imports: () => import('Frontend/generated/flow/generated-flow-imports.js'), 5 | }); 6 | 7 | export const routes = [ 8 | // for client-side, place routes below (more info https://vaadin.com/docs/v18/flow/typescript/creating-routes.html) 9 | { 10 | path: '', 11 | component: 'main-view', 12 | action: async () => { 13 | await import('./views/main/main-view'); 14 | }, 15 | children: [ 16 | { 17 | path: 'components', 18 | component: 'components-view', 19 | action: async () => { 20 | await import('./views/components/components-view'); 21 | }, 22 | }, 23 | { 24 | path: '(hello-ts|)', 25 | component: 'hello-world-ts-view', 26 | action: async () => { 27 | await import('./views/helloworldts/hello-world-ts-view'); 28 | }, 29 | }, 30 | // for server-side, the next magic line sends all unmatched routes: 31 | ...serverSideRoutes, // IMPORTANT: this must be the last entry in the array 32 | ], 33 | }, 34 | ]; 35 | -------------------------------------------------------------------------------- /vaadin-platform-test/src/main/java/com/vaadin/platform/test/Entity.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.test; 2 | 3 | import java.util.Arrays; 4 | import java.util.Collections; 5 | import java.util.List; 6 | import java.util.stream.Collectors; 7 | 8 | public class Entity { 9 | private String name; 10 | private List entities = Collections.emptyList(); 11 | 12 | public Entity() { 13 | } 14 | 15 | public Entity(String name) { 16 | this.name = name; 17 | } 18 | 19 | public Entity(String name, Entity... entity) { 20 | this.name = name; 21 | this.entities = Arrays.asList(entity); 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | void setName(String name) { 29 | this.name = name; 30 | } 31 | 32 | public List getEntities() { 33 | return entities; 34 | } 35 | 36 | public void setEntities(List entities) { 37 | this.entities = entities; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return name + " " + String.join(" ", entities.stream().map(Entity::getName).collect(Collectors.toList())); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/views/FlowMainView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import jakarta.annotation.security.PermitAll; 4 | 5 | import com.vaadin.flow.component.button.Button; 6 | import com.vaadin.flow.component.html.Span; 7 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 8 | import com.vaadin.flow.router.Route; 9 | import com.vaadin.flow.router.RouterLink; 10 | import com.vaadin.flow.server.auth.AnonymousAllowed; 11 | 12 | @Route("flow") 13 | @AnonymousAllowed 14 | public class FlowMainView extends VerticalLayout { 15 | public FlowMainView() { 16 | Span span = new Span("Flow root view for menu!"); 17 | span.setId("flow-main"); 18 | add(span); 19 | 20 | RouterLink flow = new RouterLink("Flow with RouterLink", 21 | PublicView.class); 22 | flow.setId("flow-link"); 23 | 24 | Button flowButton = new Button("Flow with Button", 25 | e -> e.getSource().getUI().get() 26 | .navigate(PublicView.class)); 27 | flowButton.setId("flow-button"); 28 | 29 | add(flow, flowButton); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/HelloWorldView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import com.vaadin.flow.component.button.Button; 4 | import com.vaadin.flow.component.notification.Notification; 5 | import com.vaadin.flow.component.orderedlayout.HorizontalLayout; 6 | import com.vaadin.flow.component.textfield.TextField; 7 | import com.vaadin.flow.router.Menu; 8 | import com.vaadin.flow.router.PageTitle; 9 | import com.vaadin.flow.router.Route; 10 | 11 | @Route("flow/hello-world") 12 | @PageTitle("Hello World") 13 | @Menu(title = "Flow Hello") 14 | public class HelloWorldView extends HorizontalLayout { 15 | 16 | private TextField name; 17 | private Button sayHello; 18 | 19 | public HelloWorldView() { 20 | setId("flow-hello"); 21 | setPadding(true); 22 | setSpacing(true); 23 | name = new TextField("Your name"); 24 | sayHello = new Button("Say hello"); 25 | add(name, sayHello); 26 | setVerticalComponentAlignment(Alignment.END, name, sayHello); 27 | sayHello.addClickListener(e -> { 28 | Notification.show("Hello " + name.getValue()); 29 | }); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowHillaView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import com.vaadin.flow.component.button.Button; 4 | import com.vaadin.flow.component.notification.Notification; 5 | import com.vaadin.flow.component.orderedlayout.HorizontalLayout; 6 | import com.vaadin.flow.component.textfield.TextField; 7 | import com.vaadin.flow.router.Menu; 8 | import com.vaadin.flow.router.PageTitle; 9 | import com.vaadin.flow.router.Route; 10 | 11 | @Route("hilla/flow") 12 | @PageTitle("Hello Hilla") 13 | @Menu(title = "Flow in hilla") 14 | public class FlowHillaView extends HorizontalLayout { 15 | 16 | private TextField name; 17 | private Button sayHello; 18 | 19 | public FlowHillaView() { 20 | setId("flow-hilla"); 21 | setPadding(true); 22 | setSpacing(true); 23 | name = new TextField("Your name for Flow"); 24 | sayHello = new Button("Say hello"); 25 | add(name, sayHello); 26 | setVerticalComponentAlignment(Alignment.END, name, sayHello); 27 | sayHello.addClickListener(e -> { 28 | Notification.show("Hello " + name.getValue()); 29 | }); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/views/FlowHillaView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import com.vaadin.flow.component.button.Button; 4 | import com.vaadin.flow.component.notification.Notification; 5 | import com.vaadin.flow.component.orderedlayout.HorizontalLayout; 6 | import com.vaadin.flow.component.textfield.TextField; 7 | import com.vaadin.flow.router.Menu; 8 | import com.vaadin.flow.router.PageTitle; 9 | import com.vaadin.flow.router.Route; 10 | 11 | @Route("hilla/flow") 12 | @PageTitle("Hello Hilla") 13 | @Menu(title = "Flow in hilla") 14 | public class FlowHillaView extends HorizontalLayout { 15 | 16 | private TextField name; 17 | private Button sayHello; 18 | 19 | public FlowHillaView() { 20 | setId("flow-hilla"); 21 | setPadding(true); 22 | setSpacing(true); 23 | name = new TextField("Your name for Flow"); 24 | sayHello = new Button("Say hello"); 25 | add(name, sayHello); 26 | setVerticalComponentAlignment(Alignment.END, name, sayHello); 27 | sayHello.addClickListener(e -> { 28 | Notification.show("Hello " + name.getValue()); 29 | }); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/security/UserInfoService.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.security; 2 | 3 | import java.util.List; 4 | import java.util.stream.Collectors; 5 | 6 | import jakarta.annotation.Nonnull; 7 | import jakarta.annotation.security.PermitAll; 8 | import org.springframework.security.core.Authentication; 9 | import org.springframework.security.core.GrantedAuthority; 10 | import org.springframework.security.core.context.SecurityContextHolder; 11 | 12 | import com.vaadin.hilla.BrowserCallable; 13 | 14 | /** 15 | * Server endpoint that provides information about the current user to the 16 | * Hilla's client-side authentication. 17 | */ 18 | @BrowserCallable 19 | public class UserInfoService { 20 | 21 | @PermitAll 22 | @Nonnull 23 | public UserInfo getUserInfo() { 24 | Authentication auth = SecurityContextHolder.getContext() 25 | .getAuthentication(); 26 | 27 | final List authorities = auth.getAuthorities().stream() 28 | .map(GrantedAuthority::getAuthority) 29 | .collect(Collectors.toList()); 30 | 31 | return new UserInfo(auth.getName(), authorities); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/views/PublicView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import com.vaadin.flow.component.button.Button; 4 | import com.vaadin.flow.component.notification.Notification; 5 | import com.vaadin.flow.component.orderedlayout.HorizontalLayout; 6 | import com.vaadin.flow.component.textfield.TextField; 7 | import com.vaadin.flow.router.Menu; 8 | import com.vaadin.flow.router.PageTitle; 9 | import com.vaadin.flow.router.Route; 10 | import com.vaadin.flow.server.auth.AnonymousAllowed; 11 | 12 | @Route("flow/public") 13 | @PageTitle("Public View") 14 | @Menu(title = "Flow Public") 15 | @AnonymousAllowed 16 | public class PublicView extends HorizontalLayout { 17 | 18 | private TextField name; 19 | private Button sayHello; 20 | 21 | public PublicView() { 22 | setId("flow-hello"); 23 | setPadding(true); 24 | setSpacing(true); 25 | name = new TextField("Your name"); 26 | sayHello = new Button("Say hello"); 27 | add(name, sayHello); 28 | setVerticalComponentAlignment(Alignment.END, name, sayHello); 29 | sayHello.addClickListener(e -> { 30 | Notification.show("Hello " + name.getValue()); 31 | }); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/src/main/java/com/vaadin/platform/fusion/test/views/helloworld/HelloWorldView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.fusion.test.views.helloworld; 2 | 3 | import com.vaadin.flow.component.button.Button; 4 | import com.vaadin.flow.component.dependency.CssImport; 5 | import com.vaadin.flow.component.notification.Notification; 6 | import com.vaadin.flow.component.orderedlayout.HorizontalLayout; 7 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 8 | import com.vaadin.flow.component.textfield.TextField; 9 | import com.vaadin.flow.router.PageTitle; 10 | import com.vaadin.flow.router.Route; 11 | 12 | @Route(value = "hello-world") 13 | @PageTitle("Hello World") 14 | @CssImport("./views/helloworld/hello-world-view.css") 15 | public class HelloWorldView extends HorizontalLayout { 16 | 17 | private TextField name; 18 | private Button sayHello; 19 | 20 | public HelloWorldView() { 21 | addClassName("hello-world-view"); 22 | name = new TextField("Your name"); 23 | sayHello = new Button("Say hello"); 24 | add(name, sayHello); 25 | setVerticalComponentAlignment(Alignment.END, name, sayHello); 26 | sayHello.addClickListener(e -> { 27 | Notification.show("Hello " + name.getValue()); 28 | }); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /vaadin-platform-servlet-containers-tests/bnd-tools-test/app.bndrun: -------------------------------------------------------------------------------- 1 | -runstartlevel: \ 2 | order=sortbynameversion,\ 3 | begin=-1 4 | 5 | -runvm: ${def;argLine} 6 | 7 | -runproperties: \ 8 | org.osgi.service.http.port=8080,\ 9 | org.osgi.framework.bootdelegation=sun.reflect,\ 10 | osgi.console= 11 | 12 | -runblacklist: \ 13 | bnd.identity;id='osgi.core',\ 14 | bnd.identity;id='osgi.cmpn',\ 15 | bnd.identity;id='org.apache.tomcat-embed-core' 16 | 17 | -runsystempackages: \ 18 | org.slf4j;version=1.7.25,\ 19 | org.slf4j.helpers;version=1.7.25,\ 20 | org.slf4j.spi;version=1.7.25 21 | 22 | -runpath: \ 23 | slf4j.api,\ 24 | slf4j.simple;version=1.7.25 25 | 26 | 27 | -runee: JavaSE-11 28 | 29 | -runfw: org.apache.felix.framework 30 | -runrequires: bnd.identity;id='com.vaadin.platform-test' 31 | 32 | 33 | -runrequires.flow: \ 34 | bnd.identity;version='${flow.version}';id='com.vaadin.flow.client',\ 35 | bnd.identity;version='${flow.version}';id='com.vaadin.flow.data',\ 36 | bnd.identity;version='${flow.version}';id='com.vaadin.flow.html.components',\ 37 | bnd.identity;version='${flow.version}';id='com.vaadin.flow.push',\ 38 | bnd.identity;version='${flow.version}';id='com.vaadin.flow.osgi',\ 39 | bnd.identity;version='1.1.1';id='com.vaadin.license-checker' 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | target 3 | error-screenshots/ 4 | 5 | *.iml 6 | .classpath 7 | .project 8 | .settings 9 | tmp.* 10 | vaadin-core-internal/vaadin-core-versions.json 11 | vaadin-internal/vaadin-versions.json 12 | vaadin-maven-plugin/src/main 13 | vaadin-maven-plugin/bin 14 | vaadin-maven-plugin/.factorypath 15 | hilla/hilla-versions.json 16 | hilla-react/hilla-react-versions.json 17 | vaadin-gradle-plugin/build 18 | vaadin-platform-gradle-test/build 19 | vaadin-gradle-plugin/.gradle 20 | vaadin-gradle-plugin/src/main 21 | vaadin-platform-gradle-test/.gradle 22 | vaadin-platform-sbom/frontend/ 23 | vaadin-platform-sbom/vite.config.ts 24 | vaadin-platform-sbom/vite.generated.ts 25 | .DS_Store 26 | .vscode 27 | 28 | node_modules/ 29 | package-lock.json 30 | scripts/generator/results 31 | scripts/generator/yarn-error.log 32 | **/package-lock.json 33 | **/package.json 34 | **/webpack.config.js 35 | **/frontend/generated/ 36 | **/*.generated.js 37 | **/pnpm-lock.yaml 38 | **/pnpmfile.js 39 | **/tsconfig.json 40 | **/types.d.ts 41 | **/.npmrc 42 | bin/ 43 | 44 | vaadin/pom.xml 45 | vaadin-bom/pom.xml 46 | hilla-bom/pom.xml 47 | vaadin-spring-bom/pom.xml 48 | vaadin-maven-plugin/pom.xml 49 | vaadin-gradle-plugin/pom.xml 50 | vaadin-gradle-plugin/pom*xml 51 | vaadin-platform-javadoc/pom.xml 52 | vaadin-hybrid-dev-bundle/pom.xml 53 | vaadin-dev-bundle/pom.xml 54 | vaadin-prod-bundle/pom.xml 55 | vaadin-prod-bundle/pom-unoptimized.xml 56 | vaadin-quarkus/pom.xml 57 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: "\U0001F680 Feature Request" 2 | description: Asking for a new feature/API in vaadin 3 | labels: ["feature request"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this feature request! 9 | - type: textarea 10 | id: feature-description 11 | attributes: 12 | label: Describe your motivation 13 | description: 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. 14 | placeholder: describe the current issue with existing feature/API 15 | validations: 16 | required: true 17 | - type: textarea 18 | id: expected-solution 19 | attributes: 20 | label: Describe the solution you'd like 21 | description: Provide a clear and concise description of what you want to happen. 22 | placeholder: expected solution 23 | - type: textarea 24 | id: alternatives 25 | attributes: 26 | label: Describe alternatives you've considered 27 | description: Provide information about other solutions you've tried or researched. 28 | placeholder: alternatives 29 | - type: textarea 30 | id: additional 31 | attributes: 32 | label: Additional context 33 | description: Is there anything else you can add about the proposal? 34 | placeholder: additional context 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: "\U0001F41E Bug report" 2 | description: Report an issue with Vaadin 3 | labels: ["bug"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this bug report! 9 | - type: textarea 10 | id: bug-description 11 | attributes: 12 | label: Describe the bug 13 | description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue later, please let us know here. 14 | placeholder: Bug description 15 | validations: 16 | required: true 17 | - type: textarea 18 | id: expected-behavior 19 | attributes: 20 | label: Expected-behavior 21 | description: Describe what the expected behavior you think, and we will validate on our designs. 22 | placeholder: expected behavior 23 | - type: textarea 24 | id: reproduction 25 | attributes: 26 | label: Reproduction 27 | description: Please tell us how to reproduce this issue step by step. If you have an example project to show, please provide us the link. 28 | placeholder: Reproduction 29 | validations: 30 | required: true 31 | - type: textarea 32 | id: system-info 33 | attributes: 34 | label: System Info 35 | description: Please let us know your environment when reproducing the issue. 36 | placeholder: Operating System, Vaadin version, Browsers type and version 37 | validations: 38 | required: true 39 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/Application.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test; 2 | 3 | import com.vaadin.flow.component.page.AppShellConfigurator; 4 | import com.vaadin.flow.server.PWA; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 9 | import org.springframework.context.annotation.Bean; 10 | 11 | import com.vaadin.flow.server.auth.DefaultMenuAccessControl; 12 | import com.vaadin.flow.server.auth.MenuAccessControl; 13 | import com.vaadin.flow.theme.Theme; 14 | 15 | /** 16 | * The entry point of the Spring Boot application. 17 | * 18 | * Use the * and some desktop browsers. 19 | * 20 | */ 21 | @SpringBootApplication 22 | @Theme(value = "react-test") 23 | @PWA(name = "react-test", shortName = "react-test", offlineResources = {"images/logo.png"}) 24 | public class Application extends SpringBootServletInitializer implements AppShellConfigurator { 25 | 26 | public static void main(String[] args) { 27 | SpringApplication.run(Application.class, args); 28 | } 29 | 30 | @Bean 31 | public MenuAccessControl customMenuAccessControl() { 32 | var menuAccessControl = new DefaultMenuAccessControl(); 33 | menuAccessControl.setPopulateClientSideMenu( 34 | MenuAccessControl.PopulateClientMenu.ALWAYS); 35 | return menuAccessControl; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/Application.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test; 2 | 3 | import com.vaadin.flow.component.page.AppShellConfigurator; 4 | import com.vaadin.flow.server.PWA; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 9 | import org.springframework.context.annotation.Bean; 10 | 11 | import com.vaadin.flow.server.auth.DefaultMenuAccessControl; 12 | import com.vaadin.flow.server.auth.MenuAccessControl; 13 | import com.vaadin.flow.theme.Theme; 14 | 15 | /** 16 | * The entry point of the Spring Boot application. 17 | * 18 | * Use the * and some desktop browsers. 19 | * 20 | */ 21 | @SpringBootApplication 22 | @Theme(value = "react-test") 23 | @PWA(name = "react-test", shortName = "react-test", offlineResources = {"images/logo.png"}) 24 | public class Application extends SpringBootServletInitializer implements AppShellConfigurator { 25 | 26 | public static void main(String[] args) { 27 | SpringApplication.run(Application.class, args); 28 | } 29 | 30 | @Bean 31 | public MenuAccessControl customMenuAccessControl() { 32 | var menuAccessControl = new DefaultMenuAccessControl(); 33 | menuAccessControl.setPopulateClientSideMenu( 34 | MenuAccessControl.PopulateClientMenu.ALWAYS); 35 | return menuAccessControl; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /scripts/generator/test/transformerTest.js: -------------------------------------------------------------------------------- 1 | const expect = require('chai').expect; 2 | const transformer = require('../src/transformer.js'); 3 | 4 | describe('Version transformer', function () { 5 | it('should set the given platform version', function() { 6 | const testVersions = { 7 | "foo-bar": { 8 | "javaVersion": "2.22", 9 | "jsVersion": "1.11" 10 | }, 11 | 12 | "lorem": "{{version}}" 13 | }; 14 | 15 | const result = transformer.transformVersions(testVersions, "1.2.3", false); 16 | 17 | expect(result.lorem).to.equal("1.2.3"); 18 | }); 19 | 20 | it('should transform java versions to snapshots', function() { 21 | const testVersions = { 22 | "foo-bar": { 23 | "javaVersion": "2.22", 24 | "jsVersion": "1.11" 25 | }, 26 | "bar-foo": { 27 | "javaVersion": "4.3.beta2", 28 | "jsVersion": "5.7.beta33" 29 | }, 30 | 31 | "lorem": "{{version}}" 32 | }; 33 | 34 | const result = transformer.transformVersions(testVersions, "1.2.3", true); 35 | 36 | expect(result['foo-bar'].javaVersion).to.equal("2.22-SNAPSHOT"); 37 | expect(result['foo-bar'].jsVersion).to.equal("1.11"); 38 | expect(result['bar-foo'].javaVersion).to.equal("4.3-SNAPSHOT"); 39 | expect(result['bar-foo'].jsVersion).to.equal("5.7.beta33"); 40 | 41 | expect(result.lorem).to.equal("1.2.3"); 42 | }); 43 | }); -------------------------------------------------------------------------------- /hilla-spring-boot-starter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.vaadin 7 | vaadin-platform-parent 8 | 25.0-SNAPSHOT 9 | 10 | 11 | hilla-spring-boot-starter 12 | Hilla Spring Boot Starter 13 | Spring Boot Starter for Hilla applications. 14 | 15 | 16 | 17 | 18 | com.vaadin 19 | vaadin-spring-bom 20 | pom 21 | import 22 | ${project.version} 23 | 24 | 25 | 26 | 27 | 28 | 29 | com.vaadin 30 | vaadin-spring-boot-starter 31 | provided 32 | 33 | 34 | com.vaadin 35 | hilla 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /scripts/generator/src/replacer.js: -------------------------------------------------------------------------------- 1 | /** 2 | Originally from https://github.com/lightsofapollo/json-templater 3 | 4 | Modified regex. 5 | 6 | @param {String} path dotted to indicate levels in an object. 7 | @param {Object} view for the data. 8 | */ 9 | function extractValue(path, view) { 10 | // Short circuit for direct matches. 11 | if (view && view[path]) return view[path]; 12 | 13 | var parts = path.split('.'); 14 | 15 | while ( 16 | // view should always be truthy as all objects are. 17 | view && 18 | // must have a part in the dotted path 19 | (part = parts.shift()) 20 | ) { 21 | view = (typeof view === 'object' && part in view) ? 22 | view[part] : 23 | undefined; 24 | } 25 | 26 | return view; 27 | } 28 | 29 | var REGEX = new RegExp('{{(.*?)}}', 'g'); 30 | var TEMPLATE_OPEN = '{{'; 31 | 32 | /** 33 | @param {String} input template. 34 | @param {Object} view details. 35 | */ 36 | function replace(input, view) { 37 | // optimization to avoid regex calls (indexOf is strictly faster) 38 | if (input.indexOf(TEMPLATE_OPEN) === -1) return input; 39 | var result; 40 | var replaced = input.replace(REGEX, function(original, path) { 41 | var value = extractValue(path, view); 42 | if (undefined === value || null === value) { 43 | return original; 44 | } 45 | 46 | if (typeof value === 'object') { 47 | result = value; 48 | return; 49 | } 50 | 51 | return value; 52 | }); 53 | return (undefined !== result) ? result : replaced; 54 | } 55 | 56 | module.exports = replace; 57 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-vaadin-quarkus-pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.vaadin 7 | vaadin-platform-parent 8 | {{platform}} 9 | 10 | 11 | vaadin-quarkus-extension-parent 12 | Vaadin Quarkus Extension Parent 13 | Parent POM for Vaadin Quarkus extension. 14 | pom 15 | 16 | 17 | {{javadeps}} 18 | 19 | 20 | 21 | 22 | 23 | com.vaadin 24 | vaadin-quarkus 25 | ${vaadin.quarkus.version} 26 | 27 | 28 | com.vaadin 29 | vaadin-quarkus-deployment 30 | ${vaadin.quarkus.version} 31 | 32 | 33 | 34 | 35 | 36 | vaadin-quarkus-extension 37 | vaadin-quarkus-extension-deployment 38 | 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Vaadin badge](https://img.shields.io/badge/vaadin-blue.svg?logo=vaadin)](https://vaadin.com/) 2 | [![Maven Central](https://img.shields.io/maven-metadata/v.svg?label=maven-central&metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Fvaadin%2Fvaadin-bom%2Fmaven-metadata.xml)](https://search.maven.org/search?q=g:com.vaadin%20a:vaadin-bom) 3 | [![Support badge](https://img.shields.io/badge/stackoverflow-vaadin-blue.svg?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/vaadin) 4 | [![Twitter Follow](https://img.shields.io/twitter/follow/vaadin.svg?style=social)](https://twitter.com/vaadin) 5 | [![SBOM](https://github.com/vaadin/platform/actions/workflows/sbom.yml/badge.svg?branch=main&event=push)](https://github.com/vaadin/platform/actions/workflows/sbom.yml?query=branch%3Amain) 6 | 7 | 8 | Looking for an [**overview of Vaadin**](https://github.com/vaadin)? 9 | 10 | ## About this repository 11 | 12 | This repository gathers all parts of the Vaadin platform in to a single package, ensuring all the parts work together. 13 | 14 | Learn more about our [release model](https://vaadin.com/roadmap). 15 | 16 | ## Supported versions 17 | 18 | - **25** (Java 21 support, feature releases) 19 | - **24** (Java 17 support, feature releases) 20 | - **23** (Latest Java 11 support, no feature updates, **commercial license**) 21 | - **14** (LTS, Java 8 support, no feature updates, **commercial license**) 22 | - **10** (LTS, no feature updates) 23 | 24 | For new users, the latest major version is recommended. 25 | 26 | ## Building locally 27 | To build the Vaadin platform artifacts locally, see [Building the Vaadin platform](BUILD.md). 28 | -------------------------------------------------------------------------------- /vaadin-core-internal/src/test/java/VersionsFileTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | import java.io.BufferedReader; 17 | import java.io.File; 18 | import java.io.FileReader; 19 | import java.io.IOException; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public class VersionsFileTest { 25 | 26 | @Test 27 | public void testVersionsFile_existsAsClassPathResource() 28 | throws IOException { 29 | File file = new File( 30 | getClass().getResource("vaadin-core-versions.json").getFile()); 31 | Assert.assertTrue("vaadin-core-versions.json file is missing", 32 | file.exists() && !file.isDirectory()); 33 | 34 | // checking that the file has some content in it 35 | BufferedReader bufferedReader = new BufferedReader( 36 | new FileReader(file)); 37 | bufferedReader.readLine(); 38 | String secondLine = bufferedReader.readLine(); 39 | Assert.assertEquals("Unexpected content in file", " \"core\": {", 40 | secondLine); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/acceptance-criteria.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Acceptance Criteria 3 | about: Template for Acceptance Criteria checklist 4 | title: AC 5 | labels: acceptance criteria 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | ## Description 12 | 13 | 14 | ## Use cases 15 | As a *user role (e.g. developer)* 16 | I want to *do action (e.g. be notified about closing browser)* 17 | So that I can *expected results (e.g. free resources immediately)* 18 | 19 | ## Acceptance criteria 20 | - [ ] Case-specific criterion 1 (e.g. Closing browser removes temporary resources) 21 | - [ ] Case-specific criterion 2 22 | - [ ] Case-specific criterion 3 23 | - [ ] Case-specific criterion 4 24 | 25 | ## General criteria 26 | 27 | 28 | - [ ] APIs reviewed 29 | 30 | 31 | - [ ] Design 32 | 33 | 34 | - [ ] Performance 35 | 36 | 37 | - [ ] UX/DX tests in Alpha 38 | 39 | 40 | - [ ] Documentation: 41 | 42 | 43 | - [ ] How to test? 44 | 45 | 46 | - [ ] Limitations: 47 | 48 | 49 | ## Security 50 | - [ ] Security implications have been taken into account (elaborate or link to product security requirement specification if there are implications) 51 | -------------------------------------------------------------------------------- /vaadin-core-sbom/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | com.vaadin 7 | vaadin-platform-parent 8 | 25.0-SNAPSHOT 9 | 10 | vaadin-core-sbom 11 | jar 12 | 13 | 17 14 | 17 15 | UTF-8 16 | UTF-8 17 | 18 | 19 | 20 | 21 | com.vaadin 22 | vaadin-bom 23 | ${project.version} 24 | pom 25 | import 26 | 27 | 28 | 29 | 30 | 31 | 32 | com.vaadin 33 | vaadin-core 34 | 35 | 36 | com.vaadin 37 | vaadin-spring-boot-starter 38 | 39 | 40 | com.vaadin 41 | flow-webpush 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/security/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.security; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 6 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 7 | import org.springframework.security.core.userdetails.User; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | import org.springframework.security.core.userdetails.UserDetailsService; 10 | import org.springframework.security.provisioning.InMemoryUserDetailsManager; 11 | import org.springframework.security.web.SecurityFilterChain; 12 | 13 | import static com.vaadin.flow.spring.security.VaadinSecurityConfigurer.vaadin; 14 | 15 | @EnableWebSecurity 16 | @Configuration 17 | public class SecurityConfig { 18 | 19 | @Bean 20 | public SecurityFilterChain vaadinSecurityFilterChain(HttpSecurity http) throws Exception { 21 | http.authorizeHttpRequests(registry -> { 22 | registry.requestMatchers("/", "/images/**").permitAll(); 23 | }); 24 | http.with(vaadin(), vaadin -> vaadin.loginView("/login", "/")); 25 | return http.build(); 26 | } 27 | 28 | @Bean 29 | public UserDetailsService users() { 30 | UserDetails user = User.builder() 31 | .username("user") 32 | .password("{noop}user") 33 | .roles(Role.USER) 34 | .build(); 35 | UserDetails admin = User.builder() 36 | .username("admin") 37 | .password("{noop}admin") 38 | .roles(Role.ADMIN) 39 | .build(); 40 | return new InMemoryUserDetailsManager(user, admin); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /.github/workflows/full-release-note.yml: -------------------------------------------------------------------------------- 1 | name: full-release-note 2 | on: 3 | release: 4 | types: ["published"] 5 | workflow_dispatch: 6 | inputs: 7 | version: 8 | description: 'Use set Platform Version to:' 9 | required: false 10 | type: string 11 | default: '' 12 | jobs: 13 | run: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - run: | 17 | [ -z "${{secrets.GITHUB_TOKEN}}" ] \ 18 | && echo "🚫 **GITHUB_TOKEN** is not defined, check that **${{github.repository}}** repo has a valid secret" \ 19 | | tee -a $GITHUB_STEP_SUMMARY && exit 1 || exit 0 20 | name: Check secrets 21 | - uses: actions/checkout@v4 22 | with: 23 | fetch-depth: 0 24 | - uses: actions/setup-node@v4 25 | with: 26 | node-version: '18' 27 | - uses: actions/setup-java@v4 28 | with: 29 | java-version: '17' 30 | distribution: 'temurin' 31 | - uses: stCarolas/setup-maven@v5 32 | with: 33 | maven-version: '3.8.2' 34 | - run: | 35 | ./scripts/generateBoms.sh 36 | V="${{ github.event.inputs.version || github.event.release.tag_name }}" 37 | mvn versions:set -DnewVersion=$V 38 | ./scripts/generateBoms.sh 39 | name: Set project version and generate release note 40 | env: 41 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 42 | - if: ${{ always() && (github.event.release.tag_name || github.event.inputs.version) }} 43 | uses: svenstaro/upload-release-action@v2 44 | with: 45 | repo_token: ${{ secrets.GITHUB_TOKEN }} 46 | file: ./scripts/generator/results/modules-release-notes.md 47 | asset_name: "Full.Release.Note.md" 48 | tag: ${{ github.event.inputs.version || github.event.release.tag_name }} 49 | overwrite: true 50 | -------------------------------------------------------------------------------- /scripts/generator/src/transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | @param {Object} versions data object for product versions. 3 | @param {String} platformVersion template data object to put versions to. 4 | @param {Boolean} useSnapshots transform all Java versions to snapshots 5 | */ 6 | function transformVersions(versions, platformVersion, useSnapshots) { 7 | if (!useSnapshots) { 8 | return transformPlatformVersion(versions, platformVersion); 9 | } 10 | 11 | const withPlatformVersion = transformPlatformVersion(versions, platformVersion); 12 | const withSnapshots = transformJavaSnapshots(withPlatformVersion); 13 | 14 | return withSnapshots; 15 | } 16 | 17 | function transformPlatformVersion(versions, platformVersion) { 18 | const platformVersionVisitor = (key, value, parent) => { 19 | if (value === '{{version}}') { 20 | parent[key] = platformVersion; 21 | } 22 | }; 23 | const transformedVersions = Object.assign({}, versions); 24 | visit(transformedVersions, platformVersionVisitor); 25 | return transformedVersions; 26 | } 27 | 28 | function transformJavaSnapshots(versions) { 29 | const majorMinorVersions = /(\d*?\.\d*(?:\.[a-z]+)?).*/; 30 | const snapshotVersionVisitor = (key, value, parent) => { 31 | if (key === 'javaVersion') { 32 | parent[key] = value.replace(majorMinorVersions, "$1-SNAPSHOT"); 33 | } 34 | }; 35 | const transformedVersions = Object.assign({}, versions); 36 | visit(transformedVersions, snapshotVersionVisitor); 37 | return transformedVersions; 38 | } 39 | 40 | function visit(object, visitor, parent) { 41 | for (let [key, value] of Object.entries(object)) { 42 | visitor.apply(this, [key, value, object]); 43 | if (value instanceof Object && !(value instanceof Array)) { 44 | visit(value, visitor, object); 45 | } 46 | } 47 | } 48 | 49 | exports.transformVersions = transformVersions; 50 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/views/login.tsx: -------------------------------------------------------------------------------- 1 | import { LoginOverlay } from '@vaadin/react-components'; 2 | import React, { useEffect, useState } from 'react'; 3 | import { useNavigate } from 'react-router'; 4 | import { useAuth } from 'Frontend/auth'; 5 | import { ViewConfig } from "@vaadin/hilla-file-router/types.js"; 6 | 7 | export const config: ViewConfig = { 8 | menu: { exclude: true} 9 | } 10 | 11 | interface NavigateAndReloadProps { 12 | to: string; 13 | } 14 | 15 | const NavigateAndReload : React.FC = ({ to }) => { 16 | const navigate = useNavigate(); 17 | 18 | useEffect(() => { 19 | navigate(to, { replace: true }); 20 | // reload a page on log in to update the menu items 21 | window.location.reload(); 22 | }, [navigate, to]); 23 | 24 | return null; 25 | }; 26 | 27 | /** 28 | * Login views in Hilla 29 | */ 30 | export default function Login() { 31 | const { state, login } = useAuth(); 32 | const [hasError, setError] = useState(); 33 | const [url, setUrl] = useState(); 34 | 35 | if (state.user && url) { 36 | const path = new URL(url, document.baseURI).pathname; 37 | return ; 38 | } 39 | 40 | return ( 41 | { 48 | const { defaultUrl, error, redirectUrl } = await login(username, password); 49 | 50 | if (error) { 51 | setError(true); 52 | } else { 53 | setUrl(redirectUrl ?? defaultUrl ?? '/'); 54 | } 55 | }} 56 | /> 57 | ); 58 | } 59 | -------------------------------------------------------------------------------- /vaadin-quarkus/vaadin-quarkus-extension-deployment/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.vaadin 7 | vaadin-quarkus-extension-parent 8 | 25.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | 12 | vaadin-quarkus-extension-deployment 13 | Vaadin Quarkus Extension Deployment 14 | Deployment dependency for a Quarkus project. 15 | 16 | 17 | 18 | 19 | 20 | 21 | central 22 | https://repo.maven.apache.org/maven2 23 | 24 | false 25 | 26 | 27 | 28 | vaadin-prereleases 29 | https://maven.vaadin.com/vaadin-prereleases 30 | 31 | true 32 | 33 | 34 | 35 | 36 | 37 | 38 | com.vaadin 39 | vaadin-quarkus-extension 40 | ${project.version} 41 | 42 | 43 | com.vaadin 44 | vaadin-quarkus-deployment 45 | 46 | 47 | com.vaadin 48 | vaadin-prod-bundle 49 | ${project.version} 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/frontend/views/hilla/@layout.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | AppLayout, 3 | DrawerToggle, 4 | Icon, 5 | SideNav, 6 | SideNavItem 7 | } from "@vaadin/react-components"; 8 | import { Outlet, useLocation, useNavigate } from 'react-router'; 9 | import { createMenuItems, useViewConfig } from '@vaadin/hilla-file-router/runtime.js'; 10 | import { effect, Signal, signal } from "@vaadin/hilla-react-signals"; 11 | 12 | const vaadin = window.Vaadin as { 13 | documentTitleSignal: Signal; 14 | }; 15 | vaadin.documentTitleSignal = signal(""); 16 | effect(() => { document.title = vaadin.documentTitleSignal.value; }); 17 | 18 | export default function Layout() { 19 | const navigate = useNavigate(); 20 | const location = useLocation(); 21 | vaadin.documentTitleSignal.value = useViewConfig()?.title ?? ''; 22 | 23 | 24 | return ( 25 | 26 |
27 |
28 |

Hybrid Example With Stateful Auth

29 | navigate(path!)} 31 | location={location}> 32 | { 33 | createMenuItems().filter(({to}) => { 34 | return to.startsWith("hilla") || to.startsWith("/hilla"); 35 | }).map(({ to, icon, title }) => ( 36 | 37 | {icon && } 38 | {title} 39 | 40 | )) 41 | } 42 | 43 |
44 | 45 |
46 | 47 | 48 |

49 | {vaadin.documentTitleSignal} 50 |

51 | 52 | 53 |
54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /vaadin-quarkus/vaadin-quarkus-extension/scripts/MetaDataReplacements.java: -------------------------------------------------------------------------------- 1 | import java.io.File; 2 | import java.io.IOException; 3 | import java.nio.file.Files; 4 | import java.nio.file.Path; 5 | 6 | public class MetaDataReplacements { 7 | 8 | public static void main(String[] args) { 9 | if (args.length < 3) { 10 | System.err.println("Usage: MetaDataReplacements "); 11 | System.exit(1); 12 | } 13 | 14 | Path yamlFile = new File(args[0]).toPath(); 15 | if (!Files.exists(yamlFile)) { 16 | System.err.println("Metadata YAML template file not found at: " + yamlFile); 17 | System.exit(1); 18 | } 19 | 20 | String platformVersion = args[1]; 21 | if (platformVersion.isBlank()) { 22 | System.err.println("Vaadin platform version cannot be blank"); 23 | System.exit(1); 24 | } 25 | String vaadinQuarkusVersion = args[2]; 26 | if (vaadinQuarkusVersion.isBlank()) { 27 | System.err.println("vaadin-quarkus version cannot be blank"); 28 | System.exit(1); 29 | } 30 | 31 | System.out.println("Updating Vaadin Quarkus extension metadata template at " + yamlFile); 32 | System.out.println("Platform Version: " + platformVersion); 33 | System.out.println("Vaadin Quarkus Version: " + vaadinQuarkusVersion); 34 | 35 | 36 | try { 37 | String content = Files.readString(yamlFile); 38 | 39 | content = content.replace("com.vaadin:vaadin-quarkus::jar:" + vaadinQuarkusVersion, 40 | "com.vaadin:vaadin-quarkus-extension::jar:" + platformVersion); 41 | content = content.replace("com.vaadin:vaadin-quarkus:codestarts:jar:" + vaadinQuarkusVersion, 42 | "com.vaadin:vaadin-quarkus-extension:codestarts:jar:" + platformVersion); 43 | content = content.replace("unlisted: \"true\"", "unlisted: \"false\""); 44 | 45 | Files.writeString(yamlFile, content); 46 | System.out.println("Successfully updated YAML file at: " + yamlFile); 47 | 48 | } catch (IOException e) { 49 | System.err.println("Error processing YAML file: " + e.getMessage()); 50 | e.printStackTrace(); 51 | System.exit(1); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vaadin-platform-test/src/test/java/com/vaadin/platform/test/DefaultDevBundleIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.vaadin.platform.test; 17 | 18 | import java.io.File; 19 | 20 | import org.junit.After; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | import com.vaadin.flow.server.Constants; 25 | import com.vaadin.flow.server.frontend.FrontendUtils; 26 | 27 | public class DefaultDevBundleIT extends AbstractPlatformTest { 28 | 29 | @Test 30 | public void test() throws Exception { 31 | File baseDir = new File(System.getProperty("user.dir", ".")); 32 | File devBundle = new File(baseDir, "target/" + Constants.DEV_BUNDLE_LOCATION); 33 | File nodeModules = new File(baseDir, FrontendUtils.NODE_MODULES); 34 | 35 | // shouldn't create a dev-bundle 36 | Assert.assertFalse("Error: folder '" + devBundle.getPath() + "' shouldn't exist." + devBundle.getPath(), devBundle.exists()); 37 | 38 | // shouldn't run npm install 39 | Assert.assertFalse("Error: folder '" + nodeModules.getPath() + "' shouldn't exist.", nodeModules.exists()); 40 | } 41 | 42 | @Test 43 | public void serviceWorkerIsIncludedAndServed() { 44 | getDriver().get(getRootURL() + "/sw.js"); 45 | String pageSource = getDriver().getPageSource(); 46 | Assert.assertFalse("Service Worker is not served properly", 47 | pageSource.contains("Error 404 Not Found") 48 | || pageSource.contains("Could not navigate to")); 49 | } 50 | 51 | @After 52 | public void tearDown() throws Exception { 53 | // close the browser instance when all tests are done 54 | getDriver().quit(); 55 | } 56 | 57 | @Override 58 | protected String getTestPath() { 59 | return ""; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vaadin-platform-test/src/main/java/com/vaadin/platform/test/CustomServletDeployer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.vaadin.platform.test; 17 | 18 | import jakarta.servlet.ServletContext; 19 | import jakarta.servlet.ServletContextEvent; 20 | import jakarta.servlet.ServletContextListener; 21 | import jakarta.servlet.ServletRegistration; 22 | import jakarta.servlet.annotation.WebListener; 23 | 24 | import com.vaadin.flow.server.InitParameters; 25 | import com.vaadin.flow.server.VaadinServlet; 26 | 27 | @WebListener 28 | public class CustomServletDeployer implements ServletContextListener { 29 | 30 | @Override 31 | public void contextInitialized(ServletContextEvent sce) { 32 | ServletContext servletContext = sce.getServletContext(); 33 | ServletRegistration.Dynamic devModeRegistration = servletContext 34 | .addServlet("DevMode" + VaadinServlet.class.getName(), 35 | VaadinServlet.class); 36 | 37 | devModeRegistration.setInitParameter( 38 | InitParameters.SERVLET_PARAMETER_PRODUCTION_MODE, 39 | Boolean.FALSE.toString()); 40 | devModeRegistration.setAsyncSupported(true); 41 | devModeRegistration.addMapping("/*"); 42 | 43 | ServletRegistration.Dynamic productionRegistration = servletContext 44 | .addServlet(VaadinServlet.class.getName(), VaadinServlet.class); 45 | 46 | productionRegistration.setInitParameter( 47 | InitParameters.SERVLET_PARAMETER_PRODUCTION_MODE, 48 | Boolean.TRUE.toString()); 49 | productionRegistration.setAsyncSupported(true); 50 | productionRegistration.addMapping("/prod-mode/*"); 51 | 52 | } 53 | 54 | @Override 55 | public void contextDestroyed(ServletContextEvent sce) { 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /scripts/generateBoms.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # use platform version from the root pom.xml 4 | version=`mvn -N help:evaluate -Dexpression=project.version -q -DforceStdout | grep "^[0-9]"` 5 | 6 | snapshot=$1 7 | 8 | # install npm deps needed for the generator node script 9 | [ ! -d scripts/generator/node_modules ] && (cd scripts/generator && npm install) 10 | 11 | # run the generator 12 | cmd="node scripts/generator/generate.js --platform=$version --versions=versions.json $snapshot" 13 | echo Running: "$cmd" >&2 14 | $cmd || exit 1 15 | 16 | # copy generated poms to the final place 17 | mkdir -p vaadin-bom 18 | cp scripts/generator/results/vaadin-bom.xml vaadin-bom/pom.xml 19 | mkdir -p vaadin-spring-bom 20 | cp scripts/generator/results/vaadin-spring-bom.xml vaadin-spring-bom/pom.xml 21 | mkdir -p vaadin-platform-javadoc 22 | cp scripts/generator/results/vaadin-platform-javadoc-pom.xml vaadin-platform-javadoc/pom.xml 23 | 24 | cp scripts/generator/results/vaadin-maven-plugin-pom.xml vaadin-maven-plugin/pom.xml 25 | cp scripts/generator/results/vaadin-gradle-plugin-pom.xml vaadin-gradle-plugin/pom.xml 26 | cp scripts/generator/results/vaadin-gradle-plugin-portal-pom.xml vaadin-gradle-plugin/pom-portal.xml 27 | cp scripts/generator/results/vaadin-core-versions.json vaadin-core-internal/vaadin-core-versions.json 28 | cp scripts/generator/results/vaadin-versions.json vaadin-internal/vaadin-versions.json 29 | cp scripts/generator/results/vaadin-hybrid-dev-bundle-pom.xml vaadin-hybrid-dev-bundle/pom.xml 30 | cp scripts/generator/results/vaadin-dev-bundle-pom.xml vaadin-dev-bundle/pom.xml 31 | cp scripts/generator/results/vaadin-prod-bundle-pom.xml vaadin-prod-bundle/pom.xml 32 | cp scripts/generator/results/vaadin-pom.xml vaadin/pom.xml 33 | cp scripts/generator/results/vaadin-quarkus-pom.xml vaadin-quarkus/pom.xml 34 | 35 | cat vaadin-prod-bundle/pom.xml|perl -p -e "s~vaadin-prod-bundle~vaadin-prod-bundle-unoptimized~g"|perl -p -e "s~Vaadin Prod Bundle~Vaadin Prod Bundle Unoptimized~g"|perl -p -e "s~true~false~g"|perl -p -e "s~false~true~g" > vaadin-prod-bundle/pom-unoptimized.xml 36 | perl -pi -e 's~~com.vaadinvaadin-prod-bundle-unoptimized\${project.version}truetest~' vaadin-prod-bundle/pom.xml 37 | -------------------------------------------------------------------------------- /scripts/validateVersions.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | console.log('NPM dependency tree validation'); 3 | 4 | const fs = require('fs'); 5 | const path = require('path'); 6 | 7 | const asyncExec = require('util').promisify(require('child_process').exec); 8 | async function run(cmd) { 9 | const {stdout} = await asyncExec(cmd); 10 | return stdout; 11 | } 12 | 13 | 14 | const versions = require('../versions.json'); 15 | const pkg = { 16 | "name": "no-name", 17 | "license": "UNLICENSED", 18 | "devDependencies": {}, 19 | dependencies: { 20 | "@polymer/polymer": "^3.2.0", 21 | "@webcomponents/webcomponentsjs": "^2.2.0" 22 | } 23 | } 24 | Object.entries(versions.core) 25 | .filter(e => e[1].npmName && e[1].javaVersion) 26 | .reduce((p, e) => { 27 | p[e[1].npmName] = (e[1].npmVersion || e[1].jsVersion) 28 | return p 29 | }, pkg.dependencies); 30 | Object.entries(versions.vaadin) 31 | .filter(e => e[1].npmName && e[1].javaVersion) 32 | .reduce((p, e) => { 33 | p[e[1].npmName] = (e[1].npmVersion || e[1].jsVersion); 34 | return p; 35 | }, pkg.dependencies); 36 | 37 | const curDir = process.cwd(); 38 | const tmpDir = path.resolve('target/validate-version'); 39 | fs.mkdirSync(tmpDir, { recursive: true }); 40 | process.chdir(tmpDir); 41 | 42 | fs.writeFileSync('package.json', JSON.stringify(pkg, null, 1)); 43 | if (fs.existsSync('package-lock.json')){ 44 | fs.unlinkSync('package-lock.json'); 45 | } 46 | 47 | console.log('Running npm install ...'); 48 | run('npm install') 49 | .then(() => console.log("Running npm ls ...")) 50 | .then(() => run('npm ls')) 51 | .then(out => { 52 | process.cwd(curDir); 53 | const packages = {}; 54 | const errors = []; 55 | out.split(/\n[^@\w]+/) 56 | .forEach(l => { 57 | const r = /^(.+)@(\d[^ ]+)/.exec(l); 58 | if (r) { 59 | if (packages[r[1]] && packages[r[1]] !== r[2]) { 60 | errors.push(`>> ERROR found duplicated dependency ${r[1]} ${packages[r[1]]} !== ${r[2]}`); 61 | } else { 62 | packages[r[1]] = r[2]; 63 | } 64 | } 65 | }); 66 | return errors; 67 | }).then(errors => { 68 | if (errors.length) { 69 | console.error(` 70 | !!!!!!!!!!!!! 71 | ${errors.join('\n ')} 72 | 73 | TIP: next commands might help to fix the issue: 74 | npm ls | grep "package_name" 75 | npm dist-tag add package_name@x.x.x latest 76 | !!!!!!!!!!!!!\n`); 77 | process.exit(1); 78 | } 79 | console.log("NPM dependency tree is OK"); 80 | }); 81 | -------------------------------------------------------------------------------- /vaadin-spring-boot-starter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.vaadin 7 | vaadin-platform-parent 8 | 25.0-SNAPSHOT 9 | 10 | 11 | vaadin-spring-boot-starter 12 | Spring Boot Starter 13 | Spring Boot Starter for Vaadin Flow applications. 14 | 15 | 16 | 17 | 18 | 19 | 20 | central 21 | https://repo.maven.apache.org/maven2 22 | 23 | false 24 | 25 | 26 | 27 | vaadin-prereleases 28 | https://maven.vaadin.com/vaadin-prereleases 29 | 30 | true 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | com.vaadin 39 | vaadin-spring-bom 40 | pom 41 | import 42 | ${project.version} 43 | 44 | 45 | 46 | 47 | 48 | 49 | com.vaadin 50 | vaadin-spring 51 | 52 | 53 | com.vaadin 54 | vaadin-core 55 | 56 | 57 | 58 | 59 | org.springframework.boot 60 | spring-boot-starter-webmvc 61 | ${spring.boot.version} 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /vaadin-core-jandex/src/test/java/com/vaadin/jandex/JandexSmokeTest.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.jandex; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | import org.jboss.jandex.ClassInfo; 7 | import org.jboss.jandex.DotName; 8 | import org.jboss.jandex.Index; 9 | import org.jboss.jandex.IndexReader; 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 14 | import com.vaadin.flow.server.HandlerHelper; 15 | 16 | public class JandexSmokeTest { 17 | 18 | @Test 19 | public void generatedJandex_containsContentFromFlowAndComponents() 20 | throws IOException { 21 | try (InputStream jandexStream = JandexSmokeTest.class.getClassLoader() 22 | .getResourceAsStream("META-INF/jandex.idx")) { 23 | IndexReader reader = new IndexReader(jandexStream); 24 | final Index index = reader.read(); 25 | 26 | ClassInfo classByName = index.getClassByName( 27 | DotName.createSimple(HandlerHelper.class.getName())); 28 | Assert.assertNotNull("Class from flow-server was not found", 29 | classByName); 30 | 31 | classByName = index.getClassByName( 32 | DotName.createSimple(VerticalLayout.class.getName())); 33 | Assert.assertNotNull("Class from a component was not found", 34 | classByName); 35 | } 36 | } 37 | 38 | @Test 39 | public void generatedJandex_shouldNotContainsOptionalDependencies() 40 | throws IOException { 41 | try (InputStream jandexStream = JandexSmokeTest.class.getClassLoader() 42 | .getResourceAsStream("META-INF/jandex.idx")) { 43 | IndexReader reader = new IndexReader(jandexStream); 44 | final Index index = reader.read(); 45 | 46 | ClassInfo classByName = index.getClassByName("com.vaadin.base.devserver.startup.DevModeStartupListener"); 47 | Assert.assertNull("Class from vaadin-dev-server was found", 48 | classByName); 49 | 50 | classByName = index.getClassByName("com.vaadin.flow.component.react.ReactAdapterComponent"); 51 | Assert.assertNull("Class from flow-react was found", 52 | classByName); 53 | 54 | classByName = index.getClassByName("com.vaadin.copilot.Copilot"); 55 | Assert.assertNull("Class from copilot was found", 56 | classByName); 57 | 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /vaadin-platform-servlet-containers-tests/bnd-tools-test/src/test/java/com/vaadin/platform/wait/WaitHttpIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.vaadin.platform.wait; 17 | 18 | import java.io.IOException; 19 | import java.net.MalformedURLException; 20 | import java.net.URL; 21 | 22 | import org.junit.Test; 23 | 24 | public class WaitHttpIT { 25 | 26 | public static final int SERVER_PORT = Integer 27 | .parseInt(System.getProperty("serverPort", "8080")); 28 | 29 | @Test 30 | public void waitForHttp() 31 | throws MalformedURLException, InterruptedException { 32 | // This is not really a test. 33 | // It allows to wait when HTTP container inside OSGi becomes ready. 34 | // Without this workaround IT tests starts immediately because there is 35 | // no maven server plugin which runs the server and wait when it becomes 36 | // ready and then switch to the next maven phase. 37 | // With the current configuration the server start is done async in the 38 | // separate JVM and no one waits for its readiness. 39 | // As a result IT tests starts immediately and this workaround is used 40 | // to wait when HTTP server starts to handle HTTP requests. 41 | // It's executed before any other IT test. 42 | waitRootUrl(60); 43 | } 44 | 45 | private void waitRootUrl(int count) 46 | throws MalformedURLException, InterruptedException { 47 | String viewUrl = "http://localhost:+" + SERVER_PORT + "/"; 48 | if (count == 0) { 49 | throw new IllegalStateException( 50 | "URL '" + viewUrl + "' is not avialable"); 51 | } 52 | URL url = new URL(viewUrl); 53 | try { 54 | url.openConnection().connect(); 55 | } catch (IOException exception) { 56 | Thread.sleep(1000); 57 | waitRootUrl(count - 1); 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /.github/workflows/check-published-sbom.yml: -------------------------------------------------------------------------------- 1 | name: Check Published SBOM 2 | on: 3 | schedule: 4 | - cron: '0 3 * * *' 5 | workflow_dispatch: 6 | inputs: 7 | version: 8 | description: 'Version to check' 9 | required: false 10 | type: string 11 | default: '' 12 | ga: 13 | description: 'Check GA version' 14 | required: false 15 | type: boolean 16 | default: false 17 | report: 18 | description: 'Generate report' 19 | required: false 20 | type: boolean 21 | default: true 22 | latest: 23 | description: 'Check latest version' 24 | required: false 25 | type: boolean 26 | default: true 27 | 28 | jobs: 29 | run: 30 | runs-on: ubuntu-latest 31 | steps: 32 | - uses: actions/checkout@v4 33 | with: 34 | fetch-depth: 0 35 | - uses: actions/setup-node@v4 36 | with: 37 | node-version: '22' 38 | - uses: actions/setup-go@v5 39 | with: 40 | go-version: 'stable' 41 | cache: false 42 | - run: go install github.com/google/osv-scanner/cmd/osv-scanner@v1 43 | - run: go install github.com/devops-kung-fu/bomber@latest 44 | - run: | 45 | A="--download --scan" 46 | # Set defaults for scheduled runs (when inputs are undefined) 47 | GA="${{github.event.inputs.ga}}" 48 | REPORT="${{github.event.inputs.report}}" 49 | LATEST="${{github.event.inputs.latest}}" 50 | VERSION="${{github.event.inputs.version}}" 51 | 52 | # Use defaults if inputs are empty (scheduled run) 53 | GA="${GA:-true}" 54 | REPORT="${REPORT:-true}" 55 | LATEST="${LATEST:-true}" 56 | 57 | [ "$GA" = "false" ] || A="$A --ga" 58 | [ "$REPORT" = "false" ] || A="$A --report" 59 | [ "$LATEST" = "false" ] || A="$A --latest" 60 | [ -n "$VERSION" ] && A="$A --version $VERSION" 61 | 62 | cmd="scripts/checkPublishedSBOM.js $A" 63 | echo "Running: $cmd" 64 | $cmd 65 | name: Check Published SBOM 66 | env: 67 | GITHUB_TOKEN: ${{ github.token }} 68 | - if: ${{always()}} 69 | uses: actions/upload-artifact@v4 70 | with: 71 | name: published-sbom-check-results 72 | path: | 73 | /tmp/SBOM_*.json 74 | /tmp/SBOM_*.json.bomber.scan 75 | /tmp/SBOM_*.json.osv-scanner.scan 76 | /tmp/*report*.json 77 | /tmp/*report*.html 78 | /tmp/*report*.txt 79 | if-no-files-found: ignore 80 | retention-days: 30 -------------------------------------------------------------------------------- /vaadin-jandex/src/test/java/com/vaadin/jandex/JandexSmokeTest.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.jandex; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | import org.jboss.jandex.ClassInfo; 7 | import org.jboss.jandex.DotName; 8 | import org.jboss.jandex.Index; 9 | import org.jboss.jandex.IndexReader; 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | import com.vaadin.flow.component.charts.model.ChartConfiguration; 14 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 15 | import com.vaadin.flow.server.HandlerHelper; 16 | 17 | public class JandexSmokeTest { 18 | 19 | @Test 20 | public void generatedJandex_containsContentFromFlowAndComponents() 21 | throws IOException { 22 | try (InputStream jandexStream = JandexSmokeTest.class.getClassLoader() 23 | .getResourceAsStream("META-INF/jandex.idx")) { 24 | IndexReader reader = new IndexReader(jandexStream); 25 | final Index index = reader.read(); 26 | 27 | ClassInfo classByName = index.getClassByName( 28 | DotName.createSimple(HandlerHelper.class.getName())); 29 | Assert.assertNotNull("Class from flow-server was not found", 30 | classByName); 31 | 32 | classByName = index.getClassByName( 33 | DotName.createSimple(VerticalLayout.class.getName())); 34 | Assert.assertNotNull("Class from a component was not found", 35 | classByName); 36 | 37 | classByName = index.getClassByName( 38 | DotName.createSimple(ChartConfiguration.class.getName())); 39 | Assert.assertNotNull("Class from commercial component was missing", 40 | classByName); 41 | 42 | } 43 | } 44 | 45 | @Test 46 | public void generatedJandex_shouldNotContainsOptionalDependencies() 47 | throws IOException { 48 | try (InputStream jandexStream = JandexSmokeTest.class.getClassLoader() 49 | .getResourceAsStream("META-INF/jandex.idx")) { 50 | IndexReader reader = new IndexReader(jandexStream); 51 | final Index index = reader.read(); 52 | 53 | ClassInfo classByName = index.getClassByName("com.vaadin.base.devserver.startup.DevModeStartupListener"); 54 | Assert.assertNull("Class from vaadin-dev-server was found", 55 | classByName); 56 | 57 | classByName = index.getClassByName("com.vaadin.flow.component.react.ReactAdapterComponent"); 58 | Assert.assertNull("Class from flow-react was found", 59 | classByName); 60 | 61 | classByName = index.getClassByName("com.vaadin.copilot.Copilot"); 62 | Assert.assertNull("Class from copilot was found", 63 | classByName); 64 | 65 | } 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/main/java/com/vaadin/platform/gradle/test/views/helloview/HelloVaadinerView.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.gradle.test.views.helloview; 2 | 3 | import com.vaadin.flow.component.Key; 4 | import com.vaadin.flow.component.Unit; 5 | import com.vaadin.flow.component.button.Button; 6 | import com.vaadin.flow.component.button.ButtonVariant; 7 | import com.vaadin.flow.component.charts.Chart; 8 | import com.vaadin.flow.component.charts.model.ChartType; 9 | import com.vaadin.flow.component.charts.model.ListSeries; 10 | import com.vaadin.flow.component.dependency.NpmPackage; 11 | import com.vaadin.flow.component.html.Image; 12 | import com.vaadin.flow.component.html.Span; 13 | import com.vaadin.flow.component.notification.Notification; 14 | import com.vaadin.flow.component.notification.Notification.Position; 15 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 16 | import com.vaadin.flow.component.textfield.TextField; 17 | import com.vaadin.flow.router.Route; 18 | import com.vaadin.platform.gradle.test.service.GreetService; 19 | 20 | @Route(value = "hello") 21 | @NpmPackage(value = "@fortawesome/fontawesome-free", version = "5.15.1") 22 | public class HelloVaadinerView extends VerticalLayout { 23 | 24 | public static final String TEXT_FIELD_ID = "text-field-id"; 25 | public static final String FONT_AWESOME_ID = "font-awesome"; 26 | 27 | public HelloVaadinerView() { 28 | TextField textField = new TextField("Your name"); 29 | textField.setId(TEXT_FIELD_ID); 30 | 31 | Button button = new Button("Say hello", 32 | e -> Notification.show(new GreetService().greet(textField.getValue()), 33 | 10000, Position.BOTTOM_START)); 34 | button.addThemeVariants(ButtonVariant.LUMO_PRIMARY); 35 | button.addClickShortcut(Key.ENTER); 36 | 37 | Image vaadinSvgIcon = new Image( 38 | "themes/gradle-test/fontawesome/svgs/brands/vaadin.svg", 39 | "Vaadin Svg Icon"); 40 | vaadinSvgIcon.getStyle().set("margin-top", "5px"); 41 | vaadinSvgIcon.setWidth(35, Unit.PIXELS); 42 | vaadinSvgIcon.setHeight(35, Unit.PIXELS); 43 | 44 | Span vaadinFontIcon = new Span(" <- Vaadin font-icon is here!"); 45 | vaadinFontIcon.setId(FONT_AWESOME_ID); 46 | vaadinFontIcon.addClassName("fab"); 47 | vaadinFontIcon.addClassName("fa-vaadin"); 48 | 49 | addClassName("centered-content"); 50 | 51 | Chart chart = new Chart(ChartType.LINE); 52 | chart.setId("chart"); 53 | chart.getElement().getStyle().set("height", "100px"); 54 | chart.getConfiguration().addSeries(new ListSeries(1, 3, 2, 4, 3, 5, 5, 4, 7)); 55 | chart.getElement().getStyle().set("width", "100%"); 56 | chart.getElement().getStyle().set("height", "100%"); 57 | 58 | add(textField, button, vaadinSvgIcon, vaadinFontIcon, chart); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowLayout.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import com.vaadin.flow.component.applayout.AppLayout; 4 | import com.vaadin.flow.component.applayout.DrawerToggle; 5 | import com.vaadin.flow.component.html.Footer; 6 | import com.vaadin.flow.component.html.H1; 7 | import com.vaadin.flow.component.html.Header; 8 | import com.vaadin.flow.component.html.Span; 9 | import com.vaadin.flow.component.orderedlayout.Scroller; 10 | import com.vaadin.flow.component.sidenav.SideNav; 11 | import com.vaadin.flow.component.sidenav.SideNavItem; 12 | import com.vaadin.flow.router.AfterNavigationEvent; 13 | import com.vaadin.flow.router.AfterNavigationObserver; 14 | import com.vaadin.flow.router.Layout; 15 | import com.vaadin.flow.router.RoutePrefix; 16 | import com.vaadin.flow.server.menu.MenuConfiguration; 17 | import com.vaadin.flow.theme.lumo.LumoUtility; 18 | 19 | @Layout("/flow") 20 | @RoutePrefix("flow") 21 | public class FlowLayout extends AppLayout implements AfterNavigationObserver { 22 | 23 | private H1 viewTitle; 24 | 25 | public FlowLayout() { 26 | setPrimarySection(Section.DRAWER); 27 | addDrawerContent(); 28 | addHeaderContent(); 29 | } 30 | 31 | private void addHeaderContent() { 32 | DrawerToggle toggle = new DrawerToggle(); 33 | toggle.setAriaLabel("Menu toggle"); 34 | 35 | viewTitle = new H1(); 36 | viewTitle.addClassNames(LumoUtility.FontSize.LARGE, LumoUtility.Margin.NONE); 37 | 38 | addToNavbar(true, toggle, viewTitle); 39 | } 40 | 41 | private void addDrawerContent() { 42 | Span appName = new Span("Flow menu"); 43 | appName.addClassNames(LumoUtility.FontWeight.SEMIBOLD, LumoUtility.FontSize.LARGE); 44 | Header header = new Header(appName); 45 | 46 | Scroller scroller = new Scroller(createNavigation()); 47 | 48 | addToDrawer(header, scroller, createFooter()); 49 | } 50 | 51 | private SideNav createNavigation() { 52 | SideNav nav = new SideNav(); 53 | 54 | MenuConfiguration.getMenuEntries().forEach(menuEntry -> { 55 | if(menuEntry.path().startsWith("flow") || menuEntry.path().startsWith("/flow")) { 56 | nav.addItem( 57 | new SideNavItem(menuEntry.title(), menuEntry.path())); 58 | } 59 | if(menuEntry.path().startsWith("home") || menuEntry.path().startsWith("/home")) { 60 | nav.addItem( 61 | new SideNavItem(menuEntry.title(), menuEntry.path())); 62 | } 63 | }); 64 | 65 | return nav; 66 | } 67 | 68 | private Footer createFooter() { 69 | Footer layout = new Footer(); 70 | 71 | return layout; 72 | } 73 | 74 | @Override 75 | public void afterNavigation(AfterNavigationEvent event) { 76 | viewTitle.setText(getCurrentPageTitle()); 77 | } 78 | 79 | private String getCurrentPageTitle() { 80 | return MenuConfiguration.getPageHeader(getContent()).orElse(""); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/src/test/java/com/vaadin/platform/fusion/offline/ComponentsIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.vaadin.platform.fusion.offline; 17 | 18 | import static org.junit.Assert.assertNotNull; 19 | 20 | import java.util.List; 21 | import java.util.Objects; 22 | import java.util.logging.Level; 23 | import java.util.stream.Collectors; 24 | 25 | import org.junit.Test; 26 | import org.openqa.selenium.WebElement; 27 | import org.openqa.selenium.logging.LogEntry; 28 | import org.openqa.selenium.logging.LogType; 29 | import org.slf4j.Logger; 30 | import org.slf4j.LoggerFactory; 31 | 32 | import com.vaadin.flow.component.login.testbench.LoginOverlayElement; 33 | import com.vaadin.flow.component.notification.testbench.NotificationElement; 34 | 35 | public class ComponentsIT extends ChromeDeviceTest { 36 | 37 | protected Logger getLogger() { 38 | return LoggerFactory.getLogger(this.getClass().getSimpleName()); 39 | } 40 | 41 | @Test 42 | public void loadComponents() throws Exception { 43 | getDriver().get(getRootURL() + "/components"); 44 | 45 | // There should not be component errors in console 46 | checkLogsForErrors(); 47 | // Notification opens when loaded 48 | $(NotificationElement.class).waitForFirst(); 49 | 50 | // Do something with the view 51 | WebElement view = $("components-view").first().getWrappedElement(); 52 | getCommandExecutor().executeScript("arguments[0].openLoginOverlay()", view); 53 | assertNotNull($(LoginOverlayElement.class).waitForFirst()); 54 | } 55 | 56 | private void checkLogsForErrors() { 57 | getLogEntries(Level.WARNING).forEach(logEntry -> { 58 | if ((Objects.equals(logEntry.getLevel(), Level.SEVERE) || logEntry.getMessage().contains("404"))) { 59 | throw new AssertionError(String.format( 60 | "Received error message in browser log console right after opening the page, message: %s", logEntry)); 61 | } else { 62 | getLogger().warn("This message in browser log console may be a potential error: '{}'", logEntry); 63 | } 64 | }); 65 | } 66 | 67 | private List getLogEntries(Level level) { 68 | getCommandExecutor().waitForVaadin(); 69 | return driver.manage().logs().get(LogType.BROWSER).getAll().stream() 70 | .filter(logEntry -> logEntry.getLevel().intValue() >= level.intValue()) 71 | // exclude the favicon error 72 | .filter(logEntry -> !logEntry.getMessage().contains("favicon.ico")).collect(Collectors.toList()); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /scripts/listBreakingChanges.js: -------------------------------------------------------------------------------- 1 | const https = require('https'); 2 | 3 | const currentVersions = require('../versions.json'); 4 | 5 | const majorVersionRegexp = /(\d*?)\./; 6 | 7 | const getUrl = (url) => { 8 | return new Promise((resolve, reject) => { 9 | https.get(url, (resp) => { 10 | let data = ''; 11 | 12 | resp.on('data', (chunk) => { 13 | data += chunk; 14 | }); 15 | 16 | resp.on('end', () => { 17 | resolve(data); 18 | }); 19 | }).on("error", (err) => reject(err)); 20 | }); 21 | } 22 | 23 | const versionsDiffer = (previous, current) => { 24 | const currentMajor = current.match(majorVersionRegexp)[1]; 25 | const previousMajor = previous.match(majorVersionRegexp)[1]; 26 | 27 | return parseInt(currentMajor, 10) > parseInt(previousMajor, 10); 28 | } 29 | 30 | const printChangesForProduct = (name, key, previousProduct, currentProduct) => { 31 | const currentVersion = currentProduct[key]; 32 | const previousVersion = previousProduct[key]; 33 | 34 | if(!currentVersion && !previousVersion) { 35 | return; 36 | } 37 | 38 | if(!currentVersion && previousVersion) { 39 | console.log(`${name} ${key} version was removed in the current version`); 40 | return; 41 | } 42 | 43 | if(!previousVersion && currentVersion) { 44 | console.log(`${name} ${key} version didn't exist in the previous version`); 45 | return; 46 | } 47 | 48 | if(!currentVersion.match(majorVersionRegexp) || !previousVersion.match(majorVersionRegexp)) { 49 | console.log(`${name} ${key} has non-numeric version`); 50 | return 51 | } 52 | 53 | if(versionsDiffer(previousVersion, currentVersion)) { 54 | console.log(`Breaking change! Current ${key} version of ${name} is ${currentVersion}, previous was ${previousVersion}`); 55 | } 56 | } 57 | 58 | const printChanges = async (previousVersion) => { 59 | console.log(`Searching for changes between current and version ${previousVersion}`); 60 | 61 | const previousVersions = JSON.parse(await getUrl(`https://raw.githubusercontent.com/vaadin/platform/${previousVersion}/versions.json`)); 62 | 63 | for (let [key, value] of Object.entries(currentVersions.core)) { 64 | if(!previousVersions.core[key]) { 65 | // console.log(`${key} didn't exist in the previous version`); 66 | continue; 67 | } 68 | 69 | printChangesForProduct(key, 'javaVersion', previousVersions.core[key], value); 70 | printChangesForProduct(key, 'jsVersion', previousVersions.core[key], value); 71 | } 72 | 73 | for (let [key, value] of Object.entries(currentVersions.vaadin)) { 74 | if(!previousVersions.vaadin[key]) { 75 | // console.log(`${key} didn't exist in the previous version`); 76 | continue; 77 | } 78 | 79 | printChangesForProduct(key, 'javaVersion', previousVersions.vaadin[key], value); 80 | printChangesForProduct(key, 'jsVersion', previousVersions.vaadin[key], value); 81 | } 82 | } 83 | 84 | //so, so naive 85 | const previousVersion = process.argv[2] || '10.0'; 86 | printChanges(previousVersion); -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/ComponentsIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.vaadin.platform.react.test; 17 | 18 | import static org.junit.Assert.assertNotNull; 19 | 20 | import java.util.List; 21 | import java.util.Objects; 22 | import java.util.logging.Level; 23 | import java.util.stream.Collectors; 24 | 25 | import org.junit.Test; 26 | import org.openqa.selenium.WebElement; 27 | import org.openqa.selenium.logging.LogEntry; 28 | import org.openqa.selenium.logging.LogType; 29 | import org.slf4j.Logger; 30 | import org.slf4j.LoggerFactory; 31 | 32 | import com.vaadin.flow.component.button.testbench.ButtonElement; 33 | import com.vaadin.flow.component.login.testbench.LoginOverlayElement; 34 | import com.vaadin.flow.component.notification.testbench.NotificationElement; 35 | import com.vaadin.flow.component.orderedlayout.testbench.VerticalLayoutElement; 36 | 37 | public class ComponentsIT extends AbstractPlatformTest { 38 | 39 | @Test 40 | public void loadComponents() throws Exception { 41 | // There should not be component errors in console 42 | checkLogsForErrors(); 43 | // Notification opens when loaded 44 | $(NotificationElement.class).waitForFirst(); 45 | 46 | // Do something with the view 47 | VerticalLayoutElement mainLayout = $(VerticalLayoutElement.class).id( 48 | "components"); 49 | mainLayout.$(ButtonElement.class).id("open-overlay").click(); 50 | 51 | assertNotNull($(LoginOverlayElement.class).waitForFirst()); 52 | } 53 | 54 | private void checkLogsForErrors() { 55 | getLogEntries(Level.WARNING).forEach(logEntry -> { 56 | if ((Objects.equals(logEntry.getLevel(), Level.SEVERE) || logEntry.getMessage().contains("404"))) { 57 | throw new AssertionError(String.format( 58 | "Received error message in browser log console right after opening the page, message: %s", logEntry)); 59 | } else { 60 | getLogger().warn("This message in browser log console may be a potential error: '{}'", logEntry); 61 | } 62 | }); 63 | } 64 | 65 | private List getLogEntries(Level level) { 66 | getCommandExecutor().waitForVaadin(); 67 | return driver.manage().logs().get(LogType.BROWSER).getAll().stream() 68 | .filter(logEntry -> logEntry.getLevel().intValue() >= level.intValue()) 69 | // exclude the favicon error 70 | .filter(logEntry -> !logEntry.getMessage().contains("favicon.ico")).collect(Collectors.toList()); 71 | } 72 | 73 | @Override 74 | protected String getTestPath() { 75 | return "/hilla/components"; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vaadin-gradle-plugin/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH= 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/frontend/views/hilla/@layout.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | AppLayout, Avatar, Button, 3 | DrawerToggle, 4 | Icon, 5 | SideNav, 6 | SideNavItem 7 | } from "@vaadin/react-components"; 8 | import { Outlet, useLocation, useNavigate } from 'react-router'; 9 | import { createMenuItems, useViewConfig } from '@vaadin/hilla-file-router/runtime.js'; 10 | import { effect, Signal, signal } from "@vaadin/hilla-react-signals"; 11 | import { useAuth } from "../../auth"; 12 | 13 | const vaadin = window.Vaadin as { 14 | documentTitleSignal: Signal; 15 | }; 16 | vaadin.documentTitleSignal = signal(""); 17 | effect(() => { document.title = vaadin.documentTitleSignal.value; }); 18 | 19 | export default function Layout() { 20 | const navigate = useNavigate(); 21 | const location = useLocation(); 22 | vaadin.documentTitleSignal.value = useViewConfig()?.title ?? ''; 23 | 24 | const { state, logout } = useAuth(); 25 | 26 | // @ts-ignore 27 | const userName : string = state.user?.name; 28 | 29 | async function doLogout() { 30 | await logout(); 31 | } 32 | 33 | return ( 34 | 35 |
37 |
38 |

Hybrid Example With Stateful 39 | Auth

40 | navigate(path!)} 42 | location={location}> 43 | { 44 | createMenuItems().filter(({to}) => { 45 | return to.startsWith("hilla") || to.startsWith("/hilla"); 46 | }).map(({to, icon, title}) => ( 47 | 48 | {icon && } 49 | {title} 50 | 51 | )) 52 | } 53 | 54 |
55 |
56 | {state.user ? ( 57 | <> 58 |
59 | 60 | {userName} 61 |
62 | 64 | 65 | ) : ( 66 | 67 | 68 | 69 | )} 70 |
71 | 72 |
73 | 74 | 75 |

76 | {vaadin.documentTitleSignal} 77 |

78 | 79 | 80 |
81 | ); 82 | } 83 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-release-notes-maintenance.md: -------------------------------------------------------------------------------- 1 | Vaadin {{platform}} 2 | 3 | *This is a maintenance release for Vaadin 25.0. See [24.5.0 release notes](https://github.com/vaadin/platform/releases/tag/24.5.0) for details and resources.* 4 | 5 | ## Changelogs 6 | 7 | 8 | 9 | - Flow ([{{core.flow.javaVersion}}](https://github.com/vaadin/flow/releases/tag/{{core.flow.javaVersion}})) and Hilla ([{{core.hilla.javaVersion}}](https://github.com/vaadin/hilla/releases/tag/{{core.hilla.javaVersion}})) 10 | - Design System 11 | - Web Components ([{{core.accordion.jsVersion}}](https://github.com/vaadin/web-components/releases/tag/v{{core.accordion.jsVersion}})) 12 | - Flow Components ([{{platform}}](https://github.com/vaadin/flow-components/releases/tag/{{platform}})) 13 | - TestBench ([{{vaadin.vaadin-testbench.javaVersion}}](https://github.com/vaadin/testbench/releases/tag/{{vaadin.vaadin-testbench.javaVersion}})) 14 | - Feature Pack([{{vaadin.vaadin-feature-pack.javaVersion}}](https://vaadin.com/docs/latest/tools/modernization-toolkit/feature-pack)) 15 | - Modernization Toolkit ([Documentation](https://vaadin.com/docs/latest/tools/modernization-toolkit)) 16 | - Feature Pack ([Documentation](https://vaadin.com/docs/latest/tools/modernization-toolkit/feature-pack)) 17 | - Dragonfly ([Documentation](https://vaadin.com/docs/latest/tools/modernization-toolkit/dragonfly)) 18 | - Modernization Toolkit Analyzer ([Analyzer for Eclipse](https://vaadin.com/docs/latest/tools/modernization-toolkit/analyzer-for-eclipse), [Analyzer for Maven](https://vaadin.com/docs/latest/tools/modernization-toolkit/analyzer-for-maven)) 19 | - Multiplatform Runtime (MPR) ([{{core.mpr-v8.javaVersion}}](https://github.com/vaadin/multiplatform-runtime/releases/tag/{{core.mpr-v8.javaVersion}})) 20 | - Router ([{{core.vaadin-router.jsVersion}}](https://github.com/vaadin/vaadin-router/releases/tag/v{{core.vaadin-router.jsVersion}})) 21 | - Vaadin Kits 22 | - AppSec Kit ([{{kits.appsec-kit-starter.javaVersion}}](https://vaadin.com/docs/latest/tools/appsec)) 23 | - Azure Kit ([{{kits.azure-kit.version}}](https://vaadin.com/docs/latest/tools/azure-cloud )) 24 | - Collaboration Engine ([{{kits.vaadin-collaboration-engine.javaVersion}}](https://github.com/vaadin/collaboration-kit/releases/tag/{{kits.vaadin-collaboration-engine.javaVersion}})) 25 | - Copilot ([{{kits.copilot.javaVersion}}](https://vaadin.com/docs/latest/tools/copilot)) 26 | - Kubernetes Kit ([{{kits.kubernetes-kit-starter.javaVersion}}](https://github.com/vaadin/kubernetes-kit/releases/tag/{{kits.kubernetes-kit-starter.javaVersion}})) 27 | - Observability Kit ([{{kits.observability-kit-starter.javaVersion}}](https://github.com/vaadin/observability-kit/releases/tag/{{kits.observability-kit-starter.javaVersion}})) 28 | - SSO Kit ([{{kits.sso-kit-starter.javaVersion}}](https://github.com/vaadin/sso-kit/releases/tag/{{kits.sso-kit-starter.javaVersion}})) 29 | - Swing Kit ([{{kits.swing-kit.javaVersion}}](https://vaadin.com/docs/latest/tools/swing)) 30 | 31 | **Official add-ons and plugins:** 32 | 33 | - Spring add-on ({{core.flow.javaVersion}}) 34 | - CDI add-on ([{{core.flow-cdi.javaVersion}}](https://github.com/vaadin/cdi/releases/tag/{{core.flow-cdi.javaVersion}})) 35 | - Maven plugin ({{platform}}) 36 | - Gradle plugin ({{platform}}) 37 | - Quarkus plugin ([{{core.vaadin-quarkus.javaVersion}}](https://github.com/vaadin/quarkus/releases/tag/{{core.vaadin-quarkus.javaVersion}})) 38 | -------------------------------------------------------------------------------- /vaadin-platform-test/src/test/java/com/vaadin/platform/test/AbstractPlatformTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.vaadin.platform.test; 17 | 18 | import java.io.File; 19 | 20 | import org.junit.Before; 21 | import org.junit.BeforeClass; 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | 25 | import com.vaadin.testbench.IPAddress; 26 | import com.vaadin.testbench.parallel.ParallelTest; 27 | import com.vaadin.testbench.parallel.SauceLabsIntegration; 28 | 29 | public abstract class AbstractPlatformTest extends ParallelTest { 30 | 31 | public static final int SERVER_PORT = Integer 32 | .parseInt(System.getProperty("serverPort", "8080")); 33 | 34 | static String hostName; 35 | static boolean isSauce; 36 | static boolean isHub; 37 | static boolean isLocal; 38 | 39 | static Logger getLogger() { 40 | return LoggerFactory.getLogger(AbstractPlatformTest.class); 41 | } 42 | 43 | @BeforeClass 44 | public static void setupClass() { 45 | isSauce = SauceLabsIntegration.isConfiguredForSauceLabs(); 46 | String hubHost = System 47 | .getProperty("com.vaadin.testbench.Parameters.hubHostname"); 48 | isHub = !isSauce && hubHost != null && !hubHost.isEmpty(); 49 | 50 | hostName = isHub ? IPAddress.findSiteLocalAddress() : "localhost"; 51 | getLogger().info("Running Tests app-url=http://{}:{} mode={}", hostName, 52 | SERVER_PORT, 53 | isSauce ? "SAUCE (user:" + SauceLabsIntegration.getSauceUser() + ")" 54 | : isHub ? "HUB (hub-host:" + hubHost + ")" 55 | : "LOCAL (chromedriver)"); 56 | } 57 | 58 | @Before 59 | public void setUp() { 60 | getDriver().get(getRootURL() + getTestPath()); 61 | } 62 | 63 | /** 64 | * Gets the absolute path to the test, starting with a "/". 65 | * 66 | * @return he path to the test, appended to {@link #getRootURL()} for the 67 | * full test URL. 68 | */ 69 | protected abstract String getTestPath(); 70 | 71 | /** 72 | * Returns the URL to the root of the server, e.g. "http://localhost:8888". 73 | * 74 | * @return the URL to the root 75 | */ 76 | protected String getRootURL() { 77 | return "http://" + getDeploymentHostname() + ":" + getDeploymentPort(); 78 | } 79 | 80 | /** 81 | * Used to determine what port the test is running on. 82 | * 83 | * @return The port the test is running on, by default 8080 84 | */ 85 | protected int getDeploymentPort() { 86 | return SERVER_PORT; 87 | } 88 | 89 | /** 90 | * Used to determine what URL to initially open for the test. 91 | * 92 | * @return the host name of development server 93 | */ 94 | protected String getDeploymentHostname() { 95 | return hostName; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/src/test/java/com/vaadin/platform/gradle/test/AbstractPlatformTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.vaadin.platform.gradle.test; 17 | 18 | import java.io.File; 19 | 20 | import org.junit.Before; 21 | import org.junit.BeforeClass; 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | 25 | import com.vaadin.testbench.IPAddress; 26 | import com.vaadin.testbench.parallel.ParallelTest; 27 | import com.vaadin.testbench.parallel.SauceLabsIntegration; 28 | 29 | public abstract class AbstractPlatformTest extends ParallelTest { 30 | 31 | public static final int SERVER_PORT = Integer 32 | .parseInt(System.getProperty("serverPort", "8080")); 33 | 34 | static String hostName; 35 | static boolean isSauce; 36 | static boolean isHub; 37 | static boolean isLocal; 38 | 39 | static Logger getLogger() { 40 | return LoggerFactory.getLogger(AbstractPlatformTest.class); 41 | } 42 | 43 | @BeforeClass 44 | public static void setupClass() { 45 | isSauce = SauceLabsIntegration.isConfiguredForSauceLabs(); 46 | String hubHost = System 47 | .getProperty("com.vaadin.testbench.Parameters.hubHostname"); 48 | isHub = !isSauce && hubHost != null && !hubHost.isEmpty(); 49 | 50 | hostName = isHub ? IPAddress.findSiteLocalAddress() : "localhost"; 51 | getLogger().info("Running Tests app-url=http://{}:{} mode={}", hostName, 52 | SERVER_PORT, 53 | isSauce ? "SAUCE (user:" + SauceLabsIntegration.getSauceUser() + ")" 54 | : isHub ? "HUB (hub-host:" + hubHost + ")" 55 | : "LOCAL (chromedriver)"); 56 | } 57 | 58 | @Before 59 | public void setUp() { 60 | getDriver().get(getRootURL() + getTestPath()); 61 | } 62 | 63 | /** 64 | * Gets the absolute path to the test, starting with a "/". 65 | * 66 | * @return he path to the test, appended to {@link #getRootURL()} for the 67 | * full test URL. 68 | */ 69 | protected abstract String getTestPath(); 70 | 71 | /** 72 | * Returns the URL to the root of the server, e.g. "http://localhost:8888". 73 | * 74 | * @return the URL to the root 75 | */ 76 | protected String getRootURL() { 77 | return "http://" + getDeploymentHostname() + ":" + getDeploymentPort(); 78 | } 79 | 80 | /** 81 | * Used to determine what port the test is running on. 82 | * 83 | * @return The port the test is running on, by default 8080 84 | */ 85 | protected int getDeploymentPort() { 86 | return SERVER_PORT; 87 | } 88 | 89 | /** 90 | * Used to determine what URL to initially open for the test. 91 | * 92 | * @return the host name of development server 93 | */ 94 | protected String getDeploymentHostname() { 95 | return hostName; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /vaadin-platform-hybrid-test/src/test/java/com/vaadin/platform/fusion/offline/ChromeOfflineIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2023 Vaadin Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.vaadin.platform.fusion.offline; 17 | 18 | import java.io.IOException; 19 | 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | import org.openqa.selenium.By; 23 | import org.openqa.selenium.JavascriptExecutor; 24 | import org.openqa.selenium.logging.LogType; 25 | import org.openqa.selenium.mobile.NetworkConnection; 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | 29 | public class ChromeOfflineIT extends ChromeDeviceTest { 30 | 31 | protected Logger getLogger() { 32 | return LoggerFactory.getLogger(this.getClass().getSimpleName()); 33 | } 34 | 35 | @Test 36 | public void offlineRoot_reload_viewReloaded() throws IOException { 37 | getDriver().get(getRootURL() + "/"); 38 | waitForDevServer(); 39 | 40 | // Confirm that app shell is loaded 41 | Assert.assertNotNull("Should have outlet when loaded online", 42 | findElement(By.id("outlet"))); 43 | 44 | // Confirm that client side view is loaded 45 | Assert.assertNotNull("Should have in DOM when loaded online", 46 | findElement(By.tagName("hello-world-ts-view"))); 47 | 48 | // Print in logger the browser console log 49 | driver.manage().logs().get(LogType.BROWSER).getAll().stream() 50 | .forEach(c -> getLogger().warn("Console - {} {}", c.getLevel(), c.getMessage())); 51 | 52 | waitForServiceWorkerReady(); 53 | 54 | // Set offline network conditions in ChromeDriver 55 | setConnectionType(NetworkConnection.ConnectionType.AIRPLANE_MODE); 56 | 57 | try { 58 | Assert.assertEquals("navigator.onLine should be false", false, 59 | executeScript("return navigator.onLine")); 60 | 61 | // Reload the page in offline mode 62 | executeScript("window.location.reload();"); 63 | waitUntil(webDriver -> ((JavascriptExecutor) driver) 64 | .executeScript("return document.readyState") 65 | .equals("complete")); 66 | 67 | // Confirm that app shell is loaded 68 | Assert.assertNotNull("Should have outlet when loaded offline", 69 | findElement(By.id("outlet"))); 70 | 71 | // Confirm that client side view is loaded 72 | Assert.assertNotNull("Should have in DOM when loaded offline", 73 | findElement(By.tagName("hello-world-ts-view"))); 74 | 75 | // Confirm that connection lost indicator is visible 76 | Assert.assertNotNull("Should have outlet when loaded offline", 77 | findElement(By.tagName("vaadin-connection-indicator")).getAttribute("offline")); 78 | } finally { 79 | // Reset network conditions back 80 | setConnectionType(NetworkConnection.ConnectionType.ALL); 81 | } 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /vaadin-platform-gradle-test/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | mavenLocal() 5 | maven { setUrl("https://maven.vaadin.com/vaadin-prereleases") } 6 | } 7 | dependencies { 8 | classpath group: 'com.vaadin', 9 | name: 'vaadin-gradle-plugin', 10 | version: "$pluginVersion" 11 | } 12 | } 13 | 14 | plugins { 15 | id 'war' 16 | id 'org.gretty' version '4.1.10' 17 | id 'com.vaadin.plugin.sauce.SauceConnectPlugin' version '0.0.15' 18 | } 19 | 20 | apply plugin: 'com.vaadin' 21 | apply plugin: 'com.vaadin.plugin.sauce.SauceConnectPlugin' 22 | 23 | repositories { 24 | mavenCentral() 25 | mavenLocal() 26 | maven { setUrl('https://maven.vaadin.com/vaadin-prereleases') } 27 | } 28 | 29 | dependencies { 30 | // Vaadin 31 | implementation enforcedPlatform("com.vaadin:vaadin-bom:$vaadinVersion") 32 | implementation 'com.vaadin:vaadin' 33 | 34 | testImplementation 'com.vaadin:vaadin-testbench' 35 | testImplementation 'junit:junit:4.13' 36 | 37 | providedCompile 'jakarta.servlet:jakarta.servlet-api:6.1.0' 38 | 39 | // logging through the SLF4J API to SLF4J-Simple. See src/main/resources/simplelogger.properties for logger configuration 40 | implementation 'org.slf4j:slf4j-simple:2.0.3' 41 | } 42 | 43 | defaultTasks('clean', 'build') 44 | 45 | test { 46 | filter { 47 | excludeTestsMatching '*IT' 48 | setFailOnNoMatchingTests(false) 49 | } 50 | } 51 | 52 | gretty { 53 | contextPath = '/' 54 | httpPort = 8080 55 | servletContainer = 'jetty11' 56 | integrationTestTask = 'integrationTest' 57 | } 58 | 59 | def sauceUser = System.getProperty('sauce.user') 60 | def sauceKey = System.getProperty('sauce.sauceAccessKey') 61 | def sauceIdentifier = '--tunnel-identifier ' + System.currentTimeMillis() 62 | sauceconnect { 63 | username = sauceUser 64 | key = sauceKey 65 | options = '-P 4445 ' + sauceIdentifier; 66 | } 67 | 68 | task integrationTest(type: Test) { 69 | description = 'Runs Integration Tests.' 70 | group = 'verification' 71 | 72 | if (sauceUser != null) { 73 | integrationTest.dependsOn startSauceConnect 74 | integrationTest.finalizedBy stopSauceConnect 75 | 76 | systemProperties 'testDriver' : 'sauce' 77 | systemProperties 'sauce.user' : sauceUser 78 | systemProperties 'sauce.sauceAccessKey' : sauceKey 79 | systemProperties 'sauce.options' : sauceIdentifier 80 | } 81 | 82 | systemProperties 'com.vaadin.testbench.Parameters.testsInParallel' : System.getProperty('com.vaadin.testbench.Parameters.testsInParallel') 83 | systemProperties 'test.use.hub' : System.getProperty('test.use.hub') 84 | if (System.getProperty('vaadin.testbench.developer.license') != null) { 85 | systemProperties 'vaadin.testbench.developer.license' : System.getProperty('vaadin.testbench.developer.license') 86 | } 87 | if (System.getProperty('com.vaadin.testbench.Parameters.hubHostname') != null) { 88 | systemProperties 'com.vaadin.testbench.Parameters.hubHostname' : System.getProperty('com.vaadin.testbench.Parameters.hubHostname') 89 | } 90 | 91 | useJUnit() 92 | 93 | maxHeapSize = '1G' 94 | filter { 95 | includeTestsMatching('*IT*') 96 | } 97 | 98 | mustRunAfter test 99 | 100 | testLogging { 101 | showStandardStreams = true 102 | } 103 | } 104 | 105 | wrapper { 106 | gradleVersion = '8.14' 107 | distributionType = Wrapper.DistributionType.ALL 108 | } 109 | 110 | check.dependsOn integrationTest 111 | -------------------------------------------------------------------------------- /vaadin-internal/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | com.vaadin 9 | vaadin-platform-parent 10 | 25.0-SNAPSHOT 11 | 12 | 13 | com.vaadin 14 | vaadin-internal 15 | Vaadin Platform (vaadin-internal) 16 | 17 | 18 | 19 | 20 | com.vaadin 21 | vaadin-bom 22 | ${project.version} 23 | pom 24 | import 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | com.vaadin 33 | vaadin-core-internal 34 | ${project.version} 35 | 36 | 37 | 39 | 40 | 41 | com.vaadin 42 | vaadin-board-flow 43 | 44 | 45 | 46 | com.vaadin 47 | vaadin-charts-flow 48 | 49 | 50 | 51 | com.vaadin 52 | vaadin-crud-flow 53 | 54 | 55 | 56 | com.vaadin 57 | vaadin-dashboard-flow 58 | 59 | 60 | 61 | com.vaadin 62 | vaadin-grid-pro-flow 63 | 64 | 65 | 66 | com.vaadin 67 | vaadin-map-flow 68 | 69 | 70 | 71 | com.vaadin 72 | vaadin-rich-text-editor-flow 73 | 74 | 75 | 76 | 77 | 78 | 79 | 81 | com.coderplus.maven.plugins 82 | copy-rename-maven-plugin 83 | 1.0 84 | 85 | 86 | copy-and-rename-file 87 | process-resources 88 | 89 | copy 90 | 91 | 92 | ./vaadin-versions.json 93 | ${basedir}/target/classes/vaadin-versions.json 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /vaadin-hybrid-dev-bundle/src/test/java/com/vaadin/devbundle/HybridBundleTest.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.devbundle; 2 | 3 | import java.io.IOException; 4 | import java.nio.charset.StandardCharsets; 5 | import java.nio.file.FileVisitResult; 6 | import java.nio.file.FileVisitor; 7 | import java.nio.file.Files; 8 | import java.nio.file.Path; 9 | import java.nio.file.Paths; 10 | import java.nio.file.attribute.BasicFileAttributes; 11 | import java.util.List; 12 | import java.util.concurrent.atomic.AtomicInteger; 13 | import java.util.function.Function; 14 | 15 | import org.junit.jupiter.api.Assertions; 16 | import org.junit.jupiter.api.Test; 17 | 18 | public class HybridBundleTest { 19 | 20 | @Test 21 | public void usageStatsIncluded() throws IOException { 22 | String needle = "StatisticsGatherer"; 23 | int foundInFiles = findInBundleBuildFolder(needle); 24 | Assertions.assertEquals(1, foundInFiles, 25 | "The key '" + needle + "' should be found in one file"); 26 | 27 | } 28 | 29 | @Test 30 | public void copilotIncluded() throws IOException { 31 | String needle = "copilot-main"; 32 | int foundInFiles = findInBundleBuildFolder(line -> line.contains(needle) 33 | && !line.contains("document.querySelector")&& !line.contains("copilot-main-resized")); 34 | Assertions.assertEquals(1, foundInFiles, 35 | "The key '" + needle + "' should be found in one file"); 36 | } 37 | @Test 38 | public void hillaIncluded() throws IOException { 39 | String needle = "@vaadin/hilla-frontend"; 40 | int foundInFiles = findInBundleBuildFolder(needle); 41 | Assertions.assertEquals(1, foundInFiles, 42 | "The key '" + needle + "' should be found in one file"); 43 | } 44 | 45 | private int findInBundleBuildFolder(String needle) throws IOException { 46 | return findInBundleBuildFolder(line -> line.contains(needle)); 47 | } 48 | 49 | private int findInBundleBuildFolder(Function matcher) 50 | throws IOException { 51 | Path bundlerBuildFolder = Paths.get("target", "dev-bundle", "webapp", 52 | "VAADIN", "build"); 53 | return findInFiles(bundlerBuildFolder, matcher); 54 | } 55 | 56 | private int findInFiles(Path path, Function matcher) 57 | throws IOException { 58 | AtomicInteger foundInFiles = new AtomicInteger(); 59 | Files.walkFileTree(path, new FileVisitor() { 60 | 61 | @Override 62 | public FileVisitResult preVisitDirectory(Path dir, 63 | BasicFileAttributes attrs) throws IOException { 64 | return FileVisitResult.CONTINUE; 65 | } 66 | 67 | @Override 68 | public FileVisitResult visitFile(Path file, 69 | BasicFileAttributes attrs) throws IOException { 70 | List lines = Files.readAllLines(file, 71 | StandardCharsets.UTF_8); 72 | for (String line : lines) { 73 | if (matcher.apply(line)) { 74 | foundInFiles.incrementAndGet(); 75 | break; 76 | } 77 | } 78 | return FileVisitResult.CONTINUE; 79 | } 80 | 81 | @Override 82 | public FileVisitResult visitFileFailed(Path file, IOException exc) 83 | throws IOException { 84 | return FileVisitResult.CONTINUE; 85 | } 86 | 87 | @Override 88 | public FileVisitResult postVisitDirectory(Path dir, IOException exc) 89 | throws IOException { 90 | return FileVisitResult.CONTINUE; 91 | } 92 | 93 | }); 94 | return foundInFiles.get(); 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/HillaMainLayoutIT.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Before; 6 | import org.junit.Test; 7 | import org.openqa.selenium.By; 8 | import org.openqa.selenium.support.ui.ExpectedConditions; 9 | 10 | import com.vaadin.flow.component.button.testbench.ButtonElement; 11 | import com.vaadin.flow.component.orderedlayout.testbench.VerticalLayoutElement; 12 | 13 | public class HillaMainLayoutIT extends AbstractPlatformTest { 14 | 15 | @Test 16 | public void flowViewInHillaLayout() { 17 | waitForElement("Page is not ready when this check performs", 18 | By.id("hilla")); 19 | 20 | // Navigate to Flow view 21 | getMenuElement("Flow in hilla").get().click(); 22 | 23 | waitUntil(ExpectedConditions.presenceOfElementLocated( 24 | By.id("flow-hilla"))); 25 | 26 | // navigate away from Flow view 27 | getMenuElement("React Components").get().click(); 28 | 29 | waitUntil(driver -> 30 | $(ButtonElement.class).id("open-overlay").isDisplayed()); 31 | } 32 | 33 | @Test 34 | public void navigateUsingNavLink() { 35 | waitForElement("Page is not ready when this check performs", 36 | By.id("toHello")); 37 | findElement(By.id("toHello")).click(); 38 | 39 | waitForElement("Navigation with NavLink failed.", 40 | By.id("HelloReact")); 41 | } 42 | 43 | @Test 44 | public void backNavigationTest() { 45 | waitForElement("Page is not ready when this check performs", 46 | By.id("toHello")); 47 | findElement(By.id("toHello")).click(); 48 | 49 | Assert.assertTrue("Navigation with NavLink failed.", 50 | $(VerticalLayoutElement.class).id("HelloReact").isDisplayed()); 51 | 52 | getDriver().navigate().back(); 53 | 54 | Assert.assertTrue( 55 | "Should have returned to initial page from Hilla view", 56 | findElement(By.id("toHello")).isDisplayed()); 57 | 58 | // Navigate to Flow view 59 | getMenuElement("Flow in hilla").get().click(); 60 | 61 | waitForElement("Expected flow view", By.id("flow-hilla")); 62 | 63 | getDriver().navigate().back(); 64 | 65 | Assert.assertTrue("Should have returned to initial page from Flow view", 66 | findElement(By.id("toHello")).isDisplayed()); 67 | } 68 | 69 | 70 | @Test 71 | public void forwardNavigationTest() { 72 | waitForElement("Page is not ready when this check performs", 73 | By.id("toHello")); 74 | findElement(By.id("toHello")).click(); 75 | 76 | waitForElement("Navigation with NavLink failed.", 77 | By.id("HelloReact")); 78 | 79 | // Navigate to Flow view 80 | getMenuElement("Flow in hilla").get().click(); 81 | 82 | waitForElement("Expected flow view", By.id("flow-hilla")); 83 | 84 | getDriver().navigate().back(); 85 | waitForElement("Expected hilla view after forward", 86 | By.id("HelloReact")); 87 | 88 | getDriver().navigate().back(); 89 | 90 | waitForElement("Should have returned to initial page", 91 | By.id("toHello")); 92 | 93 | getDriver().navigate().forward(); 94 | 95 | waitForElement("Expected hilla view after forward", 96 | By.id("HelloReact")); 97 | 98 | getDriver().navigate().forward(); 99 | 100 | waitForElement("Expected flow view after second forward", 101 | By.id("flow-hilla")); 102 | } 103 | 104 | @Override 105 | protected String getTestPath() { 106 | return "/hilla"; 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /vaadin-dev-bundle/src/test/java/com/vaadin/devbundle/BundleTest.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.devbundle; 2 | 3 | import java.io.IOException; 4 | import java.nio.charset.StandardCharsets; 5 | import java.nio.file.FileVisitResult; 6 | import java.nio.file.FileVisitor; 7 | import java.nio.file.Files; 8 | import java.nio.file.Path; 9 | import java.nio.file.Paths; 10 | import java.nio.file.attribute.BasicFileAttributes; 11 | import java.util.List; 12 | import java.util.concurrent.atomic.AtomicInteger; 13 | import java.util.function.Function; 14 | 15 | import org.junit.jupiter.api.Assertions; 16 | import org.junit.jupiter.api.Test; 17 | 18 | public class BundleTest { 19 | 20 | @Test 21 | public void usageStatsIncluded() throws IOException { 22 | String needle = "StatisticsGatherer"; 23 | int foundInFiles = findInBundleBuildFolder(needle); 24 | Assertions.assertEquals(1, foundInFiles, 25 | "The key '" + needle + "' should be found in one file"); 26 | } 27 | 28 | @Test 29 | public void copilotIncluded() throws IOException { 30 | String needle = "copilot-main"; 31 | int foundInFiles = findInBundleBuildFolder(line -> line.contains(needle) 32 | && !line.contains("document.querySelector")&& !line.contains("copilot-main-resized")); 33 | Assertions.assertEquals(1, foundInFiles, 34 | "The key '" + needle + "' should be found in one file"); 35 | } 36 | 37 | @Test 38 | public void hillaPackageLockIncluded() throws IOException { 39 | Path bundlerBuildFolder = Paths.get("target", "dev-bundle", 40 | "hybrid-package-lock.json"); 41 | Assertions.assertTrue(bundlerBuildFolder.toFile().exists(), 42 | "Expecting hybrid-package-lock.json to be present in dev-bundle, but was not"); 43 | } 44 | 45 | private int findInBundleBuildFolder(String needle) throws IOException { 46 | return findInBundleBuildFolder(line -> line.contains(needle)); 47 | } 48 | 49 | private int findInBundleBuildFolder(Function matcher) 50 | throws IOException { 51 | Path bundlerBuildFolder = Paths.get("target", "dev-bundle", "webapp", 52 | "VAADIN", "build"); 53 | return findInFiles(bundlerBuildFolder, matcher); 54 | } 55 | 56 | private int findInFiles(Path path, Function matcher) 57 | throws IOException { 58 | AtomicInteger foundInFiles = new AtomicInteger(); 59 | Files.walkFileTree(path, new FileVisitor() { 60 | 61 | @Override 62 | public FileVisitResult preVisitDirectory(Path dir, 63 | BasicFileAttributes attrs) throws IOException { 64 | return FileVisitResult.CONTINUE; 65 | } 66 | 67 | @Override 68 | public FileVisitResult visitFile(Path file, 69 | BasicFileAttributes attrs) throws IOException { 70 | List lines = Files.readAllLines(file, 71 | StandardCharsets.UTF_8); 72 | for (String line : lines) { 73 | if (matcher.apply(line)) { 74 | foundInFiles.incrementAndGet(); 75 | break; 76 | } 77 | } 78 | return FileVisitResult.CONTINUE; 79 | } 80 | 81 | @Override 82 | public FileVisitResult visitFileFailed(Path file, IOException exc) 83 | throws IOException { 84 | return FileVisitResult.CONTINUE; 85 | } 86 | 87 | @Override 88 | public FileVisitResult postVisitDirectory(Path dir, IOException exc) 89 | throws IOException { 90 | return FileVisitResult.CONTINUE; 91 | } 92 | 93 | }); 94 | return foundInFiles.get(); 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-servlet-containers-tests-pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | com.vaadin 7 | vaadin-platform-parent 8 | {{platform}} 9 | 10 | vaadin-platform-servlet-containers-tests 11 | pom 12 | Vaadin Platform Servlet Containers Tests 13 | Vaadin Platform Servlet Containers Tests 14 | https://vaadin.com 15 | 16 | 17 17 | 17 18 | UTF-8 19 | UTF-8 20 | false 21 | true 22 | 23 | {{javadeps}} 24 | 25 | 26 | 27 | 28 | 29 | com.vaadin 30 | vaadin-bom 31 | ${project.version} 32 | pom 33 | import 34 | 35 | 36 | 37 | 38 | 39 | 40 | Vaadin Directory 41 | https://maven.vaadin.com/vaadin-addons 42 | 43 | 44 | 45 | 46 | 47 | com.vaadin 48 | flow-server 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.apache.maven.plugins 56 | maven-deploy-plugin 57 | 2.8.2 58 | 59 | true 60 | 61 | 62 | 63 | org.sonatype.plugins 64 | nexus-staging-maven-plugin 65 | 1.6.8 66 | 67 | true 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | run-tests 76 | 77 | 78 | !skipTests 79 | 80 | 81 | 82 | 84 | bnd-tools-test 85 | 86 | 87 | 88 | io.github.bonigarcia 89 | webdrivermanager 90 | LATEST 91 | test 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /vaadin-jandex/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | 7 | com.vaadin 8 | vaadin-platform-parent 9 | 25.0-SNAPSHOT 10 | 11 | 12 | vaadin-jandex 13 | jar 14 | Vaadin Jandex index 15 | Jandex index for all Vaadin packages 16 | 17 | 18 | 19 | com.vaadin 20 | vaadin 21 | ${project.version} 22 | 23 | 24 | 25 | com.vaadin 26 | flow-react 27 | 28 | 29 | provided 30 | 31 | 32 | 33 | junit 34 | junit 35 | 4.13.2 36 | test 37 | 38 | 39 | org.jboss 40 | jandex 41 | 3.1.6 42 | test 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-dependency-plugin 52 | 3.1.2 53 | 54 | 55 | unpack-dependencies 56 | generate-resources 57 | 58 | unpack-dependencies 59 | 60 | 61 | **/com/vaadin/**/*.class 62 | ${project.build.outputDirectory} 63 | false 64 | true 65 | 66 | 67 | 68 | 69 | 70 | io.smallrye 71 | jandex-maven-plugin 72 | 3.1.6 73 | 74 | 75 | make-index 76 | 77 | jandex 78 | 79 | 80 | 81 | 82 | 83 | org.apache.maven.plugins 84 | maven-jar-plugin 85 | 3.2.0 86 | 87 | 88 | com 89 | com/**/* 90 | OSGI-INF 91 | OSGI-INF/* 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /vaadin-platform-react-hybrid-security-test/src/main/java/com/vaadin/platform/react/test/views/FlowLayout.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.platform.react.test.views; 2 | 3 | import com.vaadin.flow.component.applayout.AppLayout; 4 | import com.vaadin.flow.component.applayout.DrawerToggle; 5 | import com.vaadin.flow.component.button.Button; 6 | import com.vaadin.flow.component.html.Footer; 7 | import com.vaadin.flow.component.html.H1; 8 | import com.vaadin.flow.component.html.Header; 9 | import com.vaadin.flow.component.html.Span; 10 | import com.vaadin.flow.component.orderedlayout.Scroller; 11 | import com.vaadin.flow.component.sidenav.SideNav; 12 | import com.vaadin.flow.component.sidenav.SideNavItem; 13 | import com.vaadin.flow.router.AfterNavigationEvent; 14 | import com.vaadin.flow.router.AfterNavigationObserver; 15 | import com.vaadin.flow.router.Layout; 16 | import com.vaadin.flow.router.RoutePrefix; 17 | import com.vaadin.flow.server.auth.AnonymousAllowed; 18 | import com.vaadin.flow.server.menu.MenuConfiguration; 19 | import com.vaadin.flow.spring.security.AuthenticationContext; 20 | import com.vaadin.flow.theme.lumo.LumoUtility; 21 | 22 | @Layout("/flow") 23 | @RoutePrefix("flow") 24 | @AnonymousAllowed 25 | public class FlowLayout extends AppLayout implements AfterNavigationObserver { 26 | public static final String LOGIN_BUTTON_ID = "login-button"; 27 | private final AuthenticationContext authenticationContext; 28 | 29 | private H1 viewTitle; 30 | 31 | public FlowLayout(AuthenticationContext authenticationContext) { 32 | this.authenticationContext = authenticationContext; 33 | setPrimarySection(Section.DRAWER); 34 | addDrawerContent(); 35 | addHeaderContent(); 36 | } 37 | 38 | private void addHeaderContent() { 39 | DrawerToggle toggle = new DrawerToggle(); 40 | toggle.setAriaLabel("Menu toggle"); 41 | 42 | viewTitle = new H1(); 43 | viewTitle.addClassNames(LumoUtility.FontSize.LARGE, 44 | LumoUtility.Margin.NONE); 45 | 46 | addToNavbar(true, toggle, viewTitle); 47 | } 48 | 49 | private void addDrawerContent() { 50 | Span appName = new Span("Flow menu"); 51 | appName.addClassNames(LumoUtility.FontWeight.SEMIBOLD, 52 | LumoUtility.FontSize.LARGE); 53 | Header header = new Header(appName); 54 | 55 | Scroller scroller = new Scroller(createNavigation()); 56 | 57 | addToDrawer(header, scroller, createFooter()); 58 | } 59 | 60 | private SideNav createNavigation() { 61 | SideNav nav = new SideNav(); 62 | 63 | MenuConfiguration.getMenuEntries().forEach(menuEntry -> { 64 | if (menuEntry.path().startsWith("flow") || 65 | menuEntry.path().startsWith("/flow")) { 66 | nav.addItem( 67 | new SideNavItem(menuEntry.title(), menuEntry.path())); 68 | } 69 | }); 70 | 71 | return nav; 72 | } 73 | 74 | private Footer createFooter() { 75 | Footer layout = new Footer(); 76 | Button login; 77 | 78 | if (authenticationContext.isAuthenticated()) { 79 | login = new Button("Logout", e -> { 80 | authenticationContext.logout(); 81 | e.getSource().getUI().get().getPage().reload(); 82 | }); 83 | } else { 84 | login = new Button("Sign in", 85 | e -> e.getSource().getUI().get().navigate("login")); 86 | } 87 | login.setId(LOGIN_BUTTON_ID); 88 | layout.add(login); 89 | 90 | return layout; 91 | } 92 | 93 | @Override 94 | public void afterNavigation(AfterNavigationEvent event) { 95 | viewTitle.setText(getCurrentPageTitle()); 96 | } 97 | 98 | private String getCurrentPageTitle() { 99 | return MenuConfiguration.getPageHeader(getContent()).orElse(""); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /vaadin-core-jandex/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | 7 | com.vaadin 8 | vaadin-platform-parent 9 | 25.0-SNAPSHOT 10 | 11 | 12 | vaadin-core-jandex 13 | jar 14 | Vaadin Core Jandex index 15 | Jandex index for vaadin core packages 16 | 17 | 18 | 19 | com.vaadin 20 | vaadin-core 21 | ${project.version} 22 | 23 | 24 | 25 | com.vaadin 26 | flow-react 27 | 28 | 29 | provided 30 | 31 | 32 | 33 | junit 34 | junit 35 | 4.13.2 36 | test 37 | 38 | 39 | org.jboss 40 | jandex 41 | 3.1.6 42 | test 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-dependency-plugin 52 | 3.1.2 53 | 54 | 55 | unpack-dependencies 56 | generate-resources 57 | 58 | unpack-dependencies 59 | 60 | 61 | **/com/vaadin/**/*.class 62 | ${project.build.outputDirectory} 63 | false 64 | true 65 | 66 | 67 | 68 | 69 | 70 | io.smallrye 71 | jandex-maven-plugin 72 | 3.1.6 73 | 74 | 75 | make-index 76 | 77 | jandex 78 | 79 | 80 | 81 | 82 | 83 | org.apache.maven.plugins 84 | maven-jar-plugin 85 | 3.2.0 86 | 87 | 88 | com 89 | com/**/* 90 | OSGI-INF 91 | OSGI-INF/* 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /vaadin-dev/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | com.vaadin 7 | vaadin-platform-parent 8 | 25.0-SNAPSHOT 9 | 10 | vaadin-dev 11 | jar 12 | Vaadin Platform (vaadin-dev) 13 | Vaadin Platform (vaadin-dev) 14 | https://vaadin.com 15 | 16 | 17 | 18 | vaadin-prereleases 19 | https://maven.vaadin.com/vaadin-prereleases/ 20 | 21 | 22 | 23 | 24 | 25 | 26 | com.vaadin 27 | vaadin-bom 28 | ${project.version} 29 | pom 30 | import 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | com.vaadin 39 | vaadin-dev-server 40 | 41 | 42 | 43 | com.vaadin 44 | vaadin-dev-bundle 45 | 46 | 47 | 48 | com.vaadin 49 | copilot 50 | 51 | 52 | 53 | 54 | 55 | io.reformanda.semper 56 | dependencyversion-maven-plugin 57 | 1.0.1 58 | 59 | 60 | set-all 61 | 62 | set-version 63 | 64 | 65 | 66 | 67 | 68 | org.apache.maven.plugins 69 | maven-source-plugin 70 | 3.0.1 71 | 72 | 73 | attach-sources 74 | package 75 | 76 | jar-no-fork 77 | 78 | 79 | 80 | 81 | 82 | maven-javadoc-plugin 83 | 84 | 85 | attach-javadocs 86 | package 87 | 88 | jar 89 | 90 | 91 | 92 | 93 | false 94 | false 95 | true 96 | -Xdoclint:none 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /scripts/generator/templates/template-release-notes-prerelease.md: -------------------------------------------------------------------------------- 1 | Vaadin {{platform}} 2 | 3 | [Upgrading](https://vaadin.com/docs/v25/upgrading) · [Docs](https://vaadin.com/docs/v25/) · [Get Started](https://vaadin.com/docs/v25/getting-started) 4 | 5 | *This is a pre-release for the Vaadin 25.0. We appreciate if you give it a try and [report any issues](https://github.com/vaadin/platform/issues/new) you notice. You can get this version from Maven Central directly.* 6 | 7 | *This is a Major version Upgrade for Vaadin Framework, which contains breaking changes, behavior alters, feature enhancements and UX/DX improvements. We kindly ask for your patience, as we are working on the documentation to make your upgrade path smoother. Meanwhile we try to list all changes in each product's release note* 8 | 9 | *Notable changes and supported technologies can be found from release note [25.0.0-beta1](https://github.com/vaadin/platform/releases/tag/25.0.0-beta1) 10 | 11 | ## Changelogs 12 | 13 | 14 | 15 | - Flow ([{{core.flow.javaVersion}}](https://github.com/vaadin/flow/releases/tag/{{core.flow.javaVersion}})) and Hilla ([{{core.hilla.javaVersion}}](https://github.com/vaadin/hilla/releases/tag/{{core.hilla.javaVersion}})) 16 | - Design System 17 | - Web Components ([{{core.accordion.jsVersion}}](https://github.com/vaadin/web-components/releases/tag/v{{core.accordion.jsVersion}})) 18 | - Flow Components ([{{platform}}](https://github.com/vaadin/flow-components/releases/tag/{{platform}})) 19 | - TestBench ([{{vaadin.vaadin-testbench.javaVersion}}](https://github.com/vaadin/testbench/releases/tag/{{vaadin.vaadin-testbench.javaVersion}})) 20 | - Feature Pack([{{vaadin.vaadin-feature-pack.javaVersion}}](https://vaadin.com/docs/latest/tools/modernization-toolkit/feature-pack)) 21 | - Modernization Toolkit ([Documentation](https://vaadin.com/docs/latest/tools/modernization-toolkit)) 22 | - Feature Pack ([Documentation](https://vaadin.com/docs/latest/tools/modernization-toolkit/feature-pack)) 23 | - Dragonfly ([Documentation](https://vaadin.com/docs/latest/tools/modernization-toolkit/dragonfly)) 24 | - Modernization Toolkit Analyzer ([Analyzer for Eclipse](https://vaadin.com/docs/latest/tools/modernization-toolkit/analyzer-for-eclipse), [Analyzer for Maven](https://vaadin.com/docs/latest/tools/modernization-toolkit/analyzer-for-maven)) 25 | - Multiplatform Runtime (MPR) ([{{core.mpr-v8.javaVersion}}](https://github.com/vaadin/multiplatform-runtime/releases/tag/{{core.mpr-v8.javaVersion}})) 26 | - Router ([{{core.vaadin-router.jsVersion}}](https://github.com/vaadin/vaadin-router/releases/tag/v{{core.vaadin-router.jsVersion}})) 27 | - Vaadin Kits 28 | - AppSec Kit ([{{kits.appsec-kit-starter.javaVersion}}](https://vaadin.com/docs/latest/tools/appsec)) 29 | - Azure Kit ([{{kits.azure-kit.version}}](https://vaadin.com/docs/latest/tools/azure-cloud )) 30 | - Collaboration Engine ([{{kits.vaadin-collaboration-engine.javaVersion}}](https://github.com/vaadin/collaboration-kit/releases/tag/{{kits.vaadin-collaboration-engine.javaVersion}})) 31 | - Copilot ([{{kits.copilot.javaVersion}}](https://vaadin.com/docs/latest/tools/copilot)) 32 | - Kubernetes Kit ([{{kits.kubernetes-kit-starter.javaVersion}}](https://github.com/vaadin/kubernetes-kit/releases/tag/{{kits.kubernetes-kit-starter.javaVersion}})) 33 | - Observability Kit ([{{kits.observability-kit-starter.javaVersion}}](https://github.com/vaadin/observability-kit/releases/tag/{{kits.observability-kit-starter.javaVersion}})) 34 | - SSO Kit ([{{kits.sso-kit-starter.javaVersion}}](https://github.com/vaadin/sso-kit/releases/tag/{{kits.sso-kit-starter.javaVersion}})) 35 | - Swing Kit ([{{kits.swing-kit.javaVersion}}](https://vaadin.com/docs/latest/tools/swing)) 36 | 37 | **Official add-ons and plugins:** 38 | 39 | - Spring add-on ([{{core.flow.javaVersion}}](https://github.com/vaadin/flow/releases/tag/{{core.flow.javaVersion}})) 40 | - CDI add-on ([{{core.flow-cdi.javaVersion}}](https://github.com/vaadin/cdi/releases/tag/{{core.flow-cdi.javaVersion}})) 41 | - Maven plugin ({{platform}}) 42 | - Gradle plugin ({{platform}}) 43 | - Quarkus plugin ([{{core.vaadin-quarkus.javaVersion}}](https://github.com/vaadin/quarkus/releases/tag/{{core.vaadin-quarkus.javaVersion}})) 44 | -------------------------------------------------------------------------------- /scripts/generator/src/writer.js: -------------------------------------------------------------------------------- 1 | const creator = require('./creator'); 2 | const fs = require('fs'); 3 | 4 | /** 5 | @param {Object} versions data object for product versions. 6 | @param {String} templateFileName absolute path to template file 7 | @param {String} outputFileName absolute path to output file 8 | @param {String} key name for the generated json object 9 | */ 10 | function writeSeparateJson(versions, templateFileName, outputFileName, key) { 11 | const packageJsonTemplate = require(templateFileName); 12 | 13 | const packageJsonResult = creator.createJson(versions, key, packageJsonTemplate); 14 | fs.writeFileSync(outputFileName, packageJsonResult); 15 | console.log(`Wrote ${outputFileName}`); 16 | } 17 | 18 | function writeNestedSeparateJson(versions, templateFileName, outputFileName, key, nestedKey, nestedKey2) { 19 | const packageJsonTemplate = require(templateFileName); 20 | 21 | const packageJsonResult = creator.createNestedJson(versions, key, nestedKey, nestedKey2, packageJsonTemplate); 22 | fs.writeFileSync(outputFileName, packageJsonResult); 23 | console.log(`Wrote ${outputFileName}`); 24 | } 25 | 26 | /** 27 | @param {Object} versions data object for product versions. 28 | @param {String} templateFileName absolute path to template file 29 | @param {String} outputFileName absolute path to output file 30 | */ 31 | function writePackageJson(versions, templateFileName, outputFileName) { 32 | const packageJsonTemplate = require(templateFileName); 33 | 34 | const packageJsonResult = creator.createPackageJson(versions, packageJsonTemplate); 35 | 36 | fs.writeFileSync(outputFileName, packageJsonResult); 37 | console.log(`Wrote ${outputFileName}`); 38 | } 39 | 40 | /** 41 | @param {Object} versions data object for product versions. 42 | @param {String} templateFileName absolute path to template file 43 | @param {String} outputFileName absolute path to output file 44 | */ 45 | function writeMaven(versions, templateFileName, outputFileName) { 46 | const mavenTemplate = fs.readFileSync(templateFileName, 'utf8'); 47 | 48 | const mavenBom = creator.createMaven(versions, mavenTemplate); 49 | 50 | fs.writeFileSync(outputFileName, mavenBom); 51 | console.log(`Wrote ${outputFileName}`); 52 | } 53 | 54 | /** 55 | @param {Object} versions data object for product versions. 56 | @param {String} the module name for this property 57 | @param {String} templateFileName absolute path to template file 58 | @param {String} outputFileName absolute path to output file 59 | */ 60 | function writeProperty(versions, module, templateFileName, outputFileName) { 61 | const mavenTemplate = fs.readFileSync(templateFileName, 'utf8'); 62 | 63 | const mavenBom = creator.addProperty(versions, module, mavenTemplate); 64 | 65 | fs.writeFileSync(outputFileName, mavenBom); 66 | console.log(`Wrote ${outputFileName}`); 67 | } 68 | 69 | /** 70 | @param {Object} versions data object for product versions. 71 | @param {String} templateFileName absolute path to template file 72 | @param {String} outputFileName absolute path to output file 73 | */ 74 | function writeReleaseNotes(versions, templateFileName, outputFileName) { 75 | const releaseNoteTemplate = fs.readFileSync(templateFileName, 'utf8'); 76 | const releaseNotes = creator.createReleaseNotes(versions, releaseNoteTemplate); 77 | 78 | fs.writeFileSync(outputFileName, releaseNotes); 79 | console.log(`Wrote ${outputFileName}`); 80 | } 81 | 82 | /** 83 | @param {Object} versions data object for product versions. 84 | @param {String} templateFileName absolute path to template file 85 | @param {String} outputFileName absolute path to output file 86 | */ 87 | function writeModulesReleaseNotes(versions, version, templateFileName, outputFileName) { 88 | const modulesReleaseNoteTemplate = fs.readFileSync(templateFileName, 'utf8'); 89 | const modulesReleaseNotes = creator.createModulesReleaseNotes(versions, version, modulesReleaseNoteTemplate); 90 | 91 | fs.writeFileSync(outputFileName, modulesReleaseNotes); 92 | console.log(`Wrote ${outputFileName}`); 93 | } 94 | 95 | exports.writeSeparateJson = writeSeparateJson; 96 | exports.writeNestedSeparateJson = writeNestedSeparateJson; 97 | exports.writePackageJson = writePackageJson; 98 | exports.writeMaven = writeMaven; 99 | exports.writeProperty = writeProperty; 100 | exports.writeReleaseNotes = writeReleaseNotes; 101 | exports.writeModulesReleaseNotes = writeModulesReleaseNotes; 102 | -------------------------------------------------------------------------------- /vaadin-platform-sbom/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | com.vaadin 7 | vaadin-platform-parent 8 | 25.0-SNAPSHOT 9 | 10 | vaadin-platform-sbom 11 | jar 12 | 13 | 17 14 | 17 15 | UTF-8 16 | UTF-8 17 | 18 | 19 | 20 | 21 | com.vaadin 22 | vaadin-bom 23 | ${project.version} 24 | pom 25 | import 26 | 27 | 28 | 29 | 30 | 31 | 32 | com.vaadin 33 | vaadin 34 | 35 | 36 | com.vaadin 37 | vaadin-spreadsheet-flow 38 | 39 | 40 | com.vaadin 41 | vaadin-feature-pack-flow 42 | 43 | 44 | com.vaadin 45 | vaadin-spring-boot-starter 46 | 47 | 48 | com.vaadin 49 | hilla-spring-boot-starter 50 | 51 | 52 | com.vaadin 53 | vaadin-testbench 54 | 55 | 56 | com.vaadin 57 | flow-webpush 58 | 59 | 60 | 61 | com.vaadin 62 | appsec-kit-starter 63 | 64 | 65 | com.vaadin 66 | sso-kit-starter 67 | 68 | 69 | com.vaadin 70 | kubernetes-kit-starter 71 | 72 | 73 | com.vaadin 74 | observability-kit-starter 75 | 76 | 77 | com.vaadin 78 | vaadin-swing-kit-flow 79 | 80 | 81 | com.vaadin 82 | vaadin-swing-kit-client 83 | 84 | 85 | com.vaadin 86 | vaadin-swing-kit-client-api 87 | 88 | 89 | com.vaadin 90 | copilot 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | com.vaadin 99 | vaadin-maven-plugin 100 | ${project.version} 101 | 102 | 103 | package-for-production 104 | 105 | build-frontend 106 | 107 | prepare-package 108 | 109 | 110 | 111 | 112 | 113 | 114 | --------------------------------------------------------------------------------