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: enable ListSignal in generator-plugin-signals #2810

Merged
merged 43 commits into from
Oct 16, 2024

Conversation

taefi
Copy link
Contributor

@taefi taefi commented Oct 9, 2024

Description

This enables the generator-plugin-signals to correctly generate TS services for the endpoints with methods returning instances of ListSignal.

Follow-up for #2775

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.

This changes the way updates are sent to the clients
after the acceptance/rejection of an event on the
server. With this applied, the REJECT event is removed
and SNAPSHOT event containing the current state of the
server-side signal only when (re)subscribing to a signal
and not after each update. The events received by the
server regarding each update to a signal is propagated
to the clients with a boolean value that indicates the
acceptance/rejection of the operation so clients decide
to discard/apply/confirm the operation on their local
value.
This unifies the way with how List signals are going
to work: to get snapshot events with the current state
on the server only when subscribing signals (which can
be a long list of values), and then getting updates of
individual operations for subsequent updates, one at a
time.
This extract the Signal abstraction out of ValueSignal so that the ListSignal implementation can inherit the common functionalities.

Part of #2654
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.57%. Comparing base (ac9f4e6) to head (ff08537).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2810      +/-   ##
==========================================
+ Coverage   92.56%   92.57%   +0.01%     
==========================================
  Files          83       83              
  Lines        2798     2802       +4     
  Branches      720      721       +1     
==========================================
+ Hits         2590     2594       +4     
  Misses        156      156              
  Partials       52       52              
Flag Coverage Δ
unittests 92.57% <100.00%> (+0.01%) ⬆️

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.

Base automatically changed from taefi/feat/add-list-signal to main October 14, 2024 15:35
Copy link

@cromoteca cromoteca merged commit 0b3c928 into main Oct 16, 2024
15 checks passed
@cromoteca cromoteca deleted the taefi/feat/enable-list-signal-in-generator branch October 16, 2024 13:30
@vaadin-bot
Copy link
Collaborator

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

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

Successfully merging this pull request may close these issues.

3 participants