Skip to content

Tailwind integration bypasses regular hotswap #24033

@Legioth

Description

@Legioth

Description of the bug

When using the experimental Tailwind integration, the browser is immediately reloaded when making a change to the Java code. This leads to needless flickering and does also discard state such as scroll positions and signal values that are preserved by the regular hotswap logic.

Expected behavior

State should be preserved also when using Tailwind

Minimal reproducible example

@Route
public class MainView extends VerticalLayout {
    ValueSignal<Boolean> signal = new ValueSignal<>(false);
    public MainView() {
        var toggle = new Checkbox("State");
        toggle.bindValue(signal, signal::set);
        toggle.addClassName("bg-green-500");
        add(toggle);
    }
}
  1. Get a Vaadin 25.1 project without example view from start.vaadin.com
  2. Add the example view and run the application with hotswap enabled
  3. Check the checkbox
  4. Change the checkbox label in the code and observe that the change is hotswapped without a page reload and the checkbox remains checked
  5. Enable the Tailwind feature flag (com.vaadin.experimental.tailwindCss)
  6. Restart the server
  7. Repeat steps 3 & 4, observing that the page is reloaded in the browser and the checkbox doesn't remain checked

Versions

  • Vaadin / Flow version: 25.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions