Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: make extension depend on vaadin-quarkus #997

Merged
merged 6 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/run-validation/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ runs:
if [[ "${{ inputs.skip_vaadin_version_detection }}" == "false" ]]; then
vaadin_version=$(mvn -ntp -N -Pdetect-vaadin-platform -q)-SNAPSHOT
hilla_version=$(mvn -ntp -N -q help:evaluate -Dexpression=hilla.version -DforceStdout)
vaadin_quarkus_version=$(mvn -ntp -N -Pdetect-vaadin-platform -Dexpression=vaadin.quarkus -q)-SNAPSHOT
mvn -B -ntp versions:set-property -Dproperty=vaadin.version -DnewVersion=$vaadin_version -DgenerateBackupPoms=false -Pit-tests
mvn -B -ntp versions:set-property -Dproperty=vaadin.quarkus.version -DnewVersion=$vaadin_quarkus_version -DgenerateBackupPoms=false -Pit-tests
echo "Running Validation for Hilla $hilla_version and Vaadin $vaadin_version ">> "$GITHUB_STEP_SUMMARY"
fi
mvn -V -e -B -ntp -DskipTests -Dmaven.javadoc.skip=false install
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ jobs:
| tee -a $GITHUB_STEP_SUMMARY
exit 1
fi
vaadin_quarkus_version=$(mvn -ntp -N -q help:evaluate -Dexpression=vaadin.quarkus.version -DforceStdout)
if [[ "$vaadin_quarkus_version" =~ .*-SNAPSHOT ]]; then
mvn -N -ntp -Dproperty=vaadin.quarkus.version -DallowMinorUpdates=false -DgenerateBackupPoms=false -Dmaven.version.rules=file://$(pwd)/etc/release-version-rules.xml versions:update-property
vaadin_quarkus_version=$(mvn -ntp -N -q help:evaluate -Dexpression=vaadin.quarkus.version -DforceStdout)
echo "⚠️ SNAPSHOT detected for vaadin-quarkus version. Automatically forcing version to $vaadin_quarkus_version." | tee -a $GITHUB_STEP_SUMMARY
fi
- name: Setup Java
uses: actions/setup-java@v4
with:
Expand Down
43 changes: 31 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,31 @@ and [Security](https://hilla.dev/docs/lit/guides/security).
**NOTE**: This is an **unofficial community extension**, and it is **not**
directly related **nor** supported by Vaadin Ltd.

## Notable changes

### Lit and React extensions

Starting with `2.4.1`, the extension is subdivided into two main artifacts based on the desired front-end framework:

* `quarkus-hilla` for `Lit` based applications
* `quarkus-hilla-react` for `React` based applications

### Vaadin Unified platform

Since Vaadin `24.4`, Flow and Hilla are unified in a single platform.
As a consequence, there have been a considerable amount of changes in Hilla, for example the `groupId` of Maven artifacts
As a consequence, there have been a considerable amount of changes in Hilla, for example the `groupId` of Maven
artifacts
and Java package names moved from `dev.hilla` to `com.vaadin.hilla`.
Quarkus-hilla will follow the Vaadin platform releases, so the extension version will bump from `2.5` series to `24.4`.
Quarkus-Hilla will follow the Vaadin platform releases, so the extension version will bump from `2.5` series to `24.4`.
In addition, the minimum supported Quarkus version will be `3.7`.

### Integration with Vaadin Quarkus extension

To provide better support for Hilla on the Quarkus platform and simplify maintenance, the `quarkus-hilla` extension will
depend on the existing [Vaadin Quarkus extension](https://github.com/vaadin/quarkus/), starting with `24.5`. This
integration eliminates the need for code duplication and ensures tighter alignment with Vaadin's ecosystem, offering
more streamlined updates and improved stability. By leveraging the Vaadin Quarkus extension, users of `quarkus-hilla`
will benefit from enhanced compatibility with future Vaadin features.

## Limitations

Expand All @@ -47,11 +62,13 @@ The current Hilla support has some known limitations:

## Auto CRUD, Auto Grid and Auto Form

Support for [Auto CRUD](https://hilla.dev/docs/react/components/auto-crud), [Auto Grid](https://hilla.dev/docs/react/components/auto-grid[)
Support
for [Auto CRUD](https://hilla.dev/docs/react/components/auto-crud), [Auto Grid](https://hilla.dev/docs/react/components/auto-grid[)
and [Auto Form](https://hilla.dev/docs/react/components/auto-crud) is available in `quarkus-hilla-react`.
However, both extensions provides custom implementations of `CrudRepositoryService` and `ListRepositoryService`,
based on `quarkus-spring-data-jpa` or `quarkus-hibernate-orm-panache` extension.
See the [documentation](https://github.com/mcollovati/quarkus-hilla/wiki/Crud-List-repository-service) for additional details.
See the [documentation](https://github.com/mcollovati/quarkus-hilla/wiki/Crud-List-repository-service) for additional
details.

## Usage statistics

Expand All @@ -72,6 +89,7 @@ Get started with `quarkus-hilla` by following the [Quick Start Guide](../../wiki
or download the [starter project](https://github.com/mcollovati/quarkus-hilla-starter).

```xml

<dependency>
<groupId>com.github.mcollovati</groupId>
<artifactId>quarkus-hilla</artifactId>
Expand All @@ -82,6 +100,7 @@ or download the [starter project](https://github.com/mcollovati/quarkus-hilla-st
or

```xml

<dependency>
<groupId>com.github.mcollovati</groupId>
<artifactId>quarkus-hilla-react</artifactId>
Expand All @@ -91,15 +110,15 @@ or

## Releases

| Quarkus-Hilla / Hilla | Quarkus | Vaadin |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Quarkus-Hilla / Hilla | Quarkus | Vaadin |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| <picture><img alt="Maven Central 24.4" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=24.4" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.12+" src="https://img.shields.io/badge/QUARKUS-v3.12%2B-limegreen?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.4" src="https://img.shields.io/badge/VAADIN-v24.4-limegreen?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.5" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=2.5" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.2" src="https://img.shields.io/badge/VAADIN-v24.2-blue?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.4" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=2.4" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.2" src="https://img.shields.io/badge/VAADIN-v24.2-blue?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.3" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=2.3" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.2" src="https://img.shields.io/badge/VAADIN-v24.2-blue?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.2" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=2.2" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.2" src="https://img.shields.io/badge/VAADIN-v24.2-limegreen?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.1" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?color=limegreen&style=for-the-badge&logo=apache-maven&versionPrefix=2.1" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-limegreen?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.1" src="https://img.shields.io/badge/VAADIN-v24.1-limegreen?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 1.x" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=1" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 2.16+" src="https://img.shields.io/badge/QUARKUS-v2.16%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 23.3+" src="https://img.shields.io/badge/VAADIN-v23.3%2B-blue?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.5" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=2.5" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.2" src="https://img.shields.io/badge/VAADIN-v24.2-blue?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.4" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=2.4" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.2" src="https://img.shields.io/badge/VAADIN-v24.2-blue?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.3" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=2.3" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.2" src="https://img.shields.io/badge/VAADIN-v24.2-blue?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.2" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=2.2" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.2" src="https://img.shields.io/badge/VAADIN-v24.2-limegreen?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 2.1" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?color=limegreen&style=for-the-badge&logo=apache-maven&versionPrefix=2.1" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 3.1+" src="https://img.shields.io/badge/QUARKUS-v3.1%2B-limegreen?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 24.1" src="https://img.shields.io/badge/VAADIN-v24.1-limegreen?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |
| <picture><img alt="Maven Central 1.x" src="https://img.shields.io/maven-central/v/com.github.mcollovati/quarkus-hilla?style=for-the-badge&logo=apache-maven&versionPrefix=1" style="visibility: visible;"></picture> | <picture><img alt="Quarkus 2.16+" src="https://img.shields.io/badge/QUARKUS-v2.16%2B-blue?style=for-the-badge&logo=Quarkus" style="visibility: visible;"></picture> | <picture><img alt="Vaadin 23.3+" src="https://img.shields.io/badge/VAADIN-v23.3%2B-blue?style=for-the-badge&logo=Vaadin" style="visibility: visible;"></picture> |

**NOTE**: The major and minor version of Quarkus-Hilla always matches the Vaadin/Hilla version.

Expand Down
11 changes: 11 additions & 0 deletions deployment-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@
<groupId>com.github.mcollovati</groupId>
<artifactId>quarkus-hilla-commons</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev-server</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-quarkus-deployment</artifactId>
<version>${vaadin.quarkus.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.vaadin.flow.server.auth.AnnotatedViewAccessChecker;
import com.vaadin.flow.server.auth.AnonymousAllowed;
import com.vaadin.flow.server.auth.DefaultAccessCheckDecisionResolver;
import com.vaadin.flow.server.auth.DefaultMenuAccessControl;
import com.vaadin.flow.server.startup.ServletDeployer;
import com.vaadin.hilla.BrowserCallable;
import com.vaadin.hilla.Endpoint;
Expand Down Expand Up @@ -477,6 +478,19 @@ void preventHillaSpringBeansDetection(BuildProducer<ExcludedTypeBuildItem> produ
producer.produce(new ExcludedTypeBuildItem(ServletDeployer.class.getName()));
}

/*
* Temporary step to register missing beans
* See https://github.com/vaadin/quarkus/issues/175
*/
@BuildStep
void registerVaadinQuarkusServices(BuildProducer<AdditionalBeanBuildItem> producer) {
producer.produce(AdditionalBeanBuildItem.builder()
.addBeanClass(DefaultMenuAccessControl.class)
.setDefaultScope(DotNames.SINGLETON)
.setUnremovable()
.build());
}

public static final class NavigationAccessControlBuildItem extends SimpleBuildItem {

private final String loginPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
import com.vaadin.flow.di.LookupInitializer;
import com.vaadin.flow.router.HasErrorParameter;
import com.vaadin.flow.router.HasUrlParameter;
import com.vaadin.flow.router.Layout;
import com.vaadin.flow.router.Menu;
import com.vaadin.flow.router.MenuData;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.router.RouteAlias;
import com.vaadin.flow.router.RouterLayout;
import com.vaadin.flow.server.menu.AvailableViewInfo;
import com.vaadin.flow.server.menu.RouteParamType;
import com.vaadin.flow.server.startup.ServletDeployer;
import com.vaadin.hilla.BrowserCallable;
import com.vaadin.hilla.Endpoint;
Expand Down Expand Up @@ -246,15 +249,18 @@ void vaadinNativeSupport(
runtimeInitializedPackage.produce(new RuntimeInitializedPackageBuildItem("org.atmosphere.util.analytics"));

// JSON serialization
reflectiveClass.produce(ReflectiveClassBuildItem.builder(AvailableViewInfo.class, MenuData.class)
.constructors()
.methods()
.fields()
.build());
reflectiveClass.produce(
ReflectiveClassBuildItem.builder(AvailableViewInfo.class, MenuData.class, RouteParamType.class)
.constructors()
.methods()
.fields()
.build());

Set<ClassInfo> classes = new HashSet<>();
classes.addAll(getAnnotatedClasses(index, DotName.createSimple(Route.class)));
classes.addAll(getAnnotatedClasses(index, DotName.createSimple(RouteAlias.class)));
classes.addAll(getAnnotatedClasses(index, DotName.createSimple(Layout.class)));
classes.addAll(getAnnotatedClasses(index, DotName.createSimple(Menu.class)));
classes.addAll(index.getAllKnownImplementors(AppShellConfigurator.class));
classes.addAll(getCommonComponentClasses(index));
classes.addAll(index.getAllKnownSubclasses(Component.class));
Expand Down
Loading
Loading