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

HotSwapAgent refreshes UI after Dialog open #20681

Closed
Hankonen opened this issue Dec 11, 2024 · 2 comments · Fixed by #20684
Closed

HotSwapAgent refreshes UI after Dialog open #20681

Hankonen opened this issue Dec 11, 2024 · 2 comments · Fixed by #20684

Comments

@Hankonen
Copy link

Description of the bug

If I have hotswap enabled and I open a Dialog for example from a Button press it closes immediately since hotswap refreshes the UI. I saw some other wierd UI refreshing happening all around but the Dialog was the easiest to pinpoint as the other cases were not so visible (e.g. some partial refresh just before changing views etc.).

Expected behavior

The UI should not be refreshed by hotswap if no actual change has occurred.

Minimal reproducible example

My setup was:
Eclipse 2024-09
Tomcat 10.1.31

JetBrainsRuntime from https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17_0_1b164.4
(windows-x64 JBR with JCEF (DCEVM))

HotSwapAgent from https://github.com/HotswapProjects/HotswapAgent/releases
(version 2.0.0)
Add the hotswap-agent.jar to YOUR_PATH/jbr/lib/hotswap/ directory (remove the version numbers from the name of the .jar file).

Get the plain Java Vaadin starter: https://github.com/vaadin/skeleton-starter-flow/archive/v24.zip
(Vaadin version 24.5.7 or 24.5.8)

Import the starter to Eclipse and add a new Tomcat 10.1 server and the starter module to it.
Set the JetBrainsRuntime as the JRE for the server.
Add this to the servers Launch configurations Arguments:
-XX:+AllowEnhancedClassRedefinition -XX:HotswapAgent=fatjar

In the starters MainView.class add a Button in the constructor:

		this.add(new Button("Test", e -> {
			Dialog d = new Dialog();
			d.open();
		}));

Start the server and navigate to the application in browser.
When clicking the "Test" button a Dialog should pop open and then immediately close.

Versions

  • Vaadin / Flow version: 24.5.7 and 24.5.8
  • Java version: 17
  • OS version: Windows 10
  • Application Server (if applicable): Tomcat 10.1.31
  • IDE (if applicable): Eclipse 2024-09
mcollovati added a commit that referenced this issue Dec 12, 2024
Prevent hotswapper to trigger a refresh when the classes are loaded for the
first time. Refreshing a view should make sense only if a project class has
been modified. The only exception is auto layout classes, that must be
applied even if they are not directly references in the component tree.

Fixes #20680
Fixes #20681
@mshabarov mshabarov moved this from 🆕 Needs triage to 🏗 WIP in Vaadin Flow bugs & maintenance (Vaadin 10+) Dec 17, 2024
@mshabarov mshabarov moved this to 🔎Iteration reviews in Vaadin Flow ongoing work (Vaadin 10+) Dec 17, 2024
@github-project-automation github-project-automation bot moved this from 🔎Iteration reviews to Done in Vaadin Flow ongoing work (Vaadin 10+) Dec 19, 2024
vaadin-bot pushed a commit that referenced this issue Dec 19, 2024
Prevent hotswapper to trigger a refresh when the classes are loaded for the
first time. Refreshing a view should make sense only if a project class has
been modified. The only exception is auto layout classes, that must be
applied even if they are not directly references in the component tree.

Fixes #20680
Fixes #20681
vaadin-bot pushed a commit that referenced this issue Dec 19, 2024
Prevent hotswapper to trigger a refresh when the classes are loaded for the
first time. Refreshing a view should make sense only if a project class has
been modified. The only exception is auto layout classes, that must be
applied even if they are not directly references in the component tree.

Fixes #20680
Fixes #20681
vaadin-bot added a commit that referenced this issue Dec 19, 2024
…20751)

Prevent hotswapper to trigger a refresh when the classes are loaded for the
first time. Refreshing a view should make sense only if a project class has
been modified. The only exception is auto layout classes, that must be
applied even if they are not directly references in the component tree.

Fixes #20680
Fixes #20681

Co-authored-by: Marco Collovati <[email protected]>
vaadin-bot added a commit that referenced this issue Dec 19, 2024
…20752)

Prevent hotswapper to trigger a refresh when the classes are loaded for the
first time. Refreshing a view should make sense only if a project class has
been modified. The only exception is auto layout classes, that must be
applied even if they are not directly references in the component tree.

Fixes #20680
Fixes #20681

Co-authored-by: Marco Collovati <[email protected]>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.9.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants