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

Adding a route causes a full page reload #2749

Open
Artur- opened this issue Sep 20, 2024 · 2 comments
Open

Adding a route causes a full page reload #2749

Artur- opened this issue Sep 20, 2024 · 2 comments
Labels
bug Something isn't working hilla Issues related to Hilla

Comments

@Artur-
Copy link
Member

Artur- commented Sep 20, 2024

Describe the bug

When you add a route to a running Hilla app, the full page is reloaded.
In some cases also, the menu if missing thew new route after reload.

The vite WS connection contains

{"type":"full-reload"}
{"type":"full-reload","triggeredBy":"/.../hilla-add-route/src/main/frontend/generated/file-routes.ts"}

Expected-behavior

There is no page reload, like with other frontend file changes

Reproduction

npm init vaadin@latest hilla-add-route
cd hilla-add-route
mvn
# When running
cp src/main/frontend/views/about-hilla.tsx src/main/frontend/views/about2.tsx

System Info

Hilla: 24.5.0.beta1
Flow: 24.5.0.beta1
Vaadin: 24.5.0.beta1
Copilot: 24.5.0.beta1
Frontend Hotswap: Enabled, using Vite
OS: aarch64 Mac OS X 15.0
Java: JetBrains s.r.o. 21.0.3
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Java Hotswap: false
IDE Plugin: false

@Artur- Artur- added bug Something isn't working hilla Issues related to Hilla labels Sep 20, 2024
@Artur-
Copy link
Member Author

Artur- commented Sep 20, 2024

The second full reload command is related to vaadin-react.tsx not having support for HMR. By implementing support in a suitable way in https://github.com/vaadin/flow/blob/main/flow-server/src/main/resources/com/vaadin/flow/server/frontend/vaadin-react.tsx, the second reload changes into a HMR for /generated/vaadin-react.tsx, /generated/index.tsx

@Artur-
Copy link
Member Author

Artur- commented Sep 20, 2024

The first full reload command originates In the Hilla file router plugin:

server.hot.send({ type: 'full-reload' });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla Issues related to Hilla
Projects
None yet
Development

No branches or pull requests

1 participant