Flow: Immediately detach the old UI when the browser tab is closed or refreshed

Created on 21 Aug 2019  路  2Comments  路  Source: vaadin/flow

The Beacon API is now relatively widely available, making it possible to propagate an unload event to the server when a tab is closed/refresh without affecting user experience.

This could be used to close UIs on close/refresh immediately, without waiting for expiration due to missed heartbeats. This has the potential to improve performance, primarily by decreasing memory consumption.

The heartbeat expiration or similar is still needed for when the unload event can not be propagated to the server, e.g. when the user loses network connectivity.

core enhancement

Most helpful comment

Now with Flow 3.0 and Vaadin 15, the needed API is available in all the supported browsers as IE11 and Safari 11 are not supported anymore. This means that there is no real blockers for implementing the API for Java driven UIs (15+).

For Vaadin 14, this could be maybe considered backported as an "experimental" feature that can be enabled. Not sure if there is any trouble for users if UIs are cleaned up eagerly for some browsers, but not all.

All 2 comments

Now with Flow 3.0 and Vaadin 15, the needed API is available in all the supported browsers as IE11 and Safari 11 are not supported anymore. This means that there is no real blockers for implementing the API for Java driven UIs (15+).

For Vaadin 14, this could be maybe considered backported as an "experimental" feature that can be enabled. Not sure if there is any trouble for users if UIs are cleaned up eagerly for some browsers, but not all.

We've implemented a Beacon handler as part of Collaboration Engine. It would be great if it could be moved over to the core framework instead.

Was this page helpful?
0 / 5 - 0 ratings