WebSlides icon indicating copy to clipboard operation
WebSlides copied to clipboard

Slide development with hot reload?

Open hermann-p opened this issue 8 months ago • 0 comments

My first impression with WebSlides was - wow! This is super easy and I can preview my slides while I create them! Just hook it up to a library that hotloads DOM and I have instant feedback!

It turns out that WebSlides is not built with that in mind, but initialises the slides once on load. I created a workaround, calling essentially the tail of the constructor, that is on each hot reload, I'll do

ws.removeChildren_();
ws.grabSlides_();
ws.initSlides_();
ws.onInit_();

This will reload the slides with my changes. However, it will also clear the screen until I navigate once. I overcam that by also calling

history.go();

Now I have some working hot-reload, but it's super hacky and dependent on internals. Is there any way to do that better?

hermann-p avatar May 23 '25 08:05 hermann-p