martasp / BlazorLiveReload

BlazorLiveReload
142 stars 14 forks source link

Preview does not support interactivity #5

Open dharmaturtle opened 4 years ago

dharmaturtle commented 4 years ago

This is a very interesting idea, but unfortunately, the /preview page isn't interactive. If I understand the code correctly, it renders the most recently changed *.razor to a file called preview.html. However, due to preview.html being a static file, you can't interact with it, i.e. push the Counter button to increment the count.

This is still great for previewing HTML tweaks so you don't have to wait for everything to recompile. Sometimes you don't want to test interactivity - you just wanna see what it looks like!

If my other PR goes through, I'll make a new one to add these details to your Readme :)

martasp commented 4 years ago

Yes, you are correct, it renders the most recently changed *.razor files.

There is an idea to intercept every request and add WebSockets code to every page. That means it should work for every route.