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

fix: regenerate file-router files when layouts changes #2796

Merged
merged 8 commits into from
Oct 14, 2024

Conversation

mcollovati
Copy link
Contributor

Description

The layouts file can be updated by Flow at runtime when an annotated layout class is modified and reloaded.
This change forces the Vite file-router plugin to regenerate files and trigger a fs-route-update to refresh the client configuration.

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.

@mcollovati mcollovati changed the title fix: regenerate file-routes files when layouts change fix: regenerate file-router files when layouts change Oct 4, 2024
@mcollovati mcollovati changed the title fix: regenerate file-router files when layouts change fix: regenerate file-router files when layouts changes Oct 4, 2024
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.28%. Comparing base (792e121) to head (78f5a2a).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2796      +/-   ##
==========================================
- Coverage   92.28%   92.28%   -0.01%     
==========================================
  Files          81       81              
  Lines        2684     2683       -1     
  Branches      689      688       -1     
==========================================
- Hits         2477     2476       -1     
  Misses        156      156              
  Partials       51       51              
Flag Coverage Δ
unittests 92.28% <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.

@mcollovati
Copy link
Contributor Author

Any suggestion on how to write at least test for this change?

The layouts file can be updated by Flow at runtime when an annotated
layout class is modified and reloaded.
This change forces the Vite file-router plugin to regenerate files
and trigger a fs-route-update to refresh the client configuration.
@mcollovati mcollovati force-pushed the fix/fs_router_generate_runtime_file_on_layouts_change branch from b56f53e to a3e9411 Compare October 11, 2024 14:04
Copy link

@platosha platosha merged commit 3b56dad into main Oct 14, 2024
15 checks passed
@platosha platosha deleted the fix/fs_router_generate_runtime_file_on_layouts_change branch October 14, 2024 14:01
vaadin-bot pushed a commit that referenced this pull request Oct 14, 2024
* fix: regenerate file-routes files when layouts change

The layouts file can be updated by Flow at runtime when an annotated
layout class is modified and reloaded.
This change forces the Vite file-router plugin to regenerate files
and trigger a fs-route-update to refresh the client configuration.

* add tests

* refactor test to reduce code duplication

* remove unused import

* rename test function

* refactor tests

* fix tests

---------

Co-authored-by: Anton Platonov <[email protected]>
taefi pushed a commit that referenced this pull request Oct 14, 2024
…4.5) (#2832)

fix: regenerate file-router files when layouts changes (#2796)

* fix: regenerate file-routes files when layouts change

The layouts file can be updated by Flow at runtime when an annotated
layout class is modified and reloaded.
This change forces the Vite file-router plugin to regenerate files
and trigger a fs-route-update to refresh the client configuration.

* add tests

* refactor test to reduce code duplication

* remove unused import

* rename test function

* refactor tests

* fix tests

---------

Co-authored-by: Marco Collovati <[email protected]>
Co-authored-by: Anton Platonov <[email protected]>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.6.0.alpha1 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