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: HMR for translations #2795

Merged
merged 8 commits into from
Oct 16, 2024
Merged

feat: HMR for translations #2795

merged 8 commits into from
Oct 16, 2024

Conversation

Artur-
Copy link
Member

@Artur- Artur- commented Oct 4, 2024

Fixes #2175

Artur- added a commit to vaadin/flow that referenced this pull request Oct 4, 2024
* Clears resource bundle cache on translation resource redeployment
* Fires a HMR event to the browser when translations are reloaded

Limitation: Only supports DefaultI18NHandler where the paths are known. If you have a custom I18N handler, you might need a custom HMR supporting HotswapListener.

For #20118
Requires vaadin/hilla#2795 to fully fix the issue
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.56%. Comparing base (9bafcb7) to head (2a2f458).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2795   +/-   ##
=======================================
  Coverage   92.56%   92.56%           
=======================================
  Files          83       83           
  Lines        2798     2798           
  Branches      720      720           
=======================================
  Hits         2590     2590           
  Misses        156      156           
  Partials       52       52           
Flag Coverage Δ
unittests 92.56% <ø> (ø)

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.

mshabarov pushed a commit to vaadin/flow that referenced this pull request Oct 7, 2024
* fix: HMR for translation files

* Clears resource bundle cache on translation resource redeployment
* Fires a HMR event to the browser when translations are reloaded

Limitation: Only supports DefaultI18NHandler where the paths are known. If you have a custom I18N handler, you might need a custom HMR supporting HotswapListener.

For #20118
Requires vaadin/hilla#2795 to fully fix the issue

* format

* trigger Flow UIs refresh

* flow support

* detect correct refresh stragety per UI

---------

Co-authored-by: Marco Collovati <[email protected]>
vaadin-bot pushed a commit to vaadin/flow that referenced this pull request Oct 7, 2024
* fix: HMR for translation files

* Clears resource bundle cache on translation resource redeployment
* Fires a HMR event to the browser when translations are reloaded

Limitation: Only supports DefaultI18NHandler where the paths are known. If you have a custom I18N handler, you might need a custom HMR supporting HotswapListener.

For #20118
Requires vaadin/hilla#2795 to fully fix the issue

* format

* trigger Flow UIs refresh

* flow support

* detect correct refresh stragety per UI

---------

Co-authored-by: Marco Collovati <[email protected]>
mshabarov pushed a commit to vaadin/flow that referenced this pull request Oct 7, 2024
* fix: HMR for translation files

* Clears resource bundle cache on translation resource redeployment
* Fires a HMR event to the browser when translations are reloaded

Limitation: Only supports DefaultI18NHandler where the paths are known. If you have a custom I18N handler, you might need a custom HMR supporting HotswapListener.

For #20118
Requires vaadin/hilla#2795 to fully fix the issue

* format

* trigger Flow UIs refresh

* flow support

* detect correct refresh stragety per UI

---------

Co-authored-by: Artur <[email protected]>
Co-authored-by: Marco Collovati <[email protected]>
@platosha platosha enabled auto-merge (squash) October 16, 2024 09:42
Copy link

sonarcloud bot commented Oct 16, 2024

@platosha platosha merged commit 9017296 into main Oct 16, 2024
15 checks passed
@platosha platosha deleted the translate-hmr branch October 16, 2024 09:52
@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.

[i18n] Add support for HMR when changing translations
4 participants