nksaraf / vinxi

The Full Stack JavaScript SDK
https://vinxi.vercel.app
MIT License
1.99k stars 78 forks source link

HMR Update together and full-reload messages #135

Open IvanLisz opened 9 months ago

IvanLisz commented 9 months ago

image

Steps to Reproduce:

  1. Start vinxi dev server (tested with solid-start and solid router example)
  2. Edit a file
  3. Observe WS messages: full page reload and HMR update.
IvanLisz commented 9 months ago

Commenting out https://github.com/nksaraf/vinxi/blob/d3e490dc66d4e8370b75188208a413e5f27463c0/packages/vinxi/lib/plugins/fs-watcher.js#L57

makes it work

nksaraf commented 9 months ago

We can clean this up a bit but the intention here is that if the routes change ( new gets added, something gets removed, some exports get changed, etc.) we should do full reload to get the new routing config.

This should only happen when changing something in the route file itself. Not other files.

IvanLisz commented 9 months ago

This removes the reload for a route update, but keeps it for route remove/add. https://github.com/nksaraf/vinxi/pull/137 Do you think this would be ok? Is there any case, besides routeData where you would need a full reload?

This seems closer to the previous solid-start behavior where HMR works on route update, while new/delete route triggers a reload.