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

feat(generator-plugin-transfertypes): add generics & importing from the correct module #3318

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

Lodin
Copy link
Contributor

@Lodin Lodin commented Mar 3, 2025

Fixes #3208

This pull request includes several changes across multiple files to enhance functionality and improve the codebase. The most important changes involve adding new annotations, refactoring methods, and updating dependencies. Below is a summary of the key changes:

Enhancements and New Features:

  • Added new annotation @FromModule to specify module information for transfer types in packages/java/runtime-plugin-transfertypes/src/main/java/com/vaadin/hilla/transfertypes/annotations/FromModule.java.
  • Introduced new Signal classes and corresponding test cases to handle different signal types in packages/java/parser-jvm-plugin-transfertypes/src/test/java/com/vaadin/hilla/signals/. [1] [2] [3] [4]

Code Refactoring:

  • Refactored scan method in Plugin interface to provide a default implementation in packages/java/parser-jvm-core/src/main/java/com/vaadin/hilla/parser/core/Plugin.java.
  • Updated TransferTypesPlugin to handle new signal classes and added logic to replace signal classes with local signal records in packages/java/parser-jvm-plugin-transfertypes/src/main/java/com/vaadin/hilla/parser/plugins/transfertypes/TransferTypesPlugin.java. [1] [2]

Dependency and Import Management:

  • Added necessary imports for new signal classes and annotations in TransferTypesPlugin and other related files.
  • Updated module-info.java to export the new annotations package in packages/java/runtime-plugin-transfertypes/src/main/java/module-info.java.

Testing and Validation:

  • Added comprehensive test cases for new signal functionality in packages/java/parser-jvm-plugin-transfertypes/src/test/java/com/vaadin/hilla/parser/plugins/transfertypes/signals/SignalTest.java.

These changes collectively enhance the functionality and maintainability of the codebase by introducing new features, refactoring existing methods, and ensuring proper dependency management.

@Lodin Lodin requested a review from taefi March 3, 2025 12:29
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 87.39496% with 15 lines in your changes missing coverage. Please review.

Project coverage is 86.62%. Comparing base (447ac68) to head (253dc33).

Files with missing lines Patch % Lines
...ts/generator-plugin-signals/src/SignalProcessor.ts 91.22% 9 Missing and 1 partial ⚠️
...nerator-plugin-backbone/src/TypeSchemaProcessor.ts 0.00% 4 Missing ⚠️
packages/ts/generator-utils/src/ast.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3318      +/-   ##
==========================================
- Coverage   86.89%   86.62%   -0.28%     
==========================================
  Files         115      115              
  Lines        8289     8163     -126     
  Branches     1271     1261      -10     
==========================================
- Hits         7203     7071     -132     
- Misses       1072     1077       +5     
- Partials       14       15       +1     
Flag Coverage Δ
unittests 86.62% <87.39%> (-0.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@taefi
Copy link
Contributor

taefi commented Mar 6, 2025

The changes for the TransferTypePlugin and the Generator seems fine, but I guess the generator-plugin-signals should also adopt the changes, so that the ITs can pass. The generated TS sources that are received by plugin-generator-signals are different now. The open-api.json files for unit testing of the generator-plugin-signals should also have the endpoints defined in the new format that this PR introduces.

@Lodin Lodin requested a review from taefi March 12, 2025 22:13
taefi
taefi previously approved these changes Mar 17, 2025
Copy link
Contributor

@taefi taefi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added one comment, but generally, LGTM!

Lodin added 2 commits March 24, 2025 12:17
# Conflicts:
#	package-lock.json
#	packages/ts/generator-plugin-signals/package.json
#	packages/ts/react-crud/package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

generator-transfer-type plugin is missing support for generics
2 participants