diff --git a/.github/workflows/validation-native.yaml b/.github/workflows/validation-native.yaml index 60bcfd2c..3af98982 100644 --- a/.github/workflows/validation-native.yaml +++ b/.github/workflows/validation-native.yaml @@ -108,5 +108,5 @@ jobs: - uses: actions/upload-artifact@v4 if: ${{ failure() || success() }} with: - name: tests-output-it-native-${{ matrix.name }} + name: tests-output-it-native-${{ matrix.module.name }} path: tests-report-*.tgz diff --git a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java index 49505f65..a775f820 100644 --- a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java +++ b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java @@ -48,6 +48,7 @@ import com.vaadin.hilla.Endpoint; import com.vaadin.hilla.EndpointExposed; import com.vaadin.hilla.crud.filter.Filter; +import com.vaadin.hilla.endpointransfermapper.EndpointTransferMapper; import com.vaadin.hilla.push.PushEndpoint; import io.quarkus.arc.deployment.ExcludedTypeBuildItem; import io.quarkus.bootstrap.classloading.QuarkusClassLoader; @@ -224,8 +225,19 @@ void hillaNativeSupport( .includePatterns("META-INF/microprofile-config\\.properties") .build()); + // explicitly register classes not present in the index + reflectiveClass.produce(ReflectiveClassBuildItem.builder( + com.github.mcollovati.quarkus.hilla.crud.panache.CrudRepositoryService.class, + com.github.mcollovati.quarkus.hilla.crud.panache.ListRepositoryService.class, + com.github.mcollovati.quarkus.hilla.crud.spring.CrudRepositoryService.class, + com.github.mcollovati.quarkus.hilla.crud.spring.ListRepositoryService.class) + .constructors() + .methods() + .build()); + IndexView index = combinedIndex.getComputingIndex(); Set classes = new HashSet<>(); + classes.addAll(index.getAllKnownImplementors(EndpointTransferMapper.Mapper.class)); classes.addAll(getAnnotatedClasses(index, DotName.createSimple(BrowserCallable.class))); classes.addAll(getAnnotatedClasses(index, DotName.createSimple(Endpoint.class))); classes.addAll(getAnnotatedClasses(index, DotName.createSimple(EndpointExposed.class))); @@ -233,6 +245,9 @@ void hillaNativeSupport( classes.add(index.getClassByName(Filter.class)); classes.add(index.getClassByName(Pageable.class)); classes.addAll(getJsonClasses(index)); + classes.addAll(index.getAllKnownImplementors(EndpointTransferMapper.Mapper.class)); + classes.addAll(index.getClassesInPackage("com.vaadin.hilla.mappedtypes")); + classes.addAll(index.getClassesInPackage("com.vaadin.hilla.runtime.transfertypes")); if (capabilities.isPresent(QuarkusHillaExtensionProcessor.SPRING_DATA_SUPPORT)) { classes.add(index.getClassByName("org.springframework.data.repository.Repository")); @@ -312,9 +327,7 @@ void vaadinNativeSupport( .map(classInfo -> classInfo.name().toString()) .toArray(String[]::new)) .constructors() - .queryConstructors() .methods() - .queryMethods() .fields() .build()); diff --git a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/asm/OffendingMethodCallsReplacer.java b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/asm/OffendingMethodCallsReplacer.java index 0f6871d7..2f402dcb 100644 --- a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/asm/OffendingMethodCallsReplacer.java +++ b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/asm/OffendingMethodCallsReplacer.java @@ -28,6 +28,9 @@ import com.vaadin.hilla.signals.core.registry.SecureSignalsRegistry; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.builditem.BytecodeTransformerBuildItem; +import io.quarkus.gizmo.ClassTransformer; +import io.quarkus.gizmo.MethodDescriptor; +import org.springframework.data.domain.Sort; import com.github.mcollovati.quarkus.hilla.SpringReplacements; @@ -95,6 +98,14 @@ public static void addClassVisitors(BuildProducer producer.produce(new BytecodeTransformerBuildItem( ConfigList.Processor.class.getName(), (s, classVisitor) -> new NonnullPluginConfigProcessorClassVisitor(classVisitor))); + // Remove sort method that references a type that is not in the shaded deps jar + producer.produce(new BytecodeTransformerBuildItem(Sort.class.getName(), (className, classVisitor) -> { + ClassTransformer transformer = new ClassTransformer(className); + MethodDescriptor sortMethod = + MethodDescriptor.ofMethod(className, "sort", className + "$TypedSort", "java.lang.Class"); + transformer.removeMethod(sortMethod); + return transformer.applyTo(classVisitor); + })); } @SafeVarargs diff --git a/commons/hilla-shaded-deps/pom.xml b/commons/hilla-shaded-deps/pom.xml index 32119488..6255ee0e 100644 --- a/commons/hilla-shaded-deps/pom.xml +++ b/commons/hilla-shaded-deps/pom.xml @@ -121,6 +121,7 @@ org/springframework/data/domain/AbstractPageRequest.class org/springframework/data/domain/Chunk.class org/springframework/data/domain/KeysetScrollPosition.class + org/springframework/data/domain/Limit**.class org/springframework/data/domain/OffsetScrollPosition.class org/springframework/data/domain/ScrollPosition.class org/springframework/data/domain/ScrollPosition$Direction.class