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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import com.vaadin.flow.server.VaadinSession;

import elemental.json.Json;
import elemental.json.JsonObject;

/**
* Entry point for application classes hot reloads.
Expand Down Expand Up @@ -180,6 +179,11 @@ public void onHotswap(URI[] createdResources, URI[] modifiedResources,
// Clear resource bundle cache so that translations (and other
// resources) are reloaded
ResourceBundle.clearCache();
// Trigger UI refresh
EnumMap<UIRefreshStrategy, List<UI>> refreshStrategy = new EnumMap<>(
UIRefreshStrategy.class);
refreshStrategy.put(UIRefreshStrategy.REFRESH, List.of());
Artur- marked this conversation as resolved.
Show resolved Hide resolved
triggerClientUpdate(refreshStrategy, false);
// Trigger any potential Hilla translation updates
liveReload.sendHmrEvent("translations-update", Json.createObject());
}
Expand Down
Loading