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: add generator plugin for endpoints returning signals #2639

Merged

Conversation

taefi
Copy link
Contributor

@taefi taefi commented Aug 1, 2024

Description

The generator-plugin-signals enables the generator
to transform implementation of generated endpoints
containing methods that return a signal instances in
a way to create and return the correct signal instance
instead of Promise.

The added plugin ensures that an endpoint containing
a mixture of methods returning signal instances and
other supported types has correct implementation for
each method. It also ensures the implementation of
endpoints without any methods returning a signal
remains unchanged.

Fixes #2628

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 99.19355% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.92%. Comparing base (bb6a2e4) to head (61b182c).
Report is 1 commits behind head on main.

Files Patch % Lines
...ts/generator-plugin-signals/src/SignalProcessor.ts 99.19% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2639      +/-   ##
==========================================
+ Coverage   92.58%   92.92%   +0.34%     
==========================================
  Files          71       72       +1     
  Lines        2266     2390     +124     
  Branches      591      611      +20     
==========================================
+ Hits         2098     2221     +123     
- Misses        121      122       +1     
  Partials       47       47              
Flag Coverage Δ
unittests 92.92% <99.19%> (+0.34%) ⬆️

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.

Copy link
Contributor

@Lodin Lodin left a comment

Choose a reason for hiding this comment

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

LGTM overall but there is some places to fix

packages/ts/generator-plugin-signals/src/index.ts Outdated Show resolved Hide resolved
packages/ts/generator-plugin-signals/src/index.ts Outdated Show resolved Hide resolved
packages/ts/generator-plugin-signals/src/index.ts Outdated Show resolved Hide resolved
@taefi taefi requested a review from Lodin August 6, 2024 14:54
Copy link

sonarcloud bot commented Aug 7, 2024

@taefi taefi merged commit 2a523c5 into main Aug 7, 2024
16 checks passed
@taefi taefi deleted the taefi/enable-generator-to-generate-correct-endpoint-services branch August 7, 2024 12:31
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.5.0.alpha8 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants