You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a high-level overview of the relationship between Vite's HMR and our SDK (node_modules/wasp):
We want Vite to watch node_modules/wasp. If it didn't, we'd have to rerun wasp start on every significant change.
On the other hand, we don't want Vite to clear the web app's state and do a full site refresh unless necessary.
By default, TypeScript updates all output files regardless of whether they change or not. Also, Vite (again by default) decides whether to perform a refresh based on files' timestamps. Together, these two behaviors resulted in many redundant site refreshes.
Possible solutions:
The best solution would be making Vite smarter when detecting changes (for example, by comparing file hashes instead of their timestamps).
If that isn't possible, the second-best solution would be preventing TypeScript from updating unchaged output files, which can be done with the incremental compiler option.
Since redundant refreshes and output noise proved frustrating to our users, #1931 implemented the second option (incremental updates). This had a nice side effect of speeding up the SDK build.
We didn't have time to properly explore the first option (smart changes detection)
Therefore, we should
Explore the possibility of making Vite smarter about deciding when to refresh.
Figure out why this guy claims that it isn't possible to watch a locally linked package when it seems that it's not only possible but also unavoidable? Have we missed something?
The text was updated successfully, but these errors were encountered:
We had some Vite HMR problems and fixed them by introducing the
incremental
option to the TS compiler. Context:incremental
#1931Here's a high-level overview of the relationship between Vite's HMR and our SDK (
node_modules/wasp
):node_modules/wasp
. If it didn't, we'd have to rerunwasp start
on every significant change.By default, TypeScript updates all output files regardless of whether they change or not. Also, Vite (again by default) decides whether to perform a refresh based on files' timestamps. Together, these two behaviors resulted in many redundant site refreshes.
Possible solutions:
incremental
compiler option.Since redundant refreshes and output noise proved frustrating to our users, #1931 implemented the second option (
incremental
updates). This had a nice side effect of speeding up the SDK build.We didn't have time to properly explore the first option (smart changes detection)
Therefore, we should
The text was updated successfully, but these errors were encountered: