#205·WebSlides

Slide development with hot reload?

Author: hermann-pCreated May 23, 2025Updated May 23, 2025

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?