Possibility to disable wasp reload on UI file changes?

Hey my dudes, is it possible to calm down this guy on the screenshot from reloading everything every time UI files change? The issue is that I get everything hot reloaded thanks to Vite, and the app reloads itself few seconds afterwards again and so it happens on every change πŸ™ much love to y'all
No description
15 Replies
Filip
Filipβ€’3mo ago
Hi @IamIconLiving πŸŽ„, No way to calm down the guy yet, unfortunately πŸ˜„ Btw, why is this causing you issues. Is it because of the excessive output or because the reloads slow down your workflow? Just asking so we know which part to improve. Thanks for the feedback! The same question goes out to @Gwaggli, @kaur and @mindreaderlupoDO. I see you guys liked @IamIconLiving πŸŽ„'s post, so... Why is constant reloading a problem for you? πŸ˜„
IamIconLiving
IamIconLivingβ€’3mo ago
Thanks for getting back to me! This is just an annoying thing to see entire app reloading after a second or so once a change was made. Like I can see already a change reflected in my UI, thanks to hot reload, but then entire window gets reloaded. I am not even sure if this affects local state or not (haven’t went deep enough), like if the entire app reload does or does not reset local state, but even if it does not - it just visually blinks and reloads entire window is annoying πŸ₯²
Gwaggli
Gwaggliβ€’3mo ago
Exact same as @IamIconLiving πŸŽ„ described. For me the most annoying part is either when i play around with some styling and make multiple changes very quickly to try it out. So it applies each change directly but soon afterwards it start reloading page over and over again. Other annoyance is when having non url reflected state changes being reset. Like form values, open modals or accordions. Both just minor inconveniences but would be very nice to get rid of them.
IamIconLiving
IamIconLivingβ€’3mo ago
Ah, so local state does gets reset. Yeah it would be way more convenient to not do it. Maybe an optional flag to cli, ability to give a path to ignore sdk rebuild maybe πŸ€”
mindreaderlupoDO
mindreaderlupoDOβ€’3mo ago
When I change just a div className and I hit Ctrl+s, alt-tab to switch from VSCode to the browser, than I see the change for approx. Half a second and then everything reloads which takes another second. It disrupts the workflow and is annoying. Maybe it's especially annoying because of my 1-screen setup
kaur
kaurβ€’3mo ago
I'm working with input based data, and haven't implemented local storage based saving yet. Currently the reloads mean that the data is wiped each time a reload happens, which probably won't be an issue in prod, but is annoying to deal with in a dev environment.
Gwain
Gwainβ€’3mo ago
Agree 100% with this also. App should not be rebuilding after every UI change.
MEE6
MEE6β€’3mo ago
Wohooo @Gwain, you just became a Waspeteer level 3!
miho
mihoβ€’3mo ago
That shouldn't happen for Vite + React apps. Usually, Vite HMR works well and keeps the state. This might a new bug that we maybe introduced with 0.12 🀨 People in the thread, do you have some repo to share so we can try it ourselves? @here
Gwaggli
Gwaggliβ€’3mo ago
@miho I can reproduce it with a clean wasp new with the basic template. If you change the text on the welcome page it is refreshed directly but the app starts rebuilding and soon after that the page makes a full reload. To experience kind of the pain, make multiple changes quickly (cmd+S after every character for example) or add an input field, make a change, type something into the field quickly and then see it lose its content after page refresh. Also the whole app rebuilds when editing a test file. (was also able to reproduce this with the basic example and a single test file)
IamIconLiving
IamIconLivingβ€’3mo ago
reproduced it with open saas template let me know if you can't repro, I will upload it to a github repo, maybe that will help
miho
mihoβ€’3mo ago
Thank you! I'll try it out and see what is happening 😊
Filip
Filipβ€’3mo ago
Thanks for all the feedback, fellas. Much appreciated! As Miho said, we probably have a file watching error. We even have an issue for it but haven't gotten to it yet πŸ˜… : https://github.com/wasp-lang/wasp/issues/1844 One of us will investigate and get back to you. @miho You got this or should I check it out?
IamIconLiving
IamIconLivingβ€’3mo ago
rockstars as always! thanks
Filip
Filipβ€’3mo ago
Hi guys, happy to let you know that this has been fixed in the newest version of Wasp. You can get Wasp 0.13.1 with:
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s
There are no breaking changes, let us know if this works. Thanks again for reporting this! 😁 Btw, version 0.13.1 comes with another improvement: IDE autocomplete for wasp imports now works much better. You won't have to guess import paths anymore! For this one to work, you'll have to add two lines to your project's tsconfig under compilerOptions:
{
"compilerOptions" {
"target": "esnext",
"moduleResolution": "bundler",
// ...
}
// ...
}
{
"compilerOptions" {
"target": "esnext",
"moduleResolution": "bundler",
// ...
}
// ...
}
Full changelog if you're curious: https://github.com/wasp-lang/wasp/releases/tag/v0.13.1 That's all from me, no more messages πŸ˜