Skip to content

Enabling Tailwind and hot deploy results in full page reload every time a Java file changes #22722

@sissbruecker

Description

@sissbruecker

Description of the bug

After enabling the Tailwind feature flag and enabling hot deploy mode any change in a Java file (and saving it to disk) results in a full page reload. Presumably because all Java files are detected as a dependency in the Vite build? As mentioned in #22721, Tailwind is essentially useless during development if you do not use hot deploy so this will affect everyone using Tailwind.

Without using hotswap this behavior doesn't help at all as, even though the CSS is potentially updated with new Tailwind classes from the Vite build, the DOM is not updated because the Java class is not recompiled and hot swapped in the JVM.

With hotswap adding or removing Tailwind classes basically works. However it also essentially breaks hot swap as that should update the DOM in the current page instead of reloading the page on every change.

Expected behavior

Without hotswap:

  • It should not reload the page when saving the file
  • It should reload the page if I recompile manually and use something like the Spring dev tools live reload, which would then result in having both the updated DOM and CSS in the browser

With hotswap:

  • It should not reload the page when saving the file
  • It should hot swap the DOM so that any new or removed Tailwind classes end up in the DOM
  • It should hot swap the CSS so that any new or removed Tailwind classes end up in the CSS

Minimal reproducible example

  • Enable the Tailwind feature flag
  • Enable hot deploy mode
  • Start the app in dev mode with / without hotswap
  • Change some Java file to add or remove Tailwind classes

Versions

  • Vaadin / Flow version: 25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 Needs triage

    Status

    🪵Product backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions