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 translation files #20142

Merged
merged 5 commits into from
Oct 7, 2024
Merged

feat: HMR for translation files #20142

merged 5 commits into from
Oct 7, 2024

Conversation

Artur-
Copy link
Member

@Artur- Artur- commented 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

github-actions bot commented Oct 4, 2024

Test Results

1 140 files  ± 0  1 140 suites  ±0   1h 9m 57s ⏱️ -11s
7 422 tests ± 0  7 372 ✅ ± 0  50 💤 ±0  0 ❌ ±0 
7 765 runs   - 21  7 705 ✅  - 21  60 💤 ±0  0 ❌ ±0 

Results for commit 248c050. ± Comparison against base commit 4cf08cf.

♻️ This comment has been updated with latest results.

* 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
@Artur- Artur- force-pushed the clear-bundle-cache branch from 611bb29 to de04118 Compare October 4, 2024 12:39
@Artur- Artur- changed the title fix: Clear resource bundle cache on resource redeployment feat: HMR for translation files Oct 4, 2024
@vaadin-bot vaadin-bot added +0.1.0 and removed +0.0.1 labels Oct 4, 2024
Copy link

sonarcloud bot commented Oct 4, 2024

Copy link
Collaborator

@mcollovati mcollovati left a comment

Choose a reason for hiding this comment

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

Translation file changes are correctly handled by the Flow Hotswapper.
For Flow views, the page is refreshed (no page reload) using PUSH (if enabled) or browser live reload websocket channel.
I couldn't test with Hilla, but the browser live reload correctly forwards the hmr event to the client.

@Artur-
Copy link
Member Author

Artur- commented Oct 7, 2024

Hilla needs a slightly different version of vaadin/hilla#2795 and can be tested as part of that one

@mshabarov mshabarov merged commit eb2ecb9 into main Oct 7, 2024
26 checks passed
@mshabarov mshabarov deleted the clear-bundle-cache branch October 7, 2024 08:23
vaadin-bot pushed a commit 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 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]>
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.

4 participants