You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GWT version: GWT 2.11 and below Browser (with version): Chrome 120 (soft rollout, see chrome link below) Operating System: any
Description
Browsers are removing the unload even on the browser, as there are replacements available, and the unload event can interfere with newer browser features. See the MDN docs on the unload event for more specifics.
Chrome specifically has a deprecation policy that is warning that this will be removed in the future. For GWT's own usage of unload, this shouldn't matter:
Other window events are removed when this event goes off, to avoid memory leaks (only applies to ancient browsers)
RootPanel itself adds a close handler to ensure that all widgets are disconnected, to avoid memory leaks (as above, no longer applies)
The long-deprecated WindowCloseListener handling also uses this feature.
Steps to reproduce
Use some Window/RootPanel API directly to monitor unload events, or indirectly with window resize/scroll/beforeunload events (such as with PlaceController, DialogBox, RootLayoutPanel). In chrome, you may see a warning/errors that unload events are deprecated for removal.
To fix this, we can probably remove this class of "memory-leak prevention" (which no longer applies in any browser created in the last ten years) - this means RootPanel need not use it, and Window need not initialize close handlers for window resize/scroll events. Likewise, split unload/beforeunload handling to separate initializers.
Window.addCloseHandler should also be deprecated.
This should probably be backported, given Chrome's timeline for this deprecation, unless we get 2.12 to a finished state (and it is barely started) in the next few weeks.
GWT version: GWT 2.11 and below
Browser (with version): Chrome 120 (soft rollout, see chrome link below)
Operating System: any
Description
Browsers are removing the
unload
even on the browser, as there are replacements available, and the unload event can interfere with newer browser features. See the MDN docs on the unload event for more specifics.Chrome specifically has a deprecation policy that is warning that this will be removed in the future. For GWT's own usage of unload, this shouldn't matter:
WindowCloseListener
handling also uses this feature.Steps to reproduce
Use some Window/RootPanel API directly to monitor unload events, or indirectly with window resize/scroll/beforeunload events (such as with PlaceController, DialogBox, RootLayoutPanel). In chrome, you may see a warning/errors that unload events are deprecated for removal.
To fix this, we can probably remove this class of "memory-leak prevention" (which no longer applies in any browser created in the last ten years) - this means RootPanel need not use it, and Window need not initialize close handlers for window resize/scroll events. Likewise, split unload/beforeunload handling to separate initializers.
Window.addCloseHandler should also be deprecated.
This should probably be backported, given Chrome's timeline for this deprecation, unless we get 2.12 to a finished state (and it is barely started) in the next few weeks.
Links to further discussions
https://groups.google.com/g/google-web-toolkit/c/ZVc9yztBurs
The text was updated successfully, but these errors were encountered: